Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.
Gunakan DescribeVpcEndpointServices
dengan CLI
Contoh kode berikut menunjukkan cara menggunakanDescribeVpcEndpointServices
.
- CLI
-
- AWS CLI
-
Contoh 1: Untuk mendeskripsikan semua VPC layanan endpoint
Contoh "describe-vpc-endpoint-services" berikut mencantumkan semua layanan VPC endpoint untuk suatu AWS Wilayah.
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" ] }
Untuk informasi selengkapnya, lihat Melihat nama AWS layanan yang tersedia di Panduan Pengguna untuk AWS PrivateLink.
Contoh 2: Untuk menjelaskan detail tentang layanan endpoint
Contoh "describe-vpc-endpoint-services" berikut mencantumkan rincian srvice endpoint antarmuka Amazon S3
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" ] }
Untuk informasi selengkapnya, lihat Melihat nama AWS layanan yang tersedia di Panduan Pengguna untuk AWS PrivateLink.
-
Untuk API detailnya, lihat DescribeVpcEndpointServices
di Referensi AWS CLI Perintah.
-
- PowerShell
-
- Alat untuk PowerShell
-
Contoh 1: Contoh ini menjelaskan layanan EC2 VPC endpoint dengan filter yang diberikan, dalam hal ini com.amazonaws.eu-west-1.ecs. Selanjutnya, itu juga memperluas ServiceDetails properti dan menampilkan detailnya
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
Contoh 2: Contoh ini mengambil semua layanan EC2 VPC Endpoint dan mengembalikan “ssm” yang ServiceNames cocok
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
-
Untuk API detailnya, lihat DescribeVpcEndpointServicesdi AWS Tools for PowerShell Referensi Cmdlet.
-
Untuk daftar lengkap panduan AWS SDK pengembang dan contoh kode, lihatMembuat EC2 sumber daya Amazon menggunakan AWS SDK. Topik ini juga mencakup informasi tentang memulai dan detail tentang SDK versi sebelumnya.