vpc_endpoints
Creates, updates, deletes or gets a vpc_endpoint resource or lists vpc_endpoints in a region
Overview
| Name | vpc_endpoints |
| Type | Resource |
| Description | 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](https://docs.aws.amazon.com/vpc/latest/privatelink/). 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?](https://docs.aws.amazon.com/premiumsupport/knowledge-center/connect-s3-vpc-endpoint) An endpoint of type ``GatewayLoadBalancer`` provides private connectivity between your VPC and virtual appliances from a service provider. |
| Id | awscc.ec2.vpc_endpoints |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
private_dns_enabled | boolean | 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.<br />To use a private hosted zone, you must set the following VPC attributes to ``true``: ``enableDnsHostnames`` and ``enableDnsSupport``.<br />This property is supported only for interface endpoints.<br />Default: ``false`` |
ip_address_type | string | The supported IP address types. |
service_region | string | Describes a Region. |
creation_timestamp | string | |
dns_options | object | Describes the DNS options for an endpoint. |
network_interface_ids | array | |
dns_entries | array | |
resource_configuration_arn | string | The Amazon Resource Name (ARN) of the resource configuration. |
security_group_ids | array | 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. |
subnet_ids | array | 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. |
service_network_arn | string | The Amazon Resource Name (ARN) of the service network. |
vpc_id | string | The ID of the VPC. |
route_table_ids | array | The IDs of the route tables. Routing is supported only for gateway endpoints. |
service_name | string | The name of the endpoint service. |
policy_document | object | 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.<br />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:<br />``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":"*" }] }'`` |
vpc_endpoint_type | string | The type of endpoint.<br />Default: Gateway |
id | string | |
tags | array | The tags to associate with the endpoint. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
id | string | |
region | string | AWS region. |
For more information, see AWS::EC2::VPCEndpoint.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | vpc_endpoints | INSERT | VpcId, region |
delete_resource | vpc_endpoints | DELETE | Identifier, region |
update_resource | vpc_endpoints | UPDATE | Identifier, PatchDocument, region |
list_resources | vpc_endpoints_list_only | SELECT | region |
get_resource | vpc_endpoints | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual vpc_endpoint.
SELECT
region,
private_dns_enabled,
ip_address_type,
service_region,
creation_timestamp,
dns_options,
network_interface_ids,
dns_entries,
resource_configuration_arn,
security_group_ids,
subnet_ids,
service_network_arn,
vpc_id,
route_table_ids,
service_name,
policy_document,
vpc_endpoint_type,
id,
tags
FROM awscc.ec2.vpc_endpoints
WHERE
region = 'us-east-1' AND
Identifier = '{{ id }}';
Lists all vpc_endpoints in a region.
SELECT
region,
id
FROM awscc.ec2.vpc_endpoints_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new vpc_endpoint resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.ec2.vpc_endpoints (
VpcId,
region
)
SELECT
'{{ vpc_id }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.ec2.vpc_endpoints (
PrivateDnsEnabled,
IpAddressType,
ServiceRegion,
DnsOptions,
ResourceConfigurationArn,
SecurityGroupIds,
SubnetIds,
ServiceNetworkArn,
VpcId,
RouteTableIds,
ServiceName,
PolicyDocument,
VpcEndpointType,
Tags,
region
)
SELECT
'{{ private_dns_enabled }}',
'{{ ip_address_type }}',
'{{ service_region }}',
'{{ dns_options }}',
'{{ resource_configuration_arn }}',
'{{ security_group_ids }}',
'{{ subnet_ids }}',
'{{ service_network_arn }}',
'{{ vpc_id }}',
'{{ route_table_ids }}',
'{{ service_name }}',
'{{ policy_document }}',
'{{ vpc_endpoint_type }}',
'{{ tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: vpc_endpoint
props:
- name: private_dns_enabled
value: '{{ private_dns_enabled }}'
- name: ip_address_type
value: '{{ ip_address_type }}'
- name: service_region
value: '{{ service_region }}'
- name: dns_options
value:
private_dns_only_for_inbound_resolver_endpoint: '{{ private_dns_only_for_inbound_resolver_endpoint }}'
dns_record_ip_type: '{{ dns_record_ip_type }}'
- name: resource_configuration_arn
value: '{{ resource_configuration_arn }}'
- name: security_group_ids
value:
- '{{ security_group_ids[0] }}'
- name: subnet_ids
value:
- '{{ subnet_ids[0] }}'
- name: service_network_arn
value: '{{ service_network_arn }}'
- name: vpc_id
value: '{{ vpc_id }}'
- name: route_table_ids
value:
- '{{ route_table_ids[0] }}'
- name: service_name
value: '{{ service_name }}'
- name: policy_document
value: {}
- name: vpc_endpoint_type
value: '{{ vpc_endpoint_type }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a vpc_endpoint resource, using stack-deploy.
/*+ update */
UPDATE awscc.ec2.vpc_endpoints
SET PatchDocument = string('{{ {
"PrivateDnsEnabled": private_dns_enabled,
"IpAddressType": ip_address_type,
"DnsOptions": dns_options,
"SecurityGroupIds": security_group_ids,
"SubnetIds": subnet_ids,
"RouteTableIds": route_table_ids,
"PolicyDocument": policy_document,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}';
DELETE example
/*+ delete */
DELETE FROM awscc.ec2.vpc_endpoints
WHERE
Identifier = '{{ id }}' AND
region = 'us-east-1';
Permissions
To operate on the vpc_endpoints resource, the following permissions are required:
- Read
- Create
- Update
- List
- Delete
ec2:DescribeVpcEndpoints,
ec2:DescribeSubnets,
ec2:DescribeSecurityGroups,
vpc-lattice:DescribeServiceNetworkVpcEndpointAssociation,
ec2:DescribeVpcs
ec2:CreateVpcEndpoint,
ec2:DescribeVpcEndpoints,
ec2:DescribeSubnets,
ec2:DescribeSecurityGroups,
vpc-lattice:CreateServiceNetworkVpcEndpointAssociation,
vpc-lattice:DescribeServiceNetworkVpcEndpointAssociation,
ec2:CreateTags,
ec2:DeleteTags,
vpce:AllowMultiRegion,
ec2:DescribeVpcs
ec2:ModifyVpcEndpoint,
ec2:DescribeVpcEndpoints,
ec2:DescribeSubnets,
ec2:DescribeSecurityGroups,
vpc-lattice:CreateServiceNetworkVpcEndpointAssociation,
vpc-lattice:DescribeServiceNetworkVpcEndpointAssociation,
ec2:CreateTags,
ec2:DeleteTags,
vpce:AllowMultiRegion,
ec2:DescribeVpcs
ec2:DescribeVpcEndpoints,
ec2:DescribeSubnets,
ec2:DescribeSecurityGroups,
vpc-lattice:DescribeServiceNetworkVpcEndpointAssociation,
ec2:DescribeVpcs
ec2:DeleteVpcEndpoints,
ec2:DescribeVpcEndpoints,
ec2:DescribeSubnets,
ec2:DescribeSecurityGroups,
vpc-lattice:DescribeServiceNetworkVpcEndpointAssociation,
ec2:CreateTags,
ec2:DeleteTags,
vpce:AllowMultiRegion,
ec2:DescribeVpcs