VpcEndpoint
Provides a VPC Endpoint resource.
NOTE on VPC Endpoints and VPC Endpoint Associations: This provider provides both standalone VPC Endpoint Associations for Route Tables - (an association between a VPC endpoint and a single
route_table_id) and Subnets - (an association between a VPC endpoint and a singlesubnet_id) and a VPC Endpoint resource withroute_table_idsandsubnet_idsattributes. Do not use the same resource ID in both a VPC Endpoint resource and a VPC Endpoint Association resource. Doing so will cause a conflict of associations and will overwrite the association.
Example Usage
Basic
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var s3 = new Aws.Ec2.VpcEndpoint("s3", new Aws.Ec2.VpcEndpointArgs
{
ServiceName = "com.amazonaws.us-west-2.s3",
VpcId = aws_vpc.Main.Id,
});
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ec2.NewVpcEndpoint(ctx, "s3", &ec2.VpcEndpointArgs{
ServiceName: pulumi.String("com.amazonaws.us-west-2.s3"),
VpcId: pulumi.String(aws_vpc.Main.Id),
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
s3 = aws.ec2.VpcEndpoint("s3",
service_name="com.amazonaws.us-west-2.s3",
vpc_id=aws_vpc["main"]["id"])import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const s3 = new aws.ec2.VpcEndpoint("s3", {
serviceName: "com.amazonaws.us-west-2.s3",
vpcId: aws_vpc_main.id,
});Basic w/ Tags
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var s3 = new Aws.Ec2.VpcEndpoint("s3", new Aws.Ec2.VpcEndpointArgs
{
ServiceName = "com.amazonaws.us-west-2.s3",
Tags =
{
{ "Environment", "test" },
},
VpcId = aws_vpc.Main.Id,
});
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ec2.NewVpcEndpoint(ctx, "s3", &ec2.VpcEndpointArgs{
ServiceName: pulumi.String("com.amazonaws.us-west-2.s3"),
Tags: pulumi.StringMap{
"Environment": pulumi.String("test"),
},
VpcId: pulumi.String(aws_vpc.Main.Id),
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
s3 = aws.ec2.VpcEndpoint("s3",
service_name="com.amazonaws.us-west-2.s3",
tags={
"Environment": "test",
},
vpc_id=aws_vpc["main"]["id"])import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const s3 = new aws.ec2.VpcEndpoint("s3", {
serviceName: "com.amazonaws.us-west-2.s3",
tags: {
Environment: "test",
},
vpcId: aws_vpc_main.id,
});Create a VpcEndpoint Resource
new VpcEndpoint(name: string, args: VpcEndpointArgs, opts?: CustomResourceOptions);def VpcEndpoint(resource_name, opts=None, auto_accept=None, policy=None, private_dns_enabled=None, route_table_ids=None, security_group_ids=None, service_name=None, subnet_ids=None, tags=None, vpc_endpoint_type=None, vpc_id=None, __props__=None);func NewVpcEndpoint(ctx *Context, name string, args VpcEndpointArgs, opts ...ResourceOption) (*VpcEndpoint, error)public VpcEndpoint(string name, VpcEndpointArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args VpcEndpointArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args VpcEndpointArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VpcEndpointArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
VpcEndpoint Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The VpcEndpoint resource accepts the following input properties:
- Service
Name string The service name. For AWS services the service name is usually in the form
com.amazonaws.<region>.<service>(the SageMaker Notebook service is an exception to this rule, the service name is in the formaws.sagemaker.<region>.notebook).- Vpc
Id string The ID of the VPC in which the endpoint will be used.
- Auto
Accept bool Accept the VPC endpoint (the VPC endpoint and service need to be in the same AWS account).
- Policy string
A policy to attach to the endpoint that controls access to the service. Defaults to full access. All
Gatewayand someInterfaceendpoints support policies - see the relevant AWS documentation for more details.- Private
Dns boolEnabled Whether or not to associate a private hosted zone with the specified VPC. Applicable for endpoints of type
Interface. Defaults tofalse.- Route
Table List<string>Ids One or more route table IDs. Applicable for endpoints of type
Gateway.- Security
Group List<string>Ids The ID of one or more security groups to associate with the network interface. Required for endpoints of type
Interface.- Subnet
Ids List<string> The ID of one or more subnets in which to create a network interface for the endpoint. Applicable for endpoints of type
Interface.- Dictionary<string, string>
A map of tags to assign to the resource.
- Vpc
Endpoint stringType The VPC endpoint type,
GatewayorInterface. Defaults toGateway.
- Service
Name string The service name. For AWS services the service name is usually in the form
com.amazonaws.<region>.<service>(the SageMaker Notebook service is an exception to this rule, the service name is in the formaws.sagemaker.<region>.notebook).- Vpc
Id string The ID of the VPC in which the endpoint will be used.
- Auto
Accept bool Accept the VPC endpoint (the VPC endpoint and service need to be in the same AWS account).
- Policy string
A policy to attach to the endpoint that controls access to the service. Defaults to full access. All
Gatewayand someInterfaceendpoints support policies - see the relevant AWS documentation for more details.- Private
Dns boolEnabled Whether or not to associate a private hosted zone with the specified VPC. Applicable for endpoints of type
Interface. Defaults tofalse.- Route
Table []stringIds One or more route table IDs. Applicable for endpoints of type
Gateway.- Security
Group []stringIds The ID of one or more security groups to associate with the network interface. Required for endpoints of type
Interface.- Subnet
Ids []string The ID of one or more subnets in which to create a network interface for the endpoint. Applicable for endpoints of type
Interface.- map[string]string
A map of tags to assign to the resource.
- Vpc
Endpoint stringType The VPC endpoint type,
GatewayorInterface. Defaults toGateway.
- service
Name string The service name. For AWS services the service name is usually in the form
com.amazonaws.<region>.<service>(the SageMaker Notebook service is an exception to this rule, the service name is in the formaws.sagemaker.<region>.notebook).- vpc
Id string The ID of the VPC in which the endpoint will be used.
- auto
Accept boolean Accept the VPC endpoint (the VPC endpoint and service need to be in the same AWS account).
- policy string
A policy to attach to the endpoint that controls access to the service. Defaults to full access. All
Gatewayand someInterfaceendpoints support policies - see the relevant AWS documentation for more details.- private
Dns booleanEnabled Whether or not to associate a private hosted zone with the specified VPC. Applicable for endpoints of type
Interface. Defaults tofalse.- route
Table string[]Ids One or more route table IDs. Applicable for endpoints of type
Gateway.- security
Group string[]Ids The ID of one or more security groups to associate with the network interface. Required for endpoints of type
Interface.- subnet
Ids string[] The ID of one or more subnets in which to create a network interface for the endpoint. Applicable for endpoints of type
Interface.- {[key: string]: string}
A map of tags to assign to the resource.
- vpc
Endpoint stringType The VPC endpoint type,
GatewayorInterface. Defaults toGateway.
- service_
name str The service name. For AWS services the service name is usually in the form
com.amazonaws.<region>.<service>(the SageMaker Notebook service is an exception to this rule, the service name is in the formaws.sagemaker.<region>.notebook).- vpc_
id str The ID of the VPC in which the endpoint will be used.
- auto_
accept bool Accept the VPC endpoint (the VPC endpoint and service need to be in the same AWS account).
- policy str
A policy to attach to the endpoint that controls access to the service. Defaults to full access. All
Gatewayand someInterfaceendpoints support policies - see the relevant AWS documentation for more details.- private_
dns_ boolenabled Whether or not to associate a private hosted zone with the specified VPC. Applicable for endpoints of type
Interface. Defaults tofalse.- route_
table_ List[str]ids One or more route table IDs. Applicable for endpoints of type
Gateway.- security_
group_ List[str]ids The ID of one or more security groups to associate with the network interface. Required for endpoints of type
Interface.- subnet_
ids List[str] The ID of one or more subnets in which to create a network interface for the endpoint. Applicable for endpoints of type
Interface.- Dict[str, str]
A map of tags to assign to the resource.
- vpc_
endpoint_ strtype The VPC endpoint type,
GatewayorInterface. Defaults toGateway.
Outputs
All input properties are implicitly available as output properties. Additionally, the VpcEndpoint resource produces the following output properties:
- Arn string
The Amazon Resource Name (ARN) of the VPC endpoint.
- Cidr
Blocks List<string> The list of CIDR blocks for the exposed AWS service. Applicable for endpoints of type
Gateway.- Dns
Entries List<VpcEndpoint Dns Entry> The DNS entries for the VPC Endpoint. Applicable for endpoints of type
Interface. DNS blocks are documented below.- Id string
- The provider-assigned unique ID for this managed resource.
- Network
Interface List<string>Ids One or more network interfaces for the VPC Endpoint. Applicable for endpoints of type
Interface.- Owner
Id string The ID of the AWS account that owns the VPC endpoint.
- Prefix
List stringId The prefix list ID of the exposed AWS service. Applicable for endpoints of type
Gateway.- Requester
Managed bool Whether or not the VPC Endpoint is being managed by its service -
trueorfalse.- State string
The state of the VPC endpoint.
- Arn string
The Amazon Resource Name (ARN) of the VPC endpoint.
- Cidr
Blocks []string The list of CIDR blocks for the exposed AWS service. Applicable for endpoints of type
Gateway.- Dns
Entries []VpcEndpoint Dns Entry The DNS entries for the VPC Endpoint. Applicable for endpoints of type
Interface. DNS blocks are documented below.- Id string
- The provider-assigned unique ID for this managed resource.
- Network
Interface []stringIds One or more network interfaces for the VPC Endpoint. Applicable for endpoints of type
Interface.- Owner
Id string The ID of the AWS account that owns the VPC endpoint.
- Prefix
List stringId The prefix list ID of the exposed AWS service. Applicable for endpoints of type
Gateway.- Requester
Managed bool Whether or not the VPC Endpoint is being managed by its service -
trueorfalse.- State string
The state of the VPC endpoint.
- arn string
The Amazon Resource Name (ARN) of the VPC endpoint.
- cidr
Blocks string[] The list of CIDR blocks for the exposed AWS service. Applicable for endpoints of type
Gateway.- dns
Entries VpcEndpoint Dns Entry[] The DNS entries for the VPC Endpoint. Applicable for endpoints of type
Interface. DNS blocks are documented below.- id string
- The provider-assigned unique ID for this managed resource.
- network
Interface string[]Ids One or more network interfaces for the VPC Endpoint. Applicable for endpoints of type
Interface.- owner
Id string The ID of the AWS account that owns the VPC endpoint.
- prefix
List stringId The prefix list ID of the exposed AWS service. Applicable for endpoints of type
Gateway.- requester
Managed boolean Whether or not the VPC Endpoint is being managed by its service -
trueorfalse.- state string
The state of the VPC endpoint.
- arn str
The Amazon Resource Name (ARN) of the VPC endpoint.
- cidr_
blocks List[str] The list of CIDR blocks for the exposed AWS service. Applicable for endpoints of type
Gateway.- dns_
entries List[VpcEndpoint Dns Entry] The DNS entries for the VPC Endpoint. Applicable for endpoints of type
Interface. DNS blocks are documented below.- id str
- The provider-assigned unique ID for this managed resource.
- network_
interface_ List[str]ids One or more network interfaces for the VPC Endpoint. Applicable for endpoints of type
Interface.- owner_
id str The ID of the AWS account that owns the VPC endpoint.
- prefix_
list_ strid The prefix list ID of the exposed AWS service. Applicable for endpoints of type
Gateway.- requester_
managed bool Whether or not the VPC Endpoint is being managed by its service -
trueorfalse.- state str
The state of the VPC endpoint.
Look up an Existing VpcEndpoint Resource
Get an existing VpcEndpoint resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: VpcEndpointState, opts?: CustomResourceOptions): VpcEndpointstatic get(resource_name, id, opts=None, arn=None, auto_accept=None, cidr_blocks=None, dns_entries=None, network_interface_ids=None, owner_id=None, policy=None, prefix_list_id=None, private_dns_enabled=None, requester_managed=None, route_table_ids=None, security_group_ids=None, service_name=None, state=None, subnet_ids=None, tags=None, vpc_endpoint_type=None, vpc_id=None, __props__=None);func GetVpcEndpoint(ctx *Context, name string, id IDInput, state *VpcEndpointState, opts ...ResourceOption) (*VpcEndpoint, error)public static VpcEndpoint Get(string name, Input<string> id, VpcEndpointState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Arn string
The Amazon Resource Name (ARN) of the VPC endpoint.
- Auto
Accept bool Accept the VPC endpoint (the VPC endpoint and service need to be in the same AWS account).
- Cidr
Blocks List<string> The list of CIDR blocks for the exposed AWS service. Applicable for endpoints of type
Gateway.- Dns
Entries List<VpcEndpoint Dns Entry Args> The DNS entries for the VPC Endpoint. Applicable for endpoints of type
Interface. DNS blocks are documented below.- Network
Interface List<string>Ids One or more network interfaces for the VPC Endpoint. Applicable for endpoints of type
Interface.- Owner
Id string The ID of the AWS account that owns the VPC endpoint.
- Policy string
A policy to attach to the endpoint that controls access to the service. Defaults to full access. All
Gatewayand someInterfaceendpoints support policies - see the relevant AWS documentation for more details.- Prefix
List stringId The prefix list ID of the exposed AWS service. Applicable for endpoints of type
Gateway.- Private
Dns boolEnabled Whether or not to associate a private hosted zone with the specified VPC. Applicable for endpoints of type
Interface. Defaults tofalse.- Requester
Managed bool Whether or not the VPC Endpoint is being managed by its service -
trueorfalse.- Route
Table List<string>Ids One or more route table IDs. Applicable for endpoints of type
Gateway.- Security
Group List<string>Ids The ID of one or more security groups to associate with the network interface. Required for endpoints of type
Interface.- Service
Name string The service name. For AWS services the service name is usually in the form
com.amazonaws.<region>.<service>(the SageMaker Notebook service is an exception to this rule, the service name is in the formaws.sagemaker.<region>.notebook).- State string
The state of the VPC endpoint.
- Subnet
Ids List<string> The ID of one or more subnets in which to create a network interface for the endpoint. Applicable for endpoints of type
Interface.- Dictionary<string, string>
A map of tags to assign to the resource.
- Vpc
Endpoint stringType The VPC endpoint type,
GatewayorInterface. Defaults toGateway.- Vpc
Id string The ID of the VPC in which the endpoint will be used.
- Arn string
The Amazon Resource Name (ARN) of the VPC endpoint.
- Auto
Accept bool Accept the VPC endpoint (the VPC endpoint and service need to be in the same AWS account).
- Cidr
Blocks []string The list of CIDR blocks for the exposed AWS service. Applicable for endpoints of type
Gateway.- Dns
Entries []VpcEndpoint Dns Entry The DNS entries for the VPC Endpoint. Applicable for endpoints of type
Interface. DNS blocks are documented below.- Network
Interface []stringIds One or more network interfaces for the VPC Endpoint. Applicable for endpoints of type
Interface.- Owner
Id string The ID of the AWS account that owns the VPC endpoint.
- Policy string
A policy to attach to the endpoint that controls access to the service. Defaults to full access. All
Gatewayand someInterfaceendpoints support policies - see the relevant AWS documentation for more details.- Prefix
List stringId The prefix list ID of the exposed AWS service. Applicable for endpoints of type
Gateway.- Private
Dns boolEnabled Whether or not to associate a private hosted zone with the specified VPC. Applicable for endpoints of type
Interface. Defaults tofalse.- Requester
Managed bool Whether or not the VPC Endpoint is being managed by its service -
trueorfalse.- Route
Table []stringIds One or more route table IDs. Applicable for endpoints of type
Gateway.- Security
Group []stringIds The ID of one or more security groups to associate with the network interface. Required for endpoints of type
Interface.- Service
Name string The service name. For AWS services the service name is usually in the form
com.amazonaws.<region>.<service>(the SageMaker Notebook service is an exception to this rule, the service name is in the formaws.sagemaker.<region>.notebook).- State string
The state of the VPC endpoint.
- Subnet
Ids []string The ID of one or more subnets in which to create a network interface for the endpoint. Applicable for endpoints of type
Interface.- map[string]string
A map of tags to assign to the resource.
- Vpc
Endpoint stringType The VPC endpoint type,
GatewayorInterface. Defaults toGateway.- Vpc
Id string The ID of the VPC in which the endpoint will be used.
- arn string
The Amazon Resource Name (ARN) of the VPC endpoint.
- auto
Accept boolean Accept the VPC endpoint (the VPC endpoint and service need to be in the same AWS account).
- cidr
Blocks string[] The list of CIDR blocks for the exposed AWS service. Applicable for endpoints of type
Gateway.- dns
Entries VpcEndpoint Dns Entry[] The DNS entries for the VPC Endpoint. Applicable for endpoints of type
Interface. DNS blocks are documented below.- network
Interface string[]Ids One or more network interfaces for the VPC Endpoint. Applicable for endpoints of type
Interface.- owner
Id string The ID of the AWS account that owns the VPC endpoint.
- policy string
A policy to attach to the endpoint that controls access to the service. Defaults to full access. All
Gatewayand someInterfaceendpoints support policies - see the relevant AWS documentation for more details.- prefix
List stringId The prefix list ID of the exposed AWS service. Applicable for endpoints of type
Gateway.- private
Dns booleanEnabled Whether or not to associate a private hosted zone with the specified VPC. Applicable for endpoints of type
Interface. Defaults tofalse.- requester
Managed boolean Whether or not the VPC Endpoint is being managed by its service -
trueorfalse.- route
Table string[]Ids One or more route table IDs. Applicable for endpoints of type
Gateway.- security
Group string[]Ids The ID of one or more security groups to associate with the network interface. Required for endpoints of type
Interface.- service
Name string The service name. For AWS services the service name is usually in the form
com.amazonaws.<region>.<service>(the SageMaker Notebook service is an exception to this rule, the service name is in the formaws.sagemaker.<region>.notebook).- state string
The state of the VPC endpoint.
- subnet
Ids string[] The ID of one or more subnets in which to create a network interface for the endpoint. Applicable for endpoints of type
Interface.- {[key: string]: string}
A map of tags to assign to the resource.
- vpc
Endpoint stringType The VPC endpoint type,
GatewayorInterface. Defaults toGateway.- vpc
Id string The ID of the VPC in which the endpoint will be used.
- arn str
The Amazon Resource Name (ARN) of the VPC endpoint.
- auto_
accept bool Accept the VPC endpoint (the VPC endpoint and service need to be in the same AWS account).
- cidr_
blocks List[str] The list of CIDR blocks for the exposed AWS service. Applicable for endpoints of type
Gateway.- dns_
entries List[VpcEndpoint Dns Entry] The DNS entries for the VPC Endpoint. Applicable for endpoints of type
Interface. DNS blocks are documented below.- network_
interface_ List[str]ids One or more network interfaces for the VPC Endpoint. Applicable for endpoints of type
Interface.- owner_
id str The ID of the AWS account that owns the VPC endpoint.
- policy str
A policy to attach to the endpoint that controls access to the service. Defaults to full access. All
Gatewayand someInterfaceendpoints support policies - see the relevant AWS documentation for more details.- prefix_
list_ strid The prefix list ID of the exposed AWS service. Applicable for endpoints of type
Gateway.- private_
dns_ boolenabled Whether or not to associate a private hosted zone with the specified VPC. Applicable for endpoints of type
Interface. Defaults tofalse.- requester_
managed bool Whether or not the VPC Endpoint is being managed by its service -
trueorfalse.- route_
table_ List[str]ids One or more route table IDs. Applicable for endpoints of type
Gateway.- security_
group_ List[str]ids The ID of one or more security groups to associate with the network interface. Required for endpoints of type
Interface.- service_
name str The service name. For AWS services the service name is usually in the form
com.amazonaws.<region>.<service>(the SageMaker Notebook service is an exception to this rule, the service name is in the formaws.sagemaker.<region>.notebook).- state str
The state of the VPC endpoint.
- subnet_
ids List[str] The ID of one or more subnets in which to create a network interface for the endpoint. Applicable for endpoints of type
Interface.- Dict[str, str]
A map of tags to assign to the resource.
- vpc_
endpoint_ strtype The VPC endpoint type,
GatewayorInterface. Defaults toGateway.- vpc_
id str The ID of the VPC in which the endpoint will be used.
Supporting Types
VpcEndpointDnsEntry
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
- Dns
Name string The DNS name.
- Hosted
Zone stringId The ID of the private hosted zone.
- Dns
Name string The DNS name.
- Hosted
Zone stringId The ID of the private hosted zone.
- dns
Name string The DNS name.
- hosted
Zone stringId The ID of the private hosted zone.
- dns_
name str The DNS name.
- hosted_
zone_ strid The ID of the private hosted zone.
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.