Ci sono altri AWS SDK esempi disponibili nel repository AWS Doc SDK Examples
Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.
Utilizzare DescribeVpcEndpointServices
con un CLI
I seguenti esempi di codice mostrano come utilizzareDescribeVpcEndpointServices
.
- CLI
-
- AWS CLI
-
Esempio 1: Per descrivere tutti i VPC servizi endpoint
Il seguente esempio "describe-vpc-endpoint-services" elenca tutti i servizi VPC endpoint per una AWS regione.
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" ] }
Per ulteriori informazioni, consulta Visualizza i nomi dei AWS servizi disponibili nella Guida per AWS PrivateLink l'utente di.
Esempio 2: Per descrivere i dettagli su un servizio endpoint
Il seguente esempio "describe-vpc-endpoint-services" elenca i dettagli del servizio endpoint dell'interfaccia 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" ] }
Per ulteriori informazioni, consulta Visualizza i nomi di AWS servizio disponibili nella Guida per l'utente per. AWS PrivateLink
-
Per API i dettagli, vedere DescribeVpcEndpointServices
in AWS CLI Command Reference.
-
- PowerShell
-
- Strumenti per PowerShell
-
Esempio 1: questo esempio descrive il servizio EC2 VPC endpoint con il filtro specificato, in questo caso com.amazonaws.eu-west-1.ecs. Inoltre, espande la proprietà e visualizza i dettagli ServiceDetails
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
Esempio 2: Questo esempio recupera tutti i servizi EC2 VPC Endpoint e restituisce il «ssm» ServiceNames corrispondente
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
-
Per API i dettagli, vedere DescribeVpcEndpointServicesin AWS Tools for PowerShell Cmdlet Reference.
-