Carina

Resource

awscc.ec2.VpcEndpoint

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.SecurityGroup {
  vpc_id            = vpc.vpc_id
  group_description = 'SG for VPC Endpoint'
}

awscc.ec2.SecurityGroupIngress {
  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.VpcEndpoint {
  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

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

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

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

route_table_ids

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

security_group_ids

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

The name of the endpoint service.

service_network_arn

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

service_region

Describes a Region.

subnet_ids

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

The tags to associate with the endpoint.

vpc_endpoint_type

The type of endpoint. Default: Gateway

vpc_id

The ID of the VPC.

Enum Values

dns_options.dns_record_ip_type (DnsRecordIpType)

Value DSL Identifier
ipv4 aws.ec2.VpcEndpoint.DnsOptionsSpecification.DnsRecordIpType.ipv4
ipv6 aws.ec2.VpcEndpoint.DnsOptionsSpecification.DnsRecordIpType.ipv6
dualstack aws.ec2.VpcEndpoint.DnsOptionsSpecification.DnsRecordIpType.dualstack
service-defined aws.ec2.VpcEndpoint.DnsOptionsSpecification.DnsRecordIpType.service_defined
not-specified aws.ec2.VpcEndpoint.DnsOptionsSpecification.DnsRecordIpType.not_specified

Shorthand formats: ipv4 or DnsRecordIpType.ipv4

dns_options.private_dns_only_for_inbound_resolver_endpoint (PrivateDnsOnlyForInboundResolverEndpoint)

Value DSL Identifier
OnlyInboundResolver aws.ec2.VpcEndpoint.DnsOptionsSpecification.PrivateDnsOnlyForInboundResolverEndpoint.only_inbound_resolver
AllResolvers aws.ec2.VpcEndpoint.DnsOptionsSpecification.PrivateDnsOnlyForInboundResolverEndpoint.all_resolvers
NotSpecified aws.ec2.VpcEndpoint.DnsOptionsSpecification.PrivateDnsOnlyForInboundResolverEndpoint.not_specified

Shorthand formats: only_inbound_resolver or PrivateDnsOnlyForInboundResolverEndpoint.only_inbound_resolver

dns_options.private_dns_preference (PrivateDnsPreference)

Value DSL Identifier
VERIFIED_DOMAINS_ONLY aws.ec2.VpcEndpoint.DnsOptionsSpecification.PrivateDnsPreference.verified_domains_only
ALL_DOMAINS aws.ec2.VpcEndpoint.DnsOptionsSpecification.PrivateDnsPreference.all_domains
VERIFIED_DOMAINS_AND_SPECIFIED_DOMAINS aws.ec2.VpcEndpoint.DnsOptionsSpecification.PrivateDnsPreference.verified_domains_and_specified_domains
SPECIFIED_DOMAINS_ONLY aws.ec2.VpcEndpoint.DnsOptionsSpecification.PrivateDnsPreference.specified_domains_only

Shorthand formats: verified_domains_only or PrivateDnsPreference.verified_domains_only

ip_address_type (IpAddressType)

Value DSL Identifier
ipv4 aws.ec2.VpcEndpoint.IpAddressType.ipv4
ipv6 aws.ec2.VpcEndpoint.IpAddressType.ipv6
dualstack aws.ec2.VpcEndpoint.IpAddressType.dualstack
not-specified aws.ec2.VpcEndpoint.IpAddressType.not_specified

Shorthand formats: ipv4 or IpAddressType.ipv4

vpc_endpoint_type (VpcEndpointType)

Value DSL Identifier
Interface aws.ec2.VpcEndpoint.VpcEndpointType.interface
Gateway aws.ec2.VpcEndpoint.VpcEndpointType.gateway
GatewayLoadBalancer aws.ec2.VpcEndpoint.VpcEndpointType.gateway_load_balancer
ServiceNetwork aws.ec2.VpcEndpoint.VpcEndpointType.service_network
Resource aws.ec2.VpcEndpoint.VpcEndpointType.resource

Shorthand formats: interface or VpcEndpointType.interface

Struct Definitions

dns_options

Field Type Required Description
dns_record_ip_type Enum (DnsRecordIpType) No The DNS records created for the endpoint.
private_dns_only_for_inbound_resolver_endpoint Enum (PrivateDnsOnlyForInboundResolverEndpoint) No Indicates 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_preference Enum (PrivateDnsPreference) No The 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_domains List<String(len: 1..=255)> (items: 1..=10) No Indicates 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

dns_entries

id

network_interface_ids

AWS API narrowings

These fields are narrower than or equal to CFN. Input rules combine documented AWS domains, recorded live observations, and Carina canonical spellings for stable state comparison. A canonical DSL spelling does not claim AWS rejects other spellings. Attaching a type name adds no structural constraints. Field names below use CFN spelling.

CFN field Relation to CFN Evidence URL Verbatim quote / exact observation Checked / observed
/definitions/Tag/properties/Key Subset: CFN ∩ reviewed input domain Source record Maximum key length – 128 Unicode characters in UTF-8 2026-11-07
/definitions/Tag/properties/Value Subset: CFN ∩ reviewed input domain Source record The value of the tag.Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters. 2026-11-07
/properties/PolicyDocument Subset: CFN ∩ reviewed input domain Source record <version_block> = "Version" : ("2008-10-17" | "2012-10-17")<effect_block> = "Effect" : ("Allow" | "Deny") 2026-11-07
/properties/PolicyDocument Subset: CFN ∩ reviewed input domain Source record The Statement element can contain a single statement or an array of individual statements. 2026-11-07
/properties/PolicyDocument Subset: CFN ∩ reviewed input domain Source record You can create conditions that compare strings, dates, numbers, and more using typical Boolean comparisons such as equals, greater than, and less than. 2026-11-07