Use DescribeVpcEndpointServices
with a CLI
The following code examples show how to use DescribeVpcEndpointServices
.
- CLI
-
- Amazon CLI
-
Example 1: To describe all VPC endpoint services
The following "describe-vpc-endpoint-services" example lists all VPC endpoint services for an Amazon Region.
aws ec2 describe-vpc-endpoint-services
Output:
{ "ServiceDetails": [ { "ServiceType": [ { "ServiceType": "Gateway" } ], "AcceptanceRequired": false, "ServiceName": "com.amazonaws.us-east-1.dynamodb", "VpcEndpointPolicySupported": true, "Owner": "amazon", "AvailabilityZones": [ "us-east-1a", "us-east-1b", "us-east-1c", "us-east-1d", "us-east-1e", "us-east-1f" ], "BaseEndpointDnsNames": [ "dynamodb.us-east-1.amazonaws.com" ] }, { "ServiceType": [ { "ServiceType": "Interface" } ], "PrivateDnsName": "ec2.us-east-1.amazonaws.com", "ServiceName": "com.amazonaws.us-east-1.ec2", "VpcEndpointPolicySupported": false, "Owner": "amazon", "AvailabilityZones": [ "us-east-1a", "us-east-1b", "us-east-1c", "us-east-1d", "us-east-1e", "us-east-1f" ], "AcceptanceRequired": false, "BaseEndpointDnsNames": [ "ec2.us-east-1.vpce.amazonaws.com" ] }, { "ServiceType": [ { "ServiceType": "Interface" } ], "PrivateDnsName": "ssm.us-east-1.amazonaws.com", "ServiceName": "com.amazonaws.us-east-1.ssm", "VpcEndpointPolicySupported": true, "Owner": "amazon", "AvailabilityZones": [ "us-east-1a", "us-east-1b", "us-east-1c", "us-east-1d", "us-east-1e" ], "AcceptanceRequired": false, "BaseEndpointDnsNames": [ "ssm.us-east-1.vpce.amazonaws.com" ] } ], "ServiceNames": [ "com.amazonaws.us-east-1.dynamodb", "com.amazonaws.us-east-1.ec2", "com.amazonaws.us-east-1.ec2messages", "com.amazonaws.us-east-1.elasticloadbalancing", "com.amazonaws.us-east-1.kinesis-streams", "com.amazonaws.us-east-1.s3", "com.amazonaws.us-east-1.ssm" ] }
For more information, see View available Amazon service names
in the User Guide for AmazonPrivateLink. Example 2: To describe the details about an endpoint service
The following "describe-vpc-endpoint-services" example lists the details of the Amazon S3 interface endpoint srvice
aws ec2 describe-vpc-endpoint-services \ --filter
"Name=service-type,Values=Interface"
Name=service-name,Values=com.amazonaws.us-east-1.s3
Output:
{ "ServiceDetails": [ { "ServiceName": "com.amazonaws.us-east-1.s3", "ServiceId": "vpce-svc-081d84efcdEXAMPLE", "ServiceType": [ { "ServiceType": "Interface" } ], "AvailabilityZones": [ "us-east-1a", "us-east-1b", "us-east-1c", "us-east-1d", "us-east-1e", "us-east-1f" ], "Owner": "amazon", "BaseEndpointDnsNames": [ "s3.us-east-1.vpce.amazonaws.com" ], "VpcEndpointPolicySupported": true, "AcceptanceRequired": false, "ManagesVpcEndpoints": false, "Tags": [] } ], "ServiceNames": [ "com.amazonaws.us-east-1.s3" ] }
For more information, see View available Amazon service names
in the User Guide for AmazonPrivateLink. -
For API details, see DescribeVpcEndpointServices
in Amazon CLI Command Reference.
-
- PowerShell
-
- Tools for PowerShell
-
Example 1: This example describes EC2 VPC endpoint service with the given filter, in this case com.amazonaws.eu-west-1.ecs. Further, it also expands the ServiceDetails property and displays the details
Get-EC2VpcEndpointService -Region eu-west-1 -MaxResult 5 -Filter @{Name="service-name";Values="com.amazonaws.eu-west-1.ecs"} | Select-Object -ExpandProperty ServiceDetails
Output:
AcceptanceRequired : False AvailabilityZones : {eu-west-1a, eu-west-1b, eu-west-1c} BaseEndpointDnsNames : {ecs.eu-west-1.vpce.amazonaws.com} Owner : amazon PrivateDnsName : ecs.eu-west-1.amazonaws.com ServiceName : com.amazonaws.eu-west-1.ecs ServiceType : {Amazon.EC2.Model.ServiceTypeDetail} VpcEndpointPolicySupported : False
Example 2: This example retrieves all the EC2 VPC Endpoint services and returns the ServiceNames matching "ssm"
Get-EC2VpcEndpointService -Region eu-west-1 | Select-Object -ExpandProperty Servicenames | Where-Object { -match "ssm"}
Output:
com.amazonaws.eu-west-1.ssm com.amazonaws.eu-west-1.ssmmessages
-
For API details, see DescribeVpcEndpointServices
in Amazon Tools for PowerShell Cmdlet Reference.
-
For a complete list of Amazon SDK developer guides and code examples, see Create Amazon EC2 resources using an Amazon SDK. This topic also includes information about getting started and details about previous SDK versions.