get Vpc Endpoint
The VPC Endpoint data source provides details about a specific VPC endpoint.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
// Declare the data source
const s3 = aws.ec2.getVpcEndpoint({
vpcId: foo.id,
serviceName: "com.amazonaws.us-west-2.s3",
});
const privateS3 = new aws.ec2.VpcEndpointRouteTableAssociation("private_s3", {
vpcEndpointId: s3.then(s3 => s3.id),
routeTableId: _private.id,
});
import pulumi
import pulumi_aws as aws
# Declare the data source
s3 = aws.ec2.get_vpc_endpoint(vpc_id=foo["id"],
service_name="com.amazonaws.us-west-2.s3")
private_s3 = aws.ec2.VpcEndpointRouteTableAssociation("private_s3",
vpc_endpoint_id=s3.id,
route_table_id=private["id"])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
// Declare the data source
var s3 = Aws.Ec2.GetVpcEndpoint.Invoke(new()
{
VpcId = foo.Id,
ServiceName = "com.amazonaws.us-west-2.s3",
});
var privateS3 = new Aws.Ec2.VpcEndpointRouteTableAssociation("private_s3", new()
{
VpcEndpointId = s3.Apply(getVpcEndpointResult => getVpcEndpointResult.Id),
RouteTableId = @private.Id,
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Declare the data source
s3, err := ec2.LookupVpcEndpoint(ctx, &ec2.LookupVpcEndpointArgs{
VpcId: pulumi.StringRef(foo.Id),
ServiceName: pulumi.StringRef("com.amazonaws.us-west-2.s3"),
}, nil)
if err != nil {
return err
}
_, err = ec2.NewVpcEndpointRouteTableAssociation(ctx, "private_s3", &ec2.VpcEndpointRouteTableAssociationArgs{
VpcEndpointId: pulumi.String(s3.Id),
RouteTableId: pulumi.Any(private.Id),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.Ec2Functions;
import com.pulumi.aws.ec2.inputs.GetVpcEndpointArgs;
import com.pulumi.aws.ec2.VpcEndpointRouteTableAssociation;
import com.pulumi.aws.ec2.VpcEndpointRouteTableAssociationArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
// Declare the data source
final var s3 = Ec2Functions.getVpcEndpoint(GetVpcEndpointArgs.builder()
.vpcId(foo.id())
.serviceName("com.amazonaws.us-west-2.s3")
.build());
var privateS3 = new VpcEndpointRouteTableAssociation("privateS3", VpcEndpointRouteTableAssociationArgs.builder()
.vpcEndpointId(s3.id())
.routeTableId(private_.id())
.build());
}
}
resources:
privateS3:
type: aws:ec2:VpcEndpointRouteTableAssociation
name: private_s3
properties:
vpcEndpointId: ${s3.id}
routeTableId: ${private.id}
variables:
# Declare the data source
s3:
fn::invoke:
function: aws:ec2:getVpcEndpoint
arguments:
vpcId: ${foo.id}
serviceName: com.amazonaws.us-west-2.s3
Return
A collection of values returned by getVpcEndpoint.
Parameters
A collection of arguments for invoking getVpcEndpoint.
Return
A collection of values returned by getVpcEndpoint.
Parameters
Custom filter block as described below.
ID of the specific VPC Endpoint to retrieve.
Service name of the specific VPC Endpoint to retrieve. For AWS services the service name is usually in the form com.amazonaws.<region>.<service>
(the SageMaker AI Notebook service is an exception to this rule, the service name is in the form aws.sagemaker.<region>.notebook
).
State of the specific VPC Endpoint to retrieve.
Map of tags, each pair of which must exactly match a pair on the specific VPC Endpoint to retrieve.
ID of the VPC in which the specific VPC Endpoint is used. The arguments of this data source act as filters for querying the available VPC endpoints. The given filters must match exactly one VPC endpoint whose data will be exported as attributes.
See also
Return
A collection of values returned by getVpcEndpoint.
Parameters
Builder for com.pulumi.aws.ec2.kotlin.inputs.GetVpcEndpointPlainArgs.