

Sono disponibili altri esempi AWS SDK nel repository [AWS Doc SDK](https://github.com/awsdocs/aws-doc-sdk-examples) Examples. GitHub 

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à.

# Esempi di VPC Lattice utilizzando AWS CLI
<a name="cli_2_vpc-lattice_code_examples"></a>

I seguenti esempi di codice mostrano come eseguire azioni e implementare scenari comuni utilizzando AWS Command Line Interface with VPC Lattice.

Le *azioni* sono estratti di codice da programmi più grandi e devono essere eseguite nel contesto. Sebbene le azioni mostrino come richiamare le singole funzioni del servizio, è possibile visualizzarle contestualizzate negli scenari correlati.

Ogni esempio include un link al codice sorgente completo, in cui vengono fornite le istruzioni su come configurare ed eseguire il codice nel contesto.

**Topics**
+ [Azioni](#actions)

## Azioni
<a name="actions"></a>

### `create-listener`
<a name="vpc-lattice_CreateListener_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare. `create-listener`

**AWS CLI**  
**Come creare un listener**  
L’esempio `create-listener` seguente crea un listener HTTPS con una regola predefinita che inoltra il traffico al gruppo di destinazione VPC Lattice specificato.  

```
aws vpc-lattice create-listener \
    --name my-service-listener \
    --protocol HTTPS \
    --port 443 \
    --service-identifier svc-0285b53b2eEXAMPLE \
    --default-action file://listener-config.json
```
Contenuto di `listener-config.json`:  

```
{
    "forward": {
        "targetGroups": [
            {
                "targetGroupIdentifier": "tg-0eaa4b9ab4EXAMPLE"
            }
        ]
    }
}
```
Output:  

```
{
    "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:service/svc-0285b53b2eEXAMPLE/listener/listener-07cc7fb0abEXAMPLE",
    "defaultAction": {
        "forward": {
            "targetGroups": [
                {
                    "targetGroupIdentifier": "tg-0eaa4b9ab4EXAMPLE",
                    "weight": 100
                }
            ]
        }
    },
    "id": "listener-07cc7fb0abEXAMPLE",
    "name": "my-service-listener",
    "port": 443,
    "protocol": "HTTPS",
    "serviceArn": "arn:aws:vpc-lattice:us-east-2:123456789012:service/svc-0285b53b2eEXAMPLE",
    "serviceId": "svc-0285b53b2eEXAMPLE"
}
```
Per ulteriori informazioni, consulta [Listener](https://docs.aws.amazon.com/vpc-lattice/latest/ug/listeners.html) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [CreateListener AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/create-listener.html)*Command Reference*. 

### `create-resource-configuration`
<a name="vpc-lattice_CreateResourceConfiguration_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`create-resource-configuration`.

**AWS CLI**  
**Come creare una configurazione delle risorse**  
L'`create-resource-configuration`esempio seguente crea una configurazione delle risorse che specifica un singolo IPv4 indirizzo.  

```
aws vpc-lattice create-resource-configuration \
    --name my-resource-config \
    --type SINGLE \
    --resource-gateway-identifier rgw-0bba03f3d56060135 \
    --resource-configuration-definition 'ipResource={ipAddress=10.0.14.85}'
```
Output:  

```
{
    "allowAssociationToShareableServiceNetwork": true,
    "arn": "arn:aws:vpc-lattice:us-east-1:123456789012:resourceconfiguration/rcfg-07129f3acded87625",
    "id": "rcfg-07129f3acded87625",
    "name": "my-resource-config",
    "portRanges": [
        "1-65535"
    ],
    "protocol": "TCP",
    "resourceConfigurationDefinition": {
        "ipResource": {
            "ipAddress": "10.0.14.85"
        }
    },
    "resourceGatewayId": "rgw-0bba03f3d56060135",
    "status": "ACTIVE",
    "type": "SINGLE"
}
```
Per ulteriori informazioni, consulta [Configurazione delle risorse per risorse VPC](https://docs.aws.amazon.com/vpc-lattice/latest/ug/resource-configuration.html) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, vedere [CreateResourceConfiguration](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/create-resource-configuration.html)in *AWS CLI Command Reference.* 

### `create-resource-gateway`
<a name="vpc-lattice_CreateResourceGateway_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`create-resource-gateway`.

**AWS CLI**  
**Come creare un gateway per le risorse**  
L’esempio `create-resource-gateway` seguente crea un gateway per le risorse per la sottorete specificata.  

```
aws vpc-lattice create-resource-gateway \
    --name my-resource-gateway \
    --vpc-identifier vpc-0bf4c2739bc05a69 \
    --subnet-ids subnet-08e8943905b63a683
```
Output:  

```
{
    "arn": "arn:aws:vpc-lattice:us-east-1:123456789012:resourcegateway/rgw-0bba03f3d56060135",
    "id": "rgw-0bba03f3d56060135",
    "ipAddressType": "IPV4",
    "name": "my-resource-gateway",
    "securityGroupIds": [
        "sg-087ffd596c5fe962c"
    ],
    "status": "ACTIVE",
    "subnetIds": [
        "subnet-08e8943905b63a683"
    ],
    "vpcIdentifier": "vpc-0bf4c2739bc05a694"
}
```
Per ulteriori informazioni, consulta [Gateway per le risorse in VPC Lattice](https://docs.aws.amazon.com/vpc-lattice/latest/ug/resource-gateway.html) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [CreateResourceGateway AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/create-resource-gateway.html)*Command Reference*. 

### `create-service-network-service-association`
<a name="vpc-lattice_CreateServiceNetworkServiceAssociation_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`create-service-network-service-association`.

**AWS CLI**  
**Come creare un’associazione a un servizio**  
L’esempio `create-service-network-service-association` seguente associa il servizio specificato alla rete di servizi specificata.  

```
aws vpc-lattice create-service-network-service-association \
    --service-identifier svc-0285b53b2eEXAMPLE \
    --service-network-identifier sn-080ec7dc93EXAMPLE
```
Output:  

```
{
    "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:servicenetworkserviceassociation/snsa-0e16955a8cEXAMPLE",
    "createdBy": "123456789012",
    "dnsEntry": {
        "domainName": "my-lattice-service-0285b53b2eEXAMPLE.7d67968.vpc-lattice-svcs.us-east-2.on.aws",
        "hostedZoneId": "Z09127221KTH2CEXAMPLE"
    },
    "id": "snsa-0e16955a8cEXAMPLE",
    "status": "CREATE_IN_PROGRESS"
}
```
Per ulteriori informazioni, consulta [Gestire le associazioni dei servizi](https://docs.aws.amazon.com/vpc-lattice/latest/ug/service-network-associations.html#service-network-service-associations) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [CreateServiceNetworkServiceAssociation AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/create-service-network-service-association.html)*Command Reference*. 

### `create-service-network-vpc-association`
<a name="vpc-lattice_CreateServiceNetworkVpcAssociation_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`create-service-network-vpc-association`.

**AWS CLI**  
**Come creare un’associazione a un VPC**  
L’esempio `create-service-network-vpc-association` seguente associa il VPC specificato alla rete di servizi specificata. Il gruppo di sicurezza specificato controlla quali risorse nel VPC possono accedere alla rete di servizi e ai relativi servizi.  

```
aws vpc-lattice create-service-network-vpc-association \
    --vpc-identifier vpc-0a1b2c3d4eEXAMPLE \
    --service-network-identifier sn-080ec7dc93EXAMPLE \
    --security-group-ids sg-0aee16bc6cEXAMPLE
```
Output:  

```
{
    "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:servicenetworkvpcassociation/snva-0821fc8631EXAMPLE",
    "createdBy": "123456789012",
    "id": "snva-0821fc8631EXAMPLE",
    "securityGroupIds": [
        "sg-0aee16bc6cEXAMPLE"
    ],
    "status": "CREATE_IN_PROGRESS"
}
```
Per ulteriori informazioni, consulta [Gestire le associazioni VPC](https://docs.aws.amazon.com/vpc-lattice/latest/ug/service-network-associations.html#service-network-vpc-associations) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [CreateServiceNetworkVpcAssociation AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/create-service-network-vpc-association.html)*Command Reference*. 

### `create-service-network`
<a name="vpc-lattice_CreateServiceNetwork_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`create-service-network`.

**AWS CLI**  
**Come creare una rete di servizi**  
L’esempio `create-service-network` seguente crea una rete di servizi con il nome specificato.  

```
aws vpc-lattice create-service-network \
    --name my-service-network
```
Output:  

```
{
    "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:servicenetwork/sn-080ec7dc93EXAMPLE",
    "authType": "NONE",
    "id": "sn-080ec7dc93EXAMPLE",
    "name": "my-service-network"
}
```
Per ulteriori informazioni, consulta [Reti di servizio](https://docs.aws.amazon.com/vpc-lattice/latest/ug/service-networks.html) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [CreateServiceNetwork AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/create-service-network.html)*Command Reference*. 

### `create-service`
<a name="vpc-lattice_CreateService_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`create-service`.

**AWS CLI**  
**Come creare un servizio**  
L’esempio `create-service` seguente crea un servizio con il nome specificato.  

```
aws vpc-lattice create-service \
    --name my-lattice-service
```
Output:  

```
{
    "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:service/svc-0285b53b2eEXAMPLE",
    "authType": "NONE",
    "dnsEntry": {
        "domainName": "my-lattice-service-0285b53b2eEXAMPLE.1a2b3c4.vpc-lattice-svcs.us-east-2.on.aws",
        "hostedZoneId": "Z09127221KTH2CEXAMPLE"
    },
    "id": "svc-0285b53b2eEXAMPLE",
    "name": "my-lattice-service",
    "status": "CREATE_IN_PROGRESS"
}
```
Per ulteriori informazioni, consulta [Servizi in VPC Lattice](https://docs.aws.amazon.com/vpc-lattice/latest/ug/services.html) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [CreateService AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/create-service.html)*Command Reference*. 

### `create-target-group`
<a name="vpc-lattice_CreateTargetGroup_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`create-target-group`.

**AWS CLI**  
**Esempio 1: come creare un gruppo di destinazione di tipo INSTANCE**  
L’esempio `create-target-group` seguente crea un gruppo di destinazione con il nome, il tipo e la configurazione specificati.  

```
aws vpc-lattice create-target-group \
    --name my-lattice-target-group-instance \
    --type INSTANCE \
    --config file://tg-config.json
```
Contenuto di `tg-config.json`:  

```
{
    "port": 443,
    "protocol": "HTTPS",
    "protocolVersion": "HTTP1",
    "vpcIdentifier": "vpc-f1663d9868EXAMPLE"
}
```
Output:  

```
{
    "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:targetgroup/tg-0eaa4b9ab4EXAMPLE",
    "config": {
        "healthCheck": {
            "enabled": true,
            "healthCheckIntervalSeconds": 30,
            "healthCheckTimeoutSeconds": 5,
            "healthyThresholdCount": 5,
            "matcher": {
                "httpCode": "200"
            },
            "path": "/",
            "protocol": "HTTPS",
            "protocolVersion": "HTTP1",
            "unhealthyThresholdCount": 2
        },
        "port": 443,
        "protocol": "HTTPS",
        "protocolVersion": "HTTP1",
        "vpcIdentifier": "vpc-f1663d9868EXAMPLE"
    },
    "id": "tg-0eaa4b9ab4EXAMPLE",
    "name": "my-lattice-target-group-instance",
    "status": "CREATE_IN_PROGRESS",
    "type": "INSTANCE"
}
```
**Esempio 2: come creare un gruppo di destinazione di tipo IP**  
L’esempio `create-target-group` seguente crea un gruppo di destinazione con il nome, il tipo e la configurazione specificati.  

```
aws vpc-lattice create-target-group \
    --name my-lattice-target-group-ip \
    --type IP \
    --config file://tg-config.json
```
Contenuto di `tg-config.json`:  

```
{
    "ipAddressType": "IPV4",
    "port": 443,
    "protocol": "HTTPS",
    "protocolVersion": "HTTP1",
    "vpcIdentifier": "vpc-f1663d9868EXAMPLE"
}
```
Output:  

```
{
    "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:targetgroup/tg-0eaa4b9ab4EXAMPLE",
    "config": {
        "healthCheck": {
            "enabled": true,
            "healthCheckIntervalSeconds": 30,
            "healthCheckTimeoutSeconds": 5,
            "healthyThresholdCount": 5,
            "matcher": {
                "httpCode": "200"
            },
            "path": "/",
            "protocol": "HTTPS",
            "protocolVersion": "HTTP1",
            "unhealthyThresholdCount": 2
        },
        "ipAddressType": "IPV4",
        "port": 443,
        "protocol": "HTTPS",
        "protocolVersion": "HTTP1",
        "vpcIdentifier": "vpc-f1663d9868EXAMPLE"
    },
    "id": "tg-0eaa4b9ab4EXAMPLE",
    "name": "my-lattice-target-group-ip",
    "status": "CREATE_IN_PROGRESS",
    "type": "IP"
}
```
**Esempio 3: come creare un gruppo di destinazione di tipo LAMBDA**  
L’esempio `create-target-group` seguente crea un gruppo di destinazione con il nome, il tipo e la configurazione specificati.  

```
aws vpc-lattice create-target-group \
    --name my-lattice-target-group-lambda \
    --type LAMBDA
```
Output:  

```
{
    "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:targetgroup/tg-0eaa4b9ab4EXAMPLE",
    "id": "tg-0eaa4b9ab4EXAMPLE",
    "name": "my-lattice-target-group-lambda",
    "status": "CREATE_IN_PROGRESS",
    "type": "LAMBDA"
}
```
**Esempio 4: come creare un gruppo di destinazione di tipo ALB**  
L’esempio `create-target-group` seguente crea un gruppo di destinazione con il nome, il tipo e la configurazione specificati.  

```
aws vpc-lattice create-target-group \
    --name my-lattice-target-group-alb \
    --type ALB \
    --config file://tg-config.json
```
Contenuto di `tg-config.json`:  

```
{
    "port": 443,
    "protocol": "HTTPS",
    "protocolVersion": "HTTP1",
    "vpcIdentifier": "vpc-f1663d9868EXAMPLE"
}
```
Output:  

```
{
    "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:targetgroup/tg-0eaa4b9ab4EXAMPLE",
    "config": {
        "port": 443,
        "protocol": "HTTPS",
        "protocolVersion": "HTTP1",
        "vpcIdentifier": "vpc-f1663d9868EXAMPLE"
    },
    "id": "tg-0eaa4b9ab4EXAMPLE",
    "name": "my-lattice-target-group-alb",
    "status": "CREATE_IN_PROGRESS",
    "type": "ALB"
}
```
Per ulteriori informazioni, consulta [Gruppi di destinazione](https://docs.aws.amazon.com/vpc-lattice/latest/ug/target-groups.html) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [CreateTargetGroup AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/create-target-group.html)*Command Reference*. 

### `delete-auth-policy`
<a name="vpc-lattice_DeleteAuthPolicy_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`delete-auth-policy`.

**AWS CLI**  
**Come eliminare una policy di autenticazione**  
L’esempio `delete-auth-policy` seguente elimina la policy di autenticazione per il servizio specificato.  

```
aws vpc-lattice delete-auth-policy \
    --resource-identifier svc-0285b53b2eEXAMPLE
```
Questo comando non produce alcun output.  
Per ulteriori informazioni, consulta [Policy di autenticazione](https://docs.aws.amazon.com/vpc-lattice/latest/ug/auth-policies.html) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [DeleteAuthPolicy AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/delete-auth-policy.html)*Command Reference*. 

### `delete-listener`
<a name="vpc-lattice_DeleteListener_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`delete-listener`.

**AWS CLI**  
**Come eliminare un listener**  
L’esempio `delete-listener` seguente elimina il listener specificato.  

```
aws vpc-lattice delete-listener \
    --listener-identifier listener-07cc7fb0abEXAMPLE \
    --service-identifier svc-0285b53b2eEXAMPLE
```
Questo comando non produce alcun output.  
Per ulteriori informazioni, consulta [Listener](https://docs.aws.amazon.com/vpc-lattice/latest/ug/listeners.html) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [DeleteListener AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/delete-listener.html)*Command Reference*. 

### `delete-resource-configuration`
<a name="vpc-lattice_DeleteResourceConfiguration_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`delete-resource-configuration`.

**AWS CLI**  
**Come eliminare una configurazione di risorse**  
L’esempio `delete-resource-configuration` seguente elimina la configurazione di risorse specificata.  

```
aws vpc-lattice delete-resource-configuration \
    --resource-configuration-identifier rcfg-07129f3acded87625
```
Questo comando non produce alcun output.  
Per ulteriori informazioni, consulta [Gateway per le risorse in VPC Lattice](https://docs.aws.amazon.com/vpc-lattice/latest/ug/resource-configuration.html) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [DeleteResourceConfiguration AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/delete-resource-configuration.html)*Command Reference*. 

### `delete-resource-gateway`
<a name="vpc-lattice_DeleteResourceGateway_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`delete-resource-gateway`.

**AWS CLI**  
**Come eliminare un gateway per le risorse**  
L’esempio `delete-resource-gateway` seguente elimina il gateway per le risorse specificato.  

```
aws vpc-lattice delete-resource-gateway \
    --resource-gateway-identifier rgw-0bba03f3d56060135
```
Output:  

```
{
    "arn": "arn:aws:vpc-lattice:us-east-1:123456789012:resourcegateway/rgw-0bba03f3d56060135",
    "id": "rgw-0bba03f3d56060135",
    "name": "my-resource-gateway",
    "status": "DELETE_IN_PROGRESS"
}
```
Per ulteriori informazioni, consulta [Gateway per le risorse in VPC Lattice](https://docs.aws.amazon.com/vpc-lattice/latest/ug/resource-gateway.html) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [DeleteResourceGateway AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/delete-resource-gateway.html)*Command Reference*. 

### `delete-service-network-service-association`
<a name="vpc-lattice_DeleteServiceNetworkServiceAssociation_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`delete-service-network-service-association`.

**AWS CLI**  
**Come eliminare un’associazione di servizi**  
L’esempio `delete-service-network-service-association` seguente elimina l’associazione di servizi specificata.  

```
aws vpc-lattice delete-service-network-service-association \
    --service-network-service-association-identifier snsa-031fabb4d8EXAMPLE
```
Output:  

```
{
    "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:servicenetworkserviceassociation/snsa-031fabb4d8EXAMPLE",
    "id": "snsa-031fabb4d8EXAMPLE",
    "status": "DELETE_IN_PROGRESS"
}
```
Per ulteriori informazioni, consulta [Gestire le associazioni dei servizi](https://docs.aws.amazon.com/vpc-lattice/latest/ug/service-network-associations.html#service-network-service-associations) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [DeleteServiceNetworkServiceAssociation AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/delete-service-network-service-association.html)*Command Reference*. 

### `delete-service-network-vpc-association`
<a name="vpc-lattice_DeleteServiceNetworkVpcAssociation_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`delete-service-network-vpc-association`.

**AWS CLI**  
**Come eliminare un’associazione VPC**  
L’esempio `delete-service-network-vpc-association` seguente elimina l’associazione VPC specificata.  

```
aws vpc-lattice delete-service-network-vpc-association \
    --service-network-vpc-association-identifier snva-0821fc8631EXAMPLE
```
Output:  

```
{
    "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:servicenetworkvpcassociation/snva-0821fc8631EXAMPLE",
    "id": "snva-0821fc8631EXAMPLE",
    "status": "DELETE_IN_PROGRESS"
}
```
Per ulteriori informazioni, consulta [Gestire le associazioni VPC](https://docs.aws.amazon.com/vpc-lattice/latest/ug/service-network-associations.html#service-network-vpc-associations) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [DeleteServiceNetworkVpcAssociation AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/delete-service-network-vpc-association.html)*Command Reference*. 

### `delete-service-network`
<a name="vpc-lattice_DeleteServiceNetwork_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`delete-service-network`.

**AWS CLI**  
**Come eliminare una rete di servizi**  
L’esempio `delete-service-network` seguente elimina la rete di servizi specificata.  

```
aws vpc-lattice delete-service-network \
    --service-network-identifier sn-080ec7dc93EXAMPLE
```
Questo comando non produce alcun output.  
Per ulteriori informazioni, consulta [Reti di servizio](https://docs.aws.amazon.com/vpc-lattice/latest/ug/service-networks.html) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [DeleteServiceNetwork AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/delete-service-network.html)*Command Reference*. 

### `delete-service`
<a name="vpc-lattice_DeleteService_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`delete-service`.

**AWS CLI**  
**Come eliminare un servizio**  
L’esempio `delete-service` seguente elimina il servizio specificato.  

```
aws vpc-lattice delete-service \
    --service-identifier svc-0285b53b2eEXAMPLE
```
Output:  

```
{
    "arn": "arn:aws:vpc-lattice:us-west-2:123456789012:service/svc-0285b53b2eEXAMPLE",
    "id": "svc-0285b53b2eEXAMPLE",
    "name": "my-lattice-service",
    "status": "DELETE_IN_PROGRESS"
}
```
Per ulteriori informazioni, consulta [Servizi in VPC Lattice](https://docs.aws.amazon.com/vpc-lattice/latest/ug/services.html) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [DeleteService AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/delete-service.html)*Command Reference*. 

### `delete-target-group`
<a name="vpc-lattice_DeleteTargetGroup_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`delete-target-group`.

**AWS CLI**  
**Come eliminare un gruppo di destinazione**  
L’esempio `delete-target-group` seguente elimina il gruppo di destinazione specificato.  

```
aws vpc-lattice delete-target-group \
    --target-group-identifier tg-0eaa4b9ab4EXAMPLE
```
Output:  

```
{
    "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:targetgroup/tg-0eaa4b9ab4EXAMPLE",
    "id": "tg-0eaa4b9ab4EXAMPLE",
    "status": "DELETE_IN_PROGRESS"
}
```
Per ulteriori informazioni, consulta [Gruppi di destinazione](https://docs.aws.amazon.com/vpc-lattice/latest/ug/target-groups.html) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [DeleteTargetGroup AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/delete-target-group.html)*Command Reference*. 

### `deregister-targets`
<a name="vpc-lattice_DeregisterTargets_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`deregister-targets`.

**AWS CLI**  
**Come annullare la registrazione di una destinazione**  
L’esempio `deregister-targets` seguente annulla la registrazione della destinazione specificata nel gruppo di destinazione specificato.  

```
aws vpc-lattice deregister-targets \
    --targets i-07dd579bc5EXAMPLE \
    --target-group-identifier tg-0eaa4b9ab4EXAMPLE
```
Output:  

```
{
    "successful": [
        {
            "id": "i-07dd579bc5EXAMPLE",
            "port": 443
        }
    ],
    "unsuccessful": []
}
```
Per ulteriori informazioni, consulta [Registrare le destinazioni](https://docs.aws.amazon.com/vpc-lattice/latest/ug/register-targets.html) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [DeregisterTargets AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/deregister-targets.html)*Command Reference*. 

### `get-auth-policy`
<a name="vpc-lattice_GetAuthPolicy_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`get-auth-policy`.

**AWS CLI**  
**Come ottenere informazioni su una policy di autorizzazione**  
L’esempio `get-auth-policy` seguente ottiene informazioni sulla policy di autenticazione per il servizio specificato.  

```
aws vpc-lattice get-auth-policy \
    --resource-identifier svc-0285b53b2eEXAMPLE
```
Output:  

```
{
    "createdAt": "2023-06-07T03:51:20.266Z",
    "lastUpdatedAt": "2023-06-07T04:39:27.082Z",
    "policy": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::123456789012:role/my-clients\"},\"Action\":\"vpc-lattice-svcs:Invoke\",\"Resource\":\"arn:aws:vpc-lattice:us-east-2:123456789012:service/svc-0285b53b2eEXAMPLE\"}]}",
    "state": "Active"
}
```
Per ulteriori informazioni, consulta [Policy di autenticazione](https://docs.aws.amazon.com/vpc-lattice/latest/ug/auth-policies.html) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [GetAuthPolicy AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/get-auth-policy.html)*Command Reference*. 

### `get-listener`
<a name="vpc-lattice_GetListener_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`get-listener`.

**AWS CLI**  
**Come ottenere informazioni su un listener di un servizio**  
L’esempio `get-listener` seguente ottiene informazioni sul listener specificato per il servizio specificato.  

```
aws vpc-lattice get-listener \
    --listener-identifier listener-0ccf55918cEXAMPLE \
    --service-identifier svc-0285b53b2eEXAMPLE
```
Output:  

```
{
    "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:service/svc-0285b53b2eEXAMPLE/listener/listener-0ccf55918cEXAMPLE",
    "createdAt": "2023-05-07T05:08:45.192Z",
    "defaultAction": {
        "forward": {
            "targetGroups": [
                {
                    "targetGroupIdentifier": "tg-0ff213abb6EXAMPLE",
                    "weight": 1
                }
            ]
        }
    },
    "id": "listener-0ccf55918cEXAMPLE",
    "lastUpdatedAt": "2023-05-07T05:08:45.192Z",
    "name": "http-80",
    "port": 80,
    "protocol": "HTTP",
    "serviceArn": "arn:aws:vpc-lattice:us-east-2:123456789012:service/svc-0285b53b2eEXAMPLE",
    "serviceId": "svc-0285b53b2eEXAMPLE"
}
```
Per ulteriori informazioni, consulta [Definire il routing](https://docs.aws.amazon.com/vpc-lattice/latest/ug/services.html#define-routing) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [GetListener AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/get-listener.html)*Command Reference*. 

### `get-resource-configuration`
<a name="vpc-lattice_GetResourceConfiguration_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`get-resource-configuration`.

**AWS CLI**  
**Come ottenere informazioni su una configurazione delle risorse**  
L’esempio `get-resource-configuration` seguente ottiene informazioni sulla configurazione delle risorse specificata.  

```
aws vpc-lattice get-resource-configuration \
    --resource-configuration-identifier rcfg-07129f3acded87625
```
Output:  

```
{
    "allowAssociationToShareableServiceNetwork": true,
    "amazonManaged": false,
    "arn": "arn:aws:vpc-lattice:us-east-1:123456789012:resourceconfiguration/rcfg-07129f3acded87625",
    "createdAt": "2025-02-01T00:57:35.871000+00:00",
    "id": "rcfg-07129f3acded87625",
    "lastUpdatedAt": "2025-02-01T00:57:46.874000+00:00",
    "name": "my-resource-config",
    "portRanges": [
        "1-65535"
    ],
    "protocol": "TCP",
    "resourceConfigurationDefinition": {
        "ipResource": {
            "ipAddress": "10.0.14.85"
        }
    },
    "resourceGatewayId": "rgw-0bba03f3d56060135",
    "status": "ACTIVE",
    "type": "SINGLE"
}
```
Per ulteriori informazioni, consulta [Gateway per le risorse in VPC Lattice](https://docs.aws.amazon.com/vpc-lattice/latest/ug/resource-configuration.html) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [GetResourceConfiguration AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/get-resource-configuration.html)*Command Reference*. 

### `get-resource-gateway`
<a name="vpc-lattice_GetResourceGateway_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`get-resource-gateway`.

**AWS CLI**  
**Come ottenere informazioni su un gateway per le risorse**  
L’esempio `get-resource-gateway` seguente ottiene informazioni sul gateway per le risorse specificato.  

```
aws vpc-lattice get-resource-gateway \
    --resource-gateway-identifier rgw-0bba03f3d56060135
```
Output:  

```
{
    "arn": "arn:aws:vpc-lattice:us-east-1:123456789012:resourcegateway/rgw-0bba03f3d56060135",
    "createdAt": "2025-02-01T00:57:33.241000+00:00",
    "id": "rgw-0bba03f3d56060135",
    "ipAddressType": "IPV4",
    "lastUpdatedAt": "2025-02-01T00:57:44.351000+00:00",
    "name": "my-resource-gateway",
    "securityGroupIds": [
        "sg-087ffd596c5fe962c"
    ],
    "status": "ACTIVE",
    "subnetIds": [
        "subnet-08e8943905b63a683"
    ],
    "vpcId": "vpc-0bf4c2739bc05a694"
}
```
Per ulteriori informazioni, consulta [Gateway per le risorse in VPC Lattice](https://docs.aws.amazon.com/vpc-lattice/latest/ug/resource-gateway.html) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [GetResourceGateway AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/get-resource-gateway.html)*Command Reference*. 

### `get-service-network-service-association`
<a name="vpc-lattice_GetServiceNetworkServiceAssociation_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`get-service-network-service-association`.

**AWS CLI**  
**Come ottenere informazioni su un’associazione di servizi**  
L’esempio `get-service-network-service-association` seguente ottiene informazioni sull’associazione di servizi specificata.  

```
aws vpc-lattice get-service-network-service-association \
    --service-network-service-association-identifier snsa-031fabb4d8EXAMPLE
```
Output:  

```
{
    "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:servicenetworkserviceassociation/snsa-031fabb4d8EXAMPLE",
    "createdAt": "2023-05-05T21:48:16.076Z",
    "createdBy": "123456789012",
    "dnsEntry": {
        "domainName": "my-lattice-service-0285b53b2eEXAMPLE.7d67968.vpc-lattice-svcs.us-east-2.on.aws",
        "hostedZoneId": "Z09127221KTH2CEXAMPLE"
    },
    "id": "snsa-031fabb4d8EXAMPLE",
    "serviceArn": "arn:aws:vpc-lattice:us-east-2:123456789012:service/svc-0285b53b2eEXAMPLE",
    "serviceId": "svc-0285b53b2eEXAMPLE",
    "serviceName": "my-lattice-service",
    "serviceNetworkArn": "arn:aws:vpc-lattice:us-east-2:123456789012:servicenetwork/sn-080ec7dc93EXAMPLE",
    "serviceNetworkId": "sn-080ec7dc93EXAMPLE",
    "serviceNetworkName": "my-service-network",
    "status": "ACTIVE"
}
```
Per ulteriori informazioni, consulta [Gestire le associazioni dei servizi](https://docs.aws.amazon.com/vpc-lattice/latest/ug/service-network-associations.html#service-network-service-associations) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [GetServiceNetworkServiceAssociation AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/get-service-network-service-association.html)*Command Reference*. 

### `get-service-network-vpc-association`
<a name="vpc-lattice_GetServiceNetworkVpcAssociation_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`get-service-network-vpc-association`.

**AWS CLI**  
**Come ottenere informazioni su un’associazione VPC**  
L’esempio `get-service-network-vpc-association` seguente ottiene informazioni sull’associazione VPC specificata.  

```
aws vpc-lattice get-service-network-vpc-association \
    --service-network-vpc-association-identifier snva-0821fc8631EXAMPLE
```
Output:  

```
{
    "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:servicenetworkvpcassociation/snva-0821fc8631EXAMPLE",
    "createdAt": "2023-06-06T23:41:08.421Z",
    "createdBy": "123456789012",
    "id": "snva-0c5dcb60d6EXAMPLE",
    "lastUpdatedAt": "2023-06-06T23:41:08.421Z",
    "securityGroupIds": [
        "sg-0aee16bc6cEXAMPLE"
    ],
    "serviceNetworkArn": "arn:aws:vpc-lattice:us-east-2:123456789012:servicenetwork/sn-080ec7dc93EXAMPLE",
    "serviceNetworkId": "sn-080ec7dc93EXAMPLE",
    "serviceNetworkName": "my-service-network",
    "status": "ACTIVE",
    "vpcId": "vpc-0a1b2c3d4eEXAMPLE"
}
```
Per ulteriori informazioni, consulta [Gestire le associazioni VPC](https://docs.aws.amazon.com/vpc-lattice/latest/ug/service-network-associations.html#service-network-vpc-associations) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [GetServiceNetworkVpcAssociation AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/get-service-network-vpc-association.html)*Command Reference*. 

### `get-service-network`
<a name="vpc-lattice_GetServiceNetwork_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`get-service-network`.

**AWS CLI**  
**Come ottenere informazioni su una rete di servizi**  
L’esempio `get-service-network` seguente ottiene informazioni sulla rete di servizi specificata.  

```
aws vpc-lattice get-service-network \
    --service-network-identifier sn-080ec7dc93EXAMPLE
```
Output:  

```
{
   "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:servicenetwork/sn-080ec7dc93EXAMPLE",
   "authType": "AWS_IAM",
   "createdAt": "2023-05-05T15:26:08.417Z",
   "id": "sn-080ec7dc93EXAMPLE",
   "lastUpdatedAt": "2023-05-05T15:26:08.417Z",
   "name": "my-service-network",
   "numberOfAssociatedServices": 2,
   "numberOfAssociatedVPCs": 3
}
```
Per ulteriori informazioni, consulta [Reti di servizio](https://docs.aws.amazon.com/vpc-lattice/latest/ug/service-networks.html) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [GetServiceNetwork AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/get-service-network.html)*Command Reference*. 

### `get-service`
<a name="vpc-lattice_GetService_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`get-service`.

**AWS CLI**  
**Come ottenere informazioni su un servizio**  
L’esempio `get-service` seguente ottiene informazioni sul servizio specificato.  

```
aws vpc-lattice get-service \
    --service-identifier svc-0285b53b2eEXAMPLE
```
Output:  

```
{
    "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:service/svc-0285b53b2eEXAMPLE",
    "authType": "AWS_IAM",
    "createdAt": "2023-05-05T21:35:29.339Z",
    "dnsEntry": {
        "domainName": "my-lattice-service-0285b53b2eEXAMPLE.7d67968.vpc-lattice-svcs.us-east-2.on.aws",
        "hostedZoneId": "Z09127221KTH2CFUOHIZH"
    },
    "id": "svc-0285b53b2eEXAMPLE",
    "lastUpdatedAt": "2023-05-05T21:35:29.339Z",
    "name": "my-lattice-service",
    "status": "ACTIVE"
}
```
Per ulteriori informazioni, consulta [Servizi](https://docs.aws.amazon.com/vpc-lattice/latest/ug/services.html) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [GetService AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/get-service.html)*Command Reference*. 

### `get-target-group`
<a name="vpc-lattice_GetTargetGroup_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`get-target-group`.

**AWS CLI**  
**Come ottenere informazioni su un gruppo di destinazione**  
L’esempio `get-target-group` seguente ottiene informazioni sul gruppo di destinazione specificato, che ha un tipo di destinazione `INSTANCE`.  

```
aws vpc-lattice get-target-group \
    --target-group-identifier tg-0eaa4b9ab4EXAMPLE
```
Output:  

```
{
    "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:targetgroup/tg-0eaa4b9ab4EXAMPLE",
    "config": {
        "healthCheck": {
            "enabled": true,
            "healthCheckIntervalSeconds": 30,
            "healthCheckTimeoutSeconds": 5,
            "healthyThresholdCount": 5,
            "matcher": {
                "httpCode": "200"
            },
            "path": "/",
            "protocol": "HTTPS",
            "protocolVersion": "HTTP1",
            "unhealthyThresholdCount": 2
        },
        "port": 443,
        "protocol": "HTTPS",
        "protocolVersion": "HTTP1",
        "vpcIdentifier": "vpc-f1663d9868EXAMPLE"
    },
    "createdAt": "2023-05-06T04:41:04.122Z",
    "id": "tg-0eaa4b9ab4EXAMPLE",
    "lastUpdatedAt": "2023-05-06T04:41:04.122Z",
    "name": "my-target-group",
    "serviceArns": [
        "arn:aws:vpc-lattice:us-east-2:123456789012:service/svc-0285b53b2eEXAMPLE"
    ],
    "status": "ACTIVE",
    "type": "INSTANCE"
}
```
Per ulteriori informazioni, consulta [Gruppi di destinazione](https://docs.aws.amazon.com/vpc-lattice/latest/ug/target-groups.html) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [GetTargetGroup AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/get-target-group.html)*Command Reference*. 

### `list-listeners`
<a name="vpc-lattice_ListListeners_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`list-listeners`.

**AWS CLI**  
**Come elencare i listener per un servizio**  
L’esempio `list-listeners` seguente elenca i listener per il servizio specificato.  

```
aws vpc-lattice list-listeners \
    --service-identifier svc-0285b53b2eEXAMPLE
```
Output:  

```
{
    "items": [
        {
            "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:service/svc-0285b53b2eEXAMPLE/listener/listener-0ccf55918cEXAMPLE",
            "createdAt": "2023-05-07T05:08:45.192Z",
            "id": "listener-0ccf55918cEXAMPLE",
            "lastUpdatedAt": "2023-05-07T05:08:45.192Z",
            "name": "http-80",
            "port": 80,
            "protocol": "HTTP"
        }
    ]
}
```
Per ulteriori informazioni, consulta [Definire il routing](https://docs.aws.amazon.com/vpc-lattice/latest/ug/services.html#define-routing) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [ListListeners AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/list-listeners.html)*Command Reference*. 

### `list-resource-configurations`
<a name="vpc-lattice_ListResourceConfigurations_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`list-resource-configurations`.

**AWS CLI**  
**Come elencare le configurazioni delle risorse**  
L’esempio `list-resource-configurations` seguente elenca le configurazioni delle risorse.  

```
aws vpc-lattice list-resource-configurations
```
Output:  

```
{
    "items": [
        {
            "amazonManaged": false,
            "arn": "arn:aws:vpc-lattice:us-east-1:123456789012:resourceconfiguration/rcfg-07129f3acded87625",
            "createdAt": "2025-02-01T00:57:35.871000+00:00",
            "id": "rcfg-07129f3acded87625",
            "lastUpdatedAt": "2025-02-01T00:57:46.874000+00:00",
            "name": "my-resource-config",
            "resourceGatewayId": "rgw-0bba03f3d56060135",
            "status": "ACTIVE",
            "type": "SINGLE"
        }
    ]
}
```
Per ulteriori informazioni, consulta [Configurazione delle risorse](https://docs.aws.amazon.com/vpc-lattice/latest/ug/resource-configuration.html) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [ListResourceConfigurations AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/list-resource-configurations.html)*Command Reference*. 

### `list-resource-endpoint-associations`
<a name="vpc-lattice_ListResourceEndpointAssociations_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`list-resource-endpoint-associations`.

**AWS CLI**  
**Come elencare le associazioni di endpoint VPC**  
L’esempio `list-resource-endpoint-associations` seguente elenca gli endpoint VPC associati alla configurazione delle risorse specificata.  

```
aws vpc-lattice list-resource-endpoint-associations \
    --resource-configuration-identifier rcfg-07129f3acded87625
```
Output:  

```
{
    "items": [
        {
            "arn": "arn:aws:vpc-lattice:us-east-1:123456789012:resourceendpointassociation/rea-0956a7435baf89326",
            "createdAt": "2025-02-01T00:57:38.998000+00:00",
            "id": "rea-0956a7435baf89326",
            "resourceConfigurationArn": "arn:aws:vpc-lattice:us-east-1:123456789012:resourceconfiguration/rcfg-07129f3acded87625",
            "resourceConfigurationId": "rcfg-07129f3acded87625",
            "vpcEndpointId": "vpce-019b90d6f16d4f958",
            "vpcEndpointOwner": "123456789012"
        }
    ]
}
```
Per ulteriori informazioni, consulta [Gestire le associazioni per una configurazione di risorse VPC Lattice](https://docs.aws.amazon.com/vpc-lattice/latest/ug/resource-configuration-associations.html) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [ListResourceEndpointAssociations AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/list-resource-endpoint-associations.html)*Command Reference*. 

### `list-resource-gateways`
<a name="vpc-lattice_ListResourceGateways_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`list-resource-gateways`.

**AWS CLI**  
**Come elencare i gateway per le risorse**  
L’esempio `list-resource-gateways` seguente elenca tutti i gateway per le risorse in uso.  

```
aws vpc-lattice list-resource-gateways
```
Output:  

```
{
    "items": [
        {
            "arn": "arn:aws:vpc-lattice:us-east-1:123456789012:resourcegateway/rgw-0bba03f3d56060135",
            "createdAt": "2025-02-01T00:57:33.241000+00:00",
            "id": "rgw-0bba03f3d56060135",
            "ipAddressType": "IPV4",
            "lastUpdatedAt": "2025-02-01T00:57:44.351000+00:00",
            "name": "my-resource-gateway",
            "seurityGroupIds": [
                "sg-087ffd596c5fe962c"
            ],
            "status": "ACTIVE",
            "subnetIds": [
                "subnet-08e8943905b63a683"
            ],
            "vpcIdentifier": "vpc-0bf4c2739bc05a694"
        }
    ]
}
```
Per ulteriori informazioni, consulta [Gateway per le risorse in VPC Lattice](https://docs.aws.amazon.com/vpc-lattice/latest/ug/resource-gateway.html) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [ListResourceGateways AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/list-resource-gateways.html)*Command Reference*. 

### `list-service-network-service-associations`
<a name="vpc-lattice_ListServiceNetworkServiceAssociations_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`list-service-network-service-associations`.

**AWS CLI**  
**Come elencare le associazioni di servizi**  
L’esempio `list-service-network-service-associations` seguente elenca le associazioni di servizi per la rete di servizi specificata. L'`--query`opzione indirizza l'output alle associazioni IDs di servizi.  

```
aws vpc-lattice list-service-network-service-associations \
    --service-network-identifier sn-080ec7dc93EXAMPLE \
    --query items[*].id
```
Output:  

```
[
    "snsa-031fabb4d8EXAMPLE",
    "snsa-0e16955a8cEXAMPLE"
]
```
Per ulteriori informazioni, consulta [Gestire le associazioni dei servizi](https://docs.aws.amazon.com/vpc-lattice/latest/ug/service-network-associations.html#service-network-service-associations) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, vedere [ListServiceNetworkServiceAssociations](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/list-service-network-service-associations.html)in *AWS CLI Command Reference.* 

### `list-service-network-vpc-associations`
<a name="vpc-lattice_ListServiceNetworkVpcAssociations_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`list-service-network-vpc-associations`.

**AWS CLI**  
**Come elencare le associazioni VPC**  
L’esempio `list-service-network-vpc-associations` seguente elenca le associazioni VPC per la rete di servizi specificata. L'`--query`opzione indirizza l'output alle IDs associazioni VPC.  

```
aws vpc-lattice list-service-network-vpc-associations \
    --service-network-identifier sn-080ec7dc93EXAMPLE \
    --query items[*].id
```
Output:  

```
[
    "snva-0821fc8631EXAMPLE",
    "snva-0c5dcb60d6EXAMPLE"
]
```
Per ulteriori informazioni, consulta [Gestire le associazioni VPC](https://docs.aws.amazon.com/vpc-lattice/latest/ug/service-network-associations.html#service-network-vpc-associations) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, vedere [ListServiceNetworkVpcAssociations](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/list-service-network-vpc-associations.html)in *AWS CLI Command Reference*. 

### `list-service-network-vpc-endpoint-associations`
<a name="vpc-lattice_ListServiceNetworkVpcEndpointAssociations_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`list-service-network-vpc-endpoint-associations`.

**AWS CLI**  
**Come elencare le associazioni di endpoint VPC**  
L’esempio `list-service-network-vpc-endpoint-associations` seguente elenca gli endpoint VPC associati alla rete di servizi specificata.  

```
aws vpc-lattice list-service-network-vpc-endpoint-associations \
    --service-network-identifier sn-0808d1748faee0c1e
```
Output:  

```
{
    "items": [
        {
            "createdAt": "2025-02-01T01:21:36.667000+00:00",
            "serviceNetworkArn": "arn:aws:vpc-lattice:us-east-1:123456789012:servicenetwork/sn-0808d1748faee0c1e",
            "state": "ACTIVE",
            "vpcEndpointId": "vpce-0cc199f605eaeace7",
            "vpcEndpointOwnerId": "123456789012"
        }
    ]
}
```
Per ulteriori informazioni, consulta [Gestire le associazioni per una rete di servizio di VPC Lattice](https://docs.aws.amazon.com/vpc-lattice/latest/ug/service-network-associations.html) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [ListServiceNetworkVpcEndpointAssociations AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/list-service-network-vpc-endpoint-associations.html)*Command Reference*. 

### `list-service-networks`
<a name="vpc-lattice_ListServiceNetworks_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`list-service-networks`.

**AWS CLI**  
**Come elencare le reti di servizi**  
L’esempio `list-service-networks` seguente elenca le reti di servizi di proprietà o condivise con l’account chiamante. L’opzione `--query` definisce i nomi delle risorse Amazon (ARN) delle reti di servizi come ambito dei risultati.  

```
aws vpc-lattice list-service-networks \
    --query items[*].arn
```
Output:  

```
[
    "arn:aws:vpc-lattice:us-east-2:123456789012:servicenetwork/sn-080ec7dc93EXAMPLE",
    "arn:aws:vpc-lattice:us-east-2:111122223333:servicenetwork/sn-0ec4d436cfEXAMPLE"
]
```
Per ulteriori informazioni, consulta [Reti di servizio](https://docs.aws.amazon.com/vpc-lattice/latest/ug/service-networks.html) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [ListServiceNetworks AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/list-service-networks.html)*Command Reference*. 

### `list-services`
<a name="vpc-lattice_ListServices_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`list-services`.

**AWS CLI**  
**Come elencare i servizi**  
L'`list-services`esempio seguente elenca i servizi posseduti o condivisi con l'account chiamante. L’opzione `--query` definisce i nomi delle risorse Amazon (ARN) dei servizi come ambito dei risultati.  

```
aws vpc-lattice list-services \
    --query items[*].arn
```
Output:  

```
[
    "arn:aws:vpc-lattice:us-east-2:123456789012:service/svc-0285b53b2eEXAMPLE",
    "arn:aws:vpc-lattice:us-east-2:111122223333:service/svc-0b8ac96550EXAMPLE"
]
```
Per ulteriori informazioni, consulta [Servizi](https://docs.aws.amazon.com/vpc-lattice/latest/ug/services.html) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [ListServices AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/list-services.html)*Command Reference*. 

### `list-target-groups`
<a name="vpc-lattice_ListTargetGroups_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`list-target-groups`.

**AWS CLI**  
**Come elencare i gruppi di destinazione**  
L’esempio `list-target-groups` seguente elenca i gruppi di destinazione con un tipo di destinazione `LAMBDA`.  

```
aws vpc-lattice list-target-groups \
    --target-group-type LAMBDA
```
Output:  

```
{
    "items": [
        {
            "arn": "arn:aws:vpc-lattice:us-east-2:123456789012:targetgroup/tg-045c1b7d9dEXAMPLE",
            "createdAt": "2023-05-06T05:22:16.637Z",
            "id": "tg-045c1b7d9dEXAMPLE",
            "lastUpdatedAt": "2023-05-06T05:22:16.637Z",
            "name": "my-target-group-lam",
            "serviceArns": [
                "arn:aws:vpc-lattice:us-east-2:123456789012:service/svc-0285b53b2eEXAMPLE"
            ],
            "status": "ACTIVE",
            "type": "LAMBDA"
        }
    ]
}
```
Per ulteriori informazioni, consulta [Gruppi di destinazione](https://docs.aws.amazon.com/vpc-lattice/latest/ug/target-groups.html) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [ListTargetGroups AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/list-target-groups.html)*Command Reference*. 

### `list-targets`
<a name="vpc-lattice_ListTargets_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`list-targets`.

**AWS CLI**  
**Come elencare le destinazioni per un gruppo di destinazione**  
L’esempio `list-targets` seguente elenca le destinazioni per il gruppo di destinazione specificato.  

```
aws vpc-lattice list-targets \
    --target-group-identifier tg-0eaa4b9ab4EXAMPLE
```
Output:  

```
{
    "items": [
        {
            "id": "i-07dd579bc5EXAMPLE",
            "port": 443,
            "status": "HEALTHY"
        },
        {
            "id": "i-047b3c9078EXAMPLE",
            "port": 443,
            "reasonCode": "HealthCheckFailed",
            "status": "UNHEALTHY"
        }
    ]
}
```
Per ulteriori informazioni, consulta [Gruppi di destinazione](https://docs.aws.amazon.com/vpc-lattice/latest/ug/target-groups.html) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [ListTargets AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/list-targets.html)*Command Reference*. 

### `put-auth-policy`
<a name="vpc-lattice_PutAuthPolicy_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`put-auth-policy`.

**AWS CLI**  
**Come creare una policy di autenticazione per un servizio**  
L’esempio `put-auth-policy` seguente concede l’accesso alle richieste da qualsiasi principale autenticato che utilizza il ruolo IAM specificato. La risorsa è l’ARN del servizio a cui è collegata la policy.  

```
aws vpc-lattice put-auth-policy \
    --resource-identifier svc-0285b53b2eEXAMPLE \
    --policy file://auth-policy.json
```
Contenuto di `auth-policy.json`:  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws:iam::123456789012:role/my-clients"
            },
            "Action": "vpc-lattice-svcs:Invoke",
            "Resource": "arn:aws:vpc-lattice:us-east-2:123456789012:service/svc-0285b53b2eEXAMPLE"
        }
    ]
}
```
Output:  

```
{
    "policy": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::123456789012:role/my-clients\"},\"Action\":\"vpc-lattice-svcs:Invoke\",\"Resource\":\"arn:aws:vpc-lattice:us-east-2:123456789012:service/svc-0285b53b2eEXAMPLE\"}]}",
    "state": "Active"
}
```
Per ulteriori informazioni, consulta [Policy di autenticazione](https://docs.aws.amazon.com/vpc-lattice/latest/ug/auth-policies.html) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [PutAuthPolicy AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/put-auth-policy.html)*Command Reference*. 

### `register-targets`
<a name="vpc-lattice_RegisterTargets_cli_2_topic"></a>

Il seguente esempio di codice mostra come utilizzare`register-targets`.

**AWS CLI**  
**Come registrare una destinazione**  
L’esempio `register-targets` seguente registra la destinazione specificata nel gruppo di destinazione specificato.  

```
aws vpc-lattice register-targets \
    --targets id=i-047b3c9078EXAMPLE id=i-07dd579bc5EXAMPLE \
    --target-group-identifier tg-0eaa4b9ab4EXAMPLE
```
Output:  

```
{
    "successful": [
        {
            "id": "i-07dd579bc5EXAMPLE",
            "port": 443
        }
    ],
    "unsuccessful": [
        {
            "failureCode": "UnsupportedTarget",
            "failureMessage": "Instance targets must be in the same VPC as their target group",
            "id": "i-047b3c9078EXAMPLE",
            "port": 443
        }
    ]
}
```
Per ulteriori informazioni, consulta [Registrare le destinazioni](https://docs.aws.amazon.com/vpc-lattice/latest/ug/register-targets.html) nella *Guida per l’utente di Amazon VPC Lattice*.  
+  Per i dettagli sull'API, consulta [RegisterTargets AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/register-targets.html)*Command Reference*. 