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.

Attributes

NameTypeRequiredDescription
creation_timestampString(read-only)
dns_entriesList(read-only)
dns_optionsStringNoDescribes the DNS options for an endpoint.
idString(read-only)
ip_address_typeEnum (IpAddressType)NoThe supported IP address types.
network_interface_idsList(read-only)
policy_documentStringNoAn 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_enabledBoolNoIndicate 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_arnStringNoThe Amazon Resource Name (ARN) of the resource configuration.
route_table_idsListNoThe IDs of the route tables. Routing is supported only for gateway endpoints.
security_group_idsListNoThe 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_nameStringNoThe name of the endpoint service.
service_network_arnStringNoThe Amazon Resource Name (ARN) of the service network.
service_regionStringNoDescribes a Region.
subnet_idsListNoThe 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.
tagsMapNoThe tags to associate with the endpoint.
vpc_endpoint_typeEnum (VpcEndpointType)NoThe type of endpoint. Default: Gateway
vpc_idStringYesThe ID of the VPC.

Enum Values

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

Example

let vpc = awscc.ec2_vpc {
  name                 = "example-vpc"
  cidr_block           = "10.0.0.0/16"
  enable_dns_support   = true
  enable_dns_hostnames = true
}

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

let sg = awscc.ec2_security_group {
  name              = "example-endpoint-sg"
  vpc_id            = vpc.vpc_id
  group_description = "SG for VPC Endpoint"
}

awscc.ec2_security_group_ingress {
  name        = "example-endpoint-https"
  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 {
  name                = "example-ecr-dkr"
  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
}