Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

awscc.ec2.vpc_endpoint

CloudFormation Type: AWS::EC2::VPCEndpoint

Specifies a VPC endpoint. A VPC endpoint provides a private connection between your VPC and an endpoint service. You can use an endpoint service provided by AWS, an MKT Partner, or another AWS accounts in your organization. For more information, see the User Guide. An endpoint of type Interface establishes connections between the subnets in your VPC and an AWS-service, your own service, or a service hosted by another AWS-account. With an interface VPC endpoint, you specify the subnets in which to create the endpoint and the security groups to associate with the endpoint network interfaces. An endpoint of type gateway serves as a target for a route in your route table for traffic destined for S3 or DDB. You can specify an endpoint policy for the endpoint, which controls access to the service from your VPC. You can also specify the VPC route tables that use the endpoint. For more information about connectivity to S3, see Why can’t I connect to an S3 bucket using a gateway VPC endpoint? An endpoint of type GatewayLoadBalancer provides private connectivity between your VPC and virtual appliances from a service provider.

Example

let vpc = awscc.ec2.vpc {
  cidr_block           = "10.0.0.0/16"
  enable_dns_support   = true
  enable_dns_hostnames = true
}

let subnet = awscc.ec2.subnet {
  vpc_id            = vpc.vpc_id
  cidr_block        = "10.0.100.0/24"
  availability_zone = "ap-northeast-1a"
}

let sg = awscc.ec2.security_group {
  vpc_id            = vpc.vpc_id
  group_description = "SG for VPC Endpoint"
}

awscc.ec2.security_group_ingress {
  group_id    = sg.group_id
  description = "Allow HTTPS from VPC"
  ip_protocol = "tcp"
  from_port   = 443
  to_port     = 443
  cidr_ip     = "10.0.0.0/16"
}

awscc.ec2.vpc_endpoint {
  vpc_id              = vpc.vpc_id
  service_name        = "com.amazonaws.ap-northeast-1.ecr.dkr"
  vpc_endpoint_type   = "Interface"
  subnet_ids          = [subnet.subnet_id]
  security_group_ids  = [sg.group_id]
  private_dns_enabled = true
}

Argument Reference

dns_options

Describes the DNS options for an endpoint.

ip_address_type

The supported IP address types.

policy_document

  • Type: IamPolicyDocument
  • Required: No

An endpoint policy, which controls access to the service from the VPC. The default endpoint policy allows full access to the service. Endpoint policies are supported only for gateway and interface endpoints. For CloudFormation templates in YAML, you can provide the policy in JSON or YAML format. For example, if you have a JSON policy, you can convert it to YAML before including it in the YAML template, and CFNlong converts the policy to JSON format before calling the API actions for privatelink. Alternatively, you can include the JSON directly in the YAML, as shown in the following Properties section: Properties: VpcEndpointType: 'Interface' ServiceName: !Sub 'com.amazonaws.${AWS::Region}.logs' PolicyDocument: '{ "Version":"2012-10-17", "Statement": [{ "Effect":"Allow", "Principal":"*", "Action":["logs:Describe*","logs:Get*","logs:List*","logs:FilterLogEvents"], "Resource":"*" }] }'

private_dns_enabled

  • Type: Bool
  • Required: No

Indicate whether to associate a private hosted zone with the specified VPC. The private hosted zone contains a record set for the default public DNS name for the service for the Region (for example, kinesis.us-east-1.amazonaws.com), which resolves to the private IP addresses of the endpoint network interfaces in the VPC. This enables you to make requests to the default public DNS name for the service instead of the public DNS names that are automatically generated by the VPC endpoint service. To use a private hosted zone, you must set the following VPC attributes to true: enableDnsHostnames and enableDnsSupport. This property is supported only for interface endpoints. Default: false

resource_configuration_arn

  • Type: Arn
  • Required: No

The Amazon Resource Name (ARN) of the resource configuration.

route_table_ids

  • Type: List<RouteTableId>
  • Required: No

The IDs of the route tables. Routing is supported only for gateway endpoints.

security_group_ids

  • Type: List<SecurityGroupId>
  • Required: No

The IDs of the security groups to associate with the endpoint network interfaces. If this parameter is not specified, we use the default security group for the VPC. Security groups are supported only for interface endpoints.

service_name

  • Type: String
  • Required: No

The name of the endpoint service.

service_network_arn

  • Type: Arn
  • Required: No

The Amazon Resource Name (ARN) of the service network.

service_region

  • Type: Region
  • Required: No

Describes a Region.

subnet_ids

  • Type: List<SubnetId>
  • Required: No

The IDs of the subnets in which to create endpoint network interfaces. You must specify this property for an interface endpoint or a Gateway Load Balancer endpoint. You can’t specify this property for a gateway endpoint. For a Gateway Load Balancer endpoint, you can specify only one subnet.

tags

  • Type: Map
  • Required: No

The tags to associate with the endpoint.

vpc_endpoint_type

The type of endpoint. Default: Gateway

vpc_id

  • Type: VpcId
  • Required: Yes

The ID of the VPC.

Enum Values

dns_record_ip_type (DnsRecordIpType)

ValueDSL Identifier
ipv4awscc.ec2.vpc_endpoint.DnsRecordIpType.ipv4
ipv6awscc.ec2.vpc_endpoint.DnsRecordIpType.ipv6
dualstackawscc.ec2.vpc_endpoint.DnsRecordIpType.dualstack
service-definedawscc.ec2.vpc_endpoint.DnsRecordIpType.service_defined
not-specifiedawscc.ec2.vpc_endpoint.DnsRecordIpType.not_specified

Shorthand formats: ipv4 or DnsRecordIpType.ipv4

private_dns_only_for_inbound_resolver_endpoint (PrivateDnsOnlyForInboundResolverEndpoint)

ValueDSL Identifier
OnlyInboundResolverawscc.ec2.vpc_endpoint.PrivateDnsOnlyForInboundResolverEndpoint.OnlyInboundResolver
AllResolversawscc.ec2.vpc_endpoint.PrivateDnsOnlyForInboundResolverEndpoint.AllResolvers
NotSpecifiedawscc.ec2.vpc_endpoint.PrivateDnsOnlyForInboundResolverEndpoint.NotSpecified

Shorthand formats: OnlyInboundResolver or PrivateDnsOnlyForInboundResolverEndpoint.OnlyInboundResolver

private_dns_preference (PrivateDnsPreference)

ValueDSL Identifier
VERIFIED_DOMAINS_ONLYawscc.ec2.vpc_endpoint.PrivateDnsPreference.VERIFIED_DOMAINS_ONLY
ALL_DOMAINSawscc.ec2.vpc_endpoint.PrivateDnsPreference.ALL_DOMAINS
VERIFIED_DOMAINS_AND_SPECIFIED_DOMAINSawscc.ec2.vpc_endpoint.PrivateDnsPreference.VERIFIED_DOMAINS_AND_SPECIFIED_DOMAINS
SPECIFIED_DOMAINS_ONLYawscc.ec2.vpc_endpoint.PrivateDnsPreference.SPECIFIED_DOMAINS_ONLY

Shorthand formats: VERIFIED_DOMAINS_ONLY or PrivateDnsPreference.VERIFIED_DOMAINS_ONLY

ip_address_type (IpAddressType)

ValueDSL Identifier
ipv4awscc.ec2.vpc_endpoint.IpAddressType.ipv4
ipv6awscc.ec2.vpc_endpoint.IpAddressType.ipv6
dualstackawscc.ec2.vpc_endpoint.IpAddressType.dualstack
not-specifiedawscc.ec2.vpc_endpoint.IpAddressType.not_specified

Shorthand formats: ipv4 or IpAddressType.ipv4

vpc_endpoint_type (VpcEndpointType)

ValueDSL Identifier
Interfaceawscc.ec2.vpc_endpoint.VpcEndpointType.Interface
Gatewayawscc.ec2.vpc_endpoint.VpcEndpointType.Gateway
GatewayLoadBalancerawscc.ec2.vpc_endpoint.VpcEndpointType.GatewayLoadBalancer
ServiceNetworkawscc.ec2.vpc_endpoint.VpcEndpointType.ServiceNetwork
Resourceawscc.ec2.vpc_endpoint.VpcEndpointType.Resource

Shorthand formats: Interface or VpcEndpointType.Interface

Struct Definitions

DnsOptionsSpecification

FieldTypeRequiredDescription
dns_record_ip_typeEnum (DnsRecordIpType)NoThe DNS records created for the endpoint.
private_dns_only_for_inbound_resolver_endpointEnum (PrivateDnsOnlyForInboundResolverEndpoint)NoIndicates whether to enable private DNS only for inbound endpoints. This option is available only for services that support both gateway and interface endpoints. It routes traffic that originates from the VPC to the gateway endpoint and traffic that originates from on-premises to the interface endpoint.
private_dns_preferenceEnum (PrivateDnsPreference)NoThe preference for which private domains have a private hosted zone created for and associated with the specified VPC. Only supported when private DNS is enabled and when the VPC endpoint type is ServiceNetwork or Resource.
private_dns_specified_domainsList<String> (items: 1..=10)NoIndicates which of the private domains to create private hosted zones for and associate with the specified VPC. Only supported when private DNS is enabled and the private DNS preference is VERIFIED_DOMAINS_AND_SPECIFIED_DOMAINS or SPECIFIED_DOMAINS_ONLY.

Attribute Reference

creation_timestamp

  • Type: String

dns_entries

  • Type: List<String>

id

  • Type: VpcEndpointId

network_interface_ids

  • Type: List<NetworkInterfaceId>