

Les traductions sont fournies par des outils de traduction automatique. En cas de conflit entre le contenu d'une traduction et celui de la version originale en anglais, la version anglaise prévaudra.

# Exemples d'utilisation d'App Runner AWS CLI
<a name="cli_apprunner_code_examples"></a>

Les exemples de code suivants vous montrent comment effectuer des actions et implémenter des scénarios courants à l' AWS Command Line Interface aide d'App Runner.

Les *actions* sont des extraits de code de programmes plus larges et doivent être exécutées dans leur contexte. Alors que les actions vous indiquent comment appeler des fonctions de service individuelles, vous pouvez les voir en contexte dans leurs scénarios associés.

Chaque exemple inclut un lien vers le code source complet, où vous trouverez des instructions sur la configuration et l’exécution du code en contexte.

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

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

### `associate-custom-domain`
<a name="apprunner_AssociateCustomDomain_cli_topic"></a>

L'exemple de code suivant montre comment utiliser`associate-custom-domain`.

**AWS CLI**  
**Pour associer un nom de domaine et le sous-domaine www à un service**  
L’exemple `associate-custom-domain` suivant associe un nom de domaine personnalisé que vous contrôlez à un service App Runner. Le nom de domaine est le domaine racine `example.com`, y compris le sous-domaine spécifique `www.example.com`.  

```
aws apprunner associate-custom-domain \
    --cli-input-json file://input.json
```
Contenu de `input.json` :  

```
{
    "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa",
    "DomainName": "example.com",
    "EnableWWWSubdomain": true
}
```
Sortie :  

```
{
    "CustomDomain": {
        "CertificateValidationRecords": [
            {
                "Name": "_70d3f50a94f7c72dc28784cf55db2f6b.example.com",
                "Status": "PENDING_VALIDATION",
                "Type": "CNAME",
                "Value": "_1270c137383c6307b6832db02504c4b0.bsgbmzkfwj.acm-validations.aws."
            },
            {
                "Name": "_287870d3f50a94f7c72dc4cf55db2f6b.www.example.com",
                "Status": "PENDING_VALIDATION",
                "Type": "CNAME",
                "Value": "_832db01270c137383c6307b62504c4b0.mzkbsgbfwj.acm-validations.aws."
            }
        ],
        "DomainName": "example.com",
        "EnableWWWSubdomain": true,
        "Status": "CREATING"
    },
    "DNSTarget": "psbqam834h.us-east-1.awsapprunner.com",
    "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa"
}
```
+  Pour plus de détails sur l'API, reportez-vous [AssociateCustomDomain](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/apprunner/associate-custom-domain.html)à la section *Référence des AWS CLI commandes*. 

### `create-auto-scaling-configuration`
<a name="apprunner_CreateAutoScalingConfiguration_cli_topic"></a>

L'exemple de code suivant montre comment utiliser`create-auto-scaling-configuration`.

**AWS CLI**  
**Pour créer une configuration autoscaling à haute disponibilité**  
L’exemple `create-auto-scaling-configuration` suivant crée une configuration autoscaling optimisée pour une haute disponibilité en définissant la valeur `MinSize` sur 5. Avec cette configuration, App Runner tente de répartir vos instances de service sur le plus grand nombre possible de zones de disponibilité, jusqu'à cinq, selon la AWS région.  
L’appel renvoie un objet `AutoScalingConfiguration` dont les autres paramètres sont définis par défaut. Dans l’exemple, il s’agit du premier appel pour créer une configuration nommée `high-availability`. La révision est définie sur 1 et il s’agit de la dernière révision.  

```
aws apprunner create-auto-scaling-configuration \
    --cli-input-json file://input.json
```
Contenu de `input.json` :  

```
{
    "AutoScalingConfigurationName": "high-availability",
    "MinSize": 5
}
```
Sortie :  

```
{
    "AutoScalingConfiguration": {
        "AutoScalingConfigurationArn": "arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/high-availability/1/2f50e7656d7819fead0f59672e68042e",
        "AutoScalingConfigurationName": "high-availability",
        "AutoScalingConfigurationRevision": 1,
        "CreatedAt": "2020-11-03T00:29:17Z",
        "Latest": true,
        "Status": "ACTIVE",
        "MaxConcurrency": 100,
        "MaxSize": 50,
        "MinSize": 5
    }
}
```
+  Pour plus de détails sur l'API, reportez-vous [CreateAutoScalingConfiguration](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/apprunner/create-auto-scaling-configuration.html)à la section *Référence des AWS CLI commandes*. 

### `create-connection`
<a name="apprunner_CreateConnection_cli_topic"></a>

L'exemple de code suivant montre comment utiliser`create-connection`.

**AWS CLI**  
**Pour créer une GitHub connexion**  
L'`create-connection`exemple suivant crée une connexion à un référentiel de GitHub code privé. Le statut de la connexion après un appel réussi est `PENDING_HANDSHAKE`. Cela est dû au fait qu’aucun établissement d’une liaison d’authentification avec le fournisseur n’a eu lieu pour le moment. Terminez l’établissement d’une liaison à l’aide de la console App Runner.  

```
aws apprunner create-connection \
    --cli-input-json file://input.json
```
Contenu de `input.json` :  

```
{
    "ConnectionName": "my-github-connection",
    "ProviderType": "GITHUB"
}
```
Sortie :  

```
{
    "Connection": {
        "ConnectionArn": "arn:aws:apprunner:us-east-1:123456789012:connection/my-github-connection",
        "ConnectionName": "my-github-connection",
        "Status": "PENDING_HANDSHAKE",
        "CreatedAt": "2020-11-03T00:32:51Z",
        "ProviderType": "GITHUB"
    }
}
```
Pour plus d’informations, consultez [Gestion des connexions App Runner](https://docs.aws.amazon.com/apprunner/latest/dg/manage-connections.html) dans le *Guide du développeur AWS App Runner*.  
+  Pour plus de détails sur l'API, reportez-vous [CreateConnection](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/apprunner/create-connection.html)à la section *Référence des AWS CLI commandes*. 

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

L'exemple de code suivant montre comment utiliser`create-service`.

**AWS CLI**  
**Exemple 1 : pour créer un service de référentiel de code source**  
L’exemple `create-service` suivant crée un service App Runner basé sur un référentiel de code source Python.  

```
aws apprunner create-service \
    --cli-input-json file://input.json
```
Contenu de `input.json` :  

```
{
    "ServiceName": "python-app",
    "SourceConfiguration": {
        "AuthenticationConfiguration": {
            "ConnectionArn": "arn:aws:apprunner:us-east-1:123456789012:connection/my-github-connection/e7656250f67242d7819feade6800f59e"
        },
        "AutoDeploymentsEnabled": true,
        "CodeRepository": {
            "RepositoryUrl": "https://github.com/my-account/python-hello",
            "SourceCodeVersion": {
                "Type": "BRANCH",
                "Value": "main"
            },
            "CodeConfiguration": {
                "ConfigurationSource": "API",
                "CodeConfigurationValues": {
                    "Runtime": "PYTHON_3",
                    "BuildCommand": "pip install -r requirements.txt",
                    "StartCommand": "python server.py",
                    "Port": "8080",
                    "RuntimeEnvironmentVariables": [
                        {
                            "NAME": "Jane"
                        }
                    ]
                }
            }
        }
    },
    "InstanceConfiguration": {
        "CPU": "1 vCPU",
        "Memory": "3 GB"
    }
}
```
Sortie :  

```
{
    "OperationId": "17fe9f55-7e91-4097-b243-fcabbb69a4cf",
    "Service": {
        "CreatedAt": "2020-11-20T19:05:25Z",
        "UpdatedAt": "2020-11-20T19:05:25Z",
        "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa",
        "ServiceId": "8fe1e10304f84fd2b0df550fe98a71fa",
        "ServiceName": "python-app",
        "ServiceUrl": "psbqam834h.us-east-1.awsapprunner.com",
        "SourceConfiguration": {
            "AuthenticationConfiguration": {
                "ConnectionArn": "arn:aws:apprunner:us-east-1:123456789012:connection/my-github-connection/e7656250f67242d7819feade6800f59e"
            },
            "AutoDeploymentsEnabled": true,
            "CodeRepository": {
                "CodeConfiguration": {
                    "CodeConfigurationValues": {
                        "BuildCommand": "pip install -r requirements.txt",
                        "Port": "8080",
                        "Runtime": "PYTHON_3",
                        "RuntimeEnvironmentVariables": [
                            {
                                "NAME": "Jane"
                            }
                        ],
                        "StartCommand": "python server.py"
                    },
                    "ConfigurationSource": "Api"
                },
                "RepositoryUrl": "https://github.com/my-account/python-hello",
                "SourceCodeVersion": {
                    "Type": "BRANCH",
                    "Value": "main"
                }
            }
        },
        "Status": "OPERATION_IN_PROGRESS",
        "InstanceConfiguration": {
            "CPU": "1 vCPU",
            "Memory": "3 GB"
        }
    }
}
```
**Exemple 2 : pour créer un service de référentiel de code source**  
L’exemple `create-service` suivant crée un service App Runner basé sur un référentiel de code source Python.  

```
aws apprunner create-service \
    --cli-input-json file://input.json
```
Contenu de `input.json` :  

```
{
    "ServiceName": "python-app",
    "SourceConfiguration": {
        "AuthenticationConfiguration": {
            "ConnectionArn": "arn:aws:apprunner:us-east-1:123456789012:connection/my-github-connection/e7656250f67242d7819feade6800f59e"
        },
        "AutoDeploymentsEnabled": true,
        "CodeRepository": {
            "RepositoryUrl": "https://github.com/my-account/python-hello",
            "SourceCodeVersion": {
                "Type": "BRANCH",
                "Value": "main"
            },
            "CodeConfiguration": {
                "ConfigurationSource": "API",
                "CodeConfigurationValues": {
                    "Runtime": "PYTHON_3",
                    "BuildCommand": "pip install -r requirements.txt",
                    "StartCommand": "python server.py",
                    "Port": "8080",
                    "RuntimeEnvironmentVariables": [
                        {
                            "NAME": "Jane"
                        }
                    ]
                }
            }
        }
    },
    "InstanceConfiguration": {
        "CPU": "1 vCPU",
        "Memory": "3 GB"
    }
}
```
Sortie :  

```
{
    "OperationId": "17fe9f55-7e91-4097-b243-fcabbb69a4cf",
    "Service": {
        "CreatedAt": "2020-11-20T19:05:25Z",
        "UpdatedAt": "2020-11-20T19:05:25Z",
        "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa",
        "ServiceId": "8fe1e10304f84fd2b0df550fe98a71fa",
        "ServiceName": "python-app",
        "ServiceUrl": "psbqam834h.us-east-1.awsapprunner.com",
        "SourceConfiguration": {
            "AuthenticationConfiguration": {
                "ConnectionArn": "arn:aws:apprunner:us-east-1:123456789012:connection/my-github-connection/e7656250f67242d7819feade6800f59e"
            },
            "AutoDeploymentsEnabled": true,
            "CodeRepository": {
                "CodeConfiguration": {
                    "CodeConfigurationValues": {
                        "BuildCommand": "pip install -r requirements.txt",
                        "Port": "8080",
                        "Runtime": "PYTHON_3",
                        "RuntimeEnvironmentVariables": [
                            {
                                "NAME": "Jane"
                            }
                        ],
                        "StartCommand": "python server.py"
                    },
                    "ConfigurationSource": "Api"
                },
                "RepositoryUrl": "https://github.com/my-account/python-hello",
                "SourceCodeVersion": {
                    "Type": "BRANCH",
                    "Value": "main"
                }
            }
        },
        "Status": "OPERATION_IN_PROGRESS",
        "InstanceConfiguration": {
            "CPU": "1 vCPU",
            "Memory": "3 GB"
        }
    }
}
```
**Exemple 3 : pour créer un service de référentiel d’images source**  
L’exemple `create-service` suivant crée un service App Runner basé sur une image stockée dans Elastic Container Registry (ECR).  

```
aws apprunner create-service \
    --cli-input-json file://input.json
```
Contenu de `input.json` :  

```
{
    "ServiceName": "golang-container-app",
    "SourceConfiguration": {
        "AuthenticationConfiguration": {
            "AccessRoleArn": "arn:aws:iam::123456789012:role/my-ecr-role"
        },
        "AutoDeploymentsEnabled": true,
        "ImageRepository": {
            "ImageIdentifier": "123456789012.dkr.ecr.us-east-1.amazonaws.com/golang-app:latest",
            "ImageConfiguration": {
                "Port": "8080",
                "RuntimeEnvironmentVariables": [
                    {
                        "NAME": "Jane"
                    }
                ]
            },
            "ImageRepositoryType": "ECR"
        }
    },
    "InstanceConfiguration": {
        "CPU": "1 vCPU",
        "Memory": "3 GB"
    }
}
```
Sortie :  

```
{
    "OperationId": "17fe9f55-7e91-4097-b243-fcabbb69a4cf",
    "Service": {
        "CreatedAt": "2020-11-06T23:15:30Z",
        "UpdatedAt": "2020-11-06T23:15:30Z",
        "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/golang-container-app/51728f8a20ce46d39b25398a6c8e9d1a",
        "ServiceId": "51728f8a20ce46d39b25398a6c8e9d1a",
        "ServiceName": "golang-container-app",
        "ServiceUrl": "psbqam834h.us-east-1.awsapprunner.com",
        "SourceConfiguration": {
            "AuthenticationConfiguration": {
                "AccessRoleArn": "arn:aws:iam::123456789012:role/my-ecr-role"
            },
            "AutoDeploymentsEnabled": true,
            "ImageRepository": {
                "ImageIdentifier": "123456789012.dkr.ecr.us-east-1.amazonaws.com/golang-app:latest",
                "ImageConfiguration": {
                    "Port": "8080",
                    "RuntimeEnvironmentVariables": [
                        {
                            "NAME": "Jane"
                        }
                    ]
                },
                "ImageRepositoryType": "ECR"
            }
        },
        "Status": "OPERATION_IN_PROGRESS",
        "InstanceConfiguration": {
            "CPU": "1 vCPU",
            "Memory": "3 GB"
        }
    }
}
```
+  Pour plus de détails sur l'API, reportez-vous [CreateService](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/apprunner/create-service.html)à la section *Référence des AWS CLI commandes*. 

### `delete-auto-scaling-configuration`
<a name="apprunner_DeleteAutoScalingConfiguration_cli_topic"></a>

L'exemple de code suivant montre comment utiliser`delete-auto-scaling-configuration`.

**AWS CLI**  
**Exemple 1 : pour supprimer la dernière révision active d’une configuration autoscaling**  
L’exemple `delete-auto-scaling-configuration` suivant supprime la dernière révision active d’une configuration autoscaling d’App Runner. Pour supprimer la dernière révision active, spécifiez un Amazon Resource Name (ARN) qui se termine par le nom de la configuration, sans le composant de révision.  
Dans l’exemple, deux révisions existent avant cette action. Par conséquent, la révision 2 (la plus récente) est supprimée. Cependant, vous voyez désormais `"Latest": false`, car, après avoir été supprimée, il ne s’agit plus de la dernière révision active.  

```
aws apprunner delete-auto-scaling-configuration \
    --cli-input-json file://input.json
```
Contenu de `input.json` :  

```
{
    "AutoScalingConfigurationArn": "arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/high-availability"
}
```
Sortie :  

```
{
    "AutoScalingConfiguration": {
        "AutoScalingConfigurationArn": "arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/high-availability/2/e76562f50d78042e819fead0f59672e6",
        "AutoScalingConfigurationName": "high-availability",
        "AutoScalingConfigurationRevision": 2,
        "CreatedAt": "2021-02-25T17:42:59Z",
        "DeletedAt": "2021-03-02T08:07:06Z",
        "Latest": false,
        "Status": "INACTIVE",
        "MaxConcurrency": 30,
        "MaxSize": 90,
        "MinSize": 5
    }
}
```
**Exemple 2 : pour supprimer une révision spécifique d’une configuration autoscaling**  
L’exemple `delete-auto-scaling-configuration` suivant supprime une révision spécifique d’une configuration autoscaling d’App Runner. Pour supprimer une révision spécifique, indiquez un ARN qui inclut le numéro de révision.  
Dans l’exemple, plusieurs révisions existent avant cette action. L’action supprime la révision `1`.  

```
aws apprunner delete-auto-scaling-configuration \
    --cli-input-json file://input.json
```
Contenu de `input.json` :  

```
{
    "AutoScalingConfigurationArn": "arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/high-availability/1"
}
```
Sortie :  

```
{
    "AutoScalingConfiguration": {
        "AutoScalingConfigurationArn": "arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/high-availability/1/2f50e7656d7819fead0f59672e68042e",
        "AutoScalingConfigurationName": "high-availability",
        "AutoScalingConfigurationRevision": 1,
        "CreatedAt": "2020-11-03T00:29:17Z",
        "DeletedAt": "2021-03-02T08:07:06Z",
        "Latest": false,
        "Status": "INACTIVE",
        "MaxConcurrency": 100,
        "MaxSize": 50,
        "MinSize": 5
    }
}
```
+  Pour plus de détails sur l'API, reportez-vous [DeleteAutoScalingConfiguration](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/apprunner/delete-auto-scaling-configuration.html)à la section *Référence des AWS CLI commandes*. 

### `delete-connection`
<a name="apprunner_DeleteConnection_cli_topic"></a>

L'exemple de code suivant montre comment utiliser`delete-connection`.

**AWS CLI**  
**Pour supprimer une connexion**  
L’exemple `delete-connection` suivant supprime une connexion App Runner. Le statut de la connexion après un appel réussi est `DELETED`. Cela est dû au fait que la connexion n’est plus disponible.  

```
aws apprunner delete-connection \
    --cli-input-json file://input.json
```
Contenu de `input.json` :  

```
{
    "ConnectionArn": "arn:aws:apprunner:us-east-1:123456789012:connection/my-github-connection"
}
```
Sortie :  

```
{
    "Connection": {
        "ConnectionArn": "arn:aws:apprunner:us-east-1:123456789012:connection/my-github-connection",
        "ConnectionName": "my-github-connection",
        "Status": "DELETED",
        "CreatedAt": "2020-11-03T00:32:51Z",
        "ProviderType": "GITHUB"
    }
}
```
+  Pour plus de détails sur l'API, reportez-vous [DeleteConnection](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/apprunner/delete-connection.html)à la section *Référence des AWS CLI commandes*. 

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

L'exemple de code suivant montre comment utiliser`delete-service`.

**AWS CLI**  
**Pour supprimer un service**  
L’exemple `delete-service` suivant supprime un service App Runner.  

```
aws apprunner delete-service \
    --cli-input-json file://input.json
```
Contenu de `input.json` :  

```
{
    "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa"
}
```
Sortie :  

```
{
    "OperationId": "17fe9f55-7e91-4097-b243-fcabbb69a4cf",
    "Service": {
        "CreatedAt": "2020-11-20T19:05:25Z",
        "UpdatedAt": "2020-11-20T19:05:25Z",
        "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa",
        "ServiceId": "8fe1e10304f84fd2b0df550fe98a71fa",
        "ServiceName": "python-app",
        "ServiceUrl": "psbqam834h.us-east-1.awsapprunner.com",
        "SourceConfiguration": {
            "AuthenticationConfiguration": {
                "ConnectionArn": "arn:aws:apprunner:us-east-1:123456789012:connection/my-github-connection/e7656250f67242d7819feade6800f59e"
            },
            "AutoDeploymentsEnabled": true,
            "CodeRepository": {
                "CodeConfiguration": {
                    "CodeConfigurationValues": {
                        "BuildCommand": "pip install -r requirements.txt",
                        "Port": "8080",
                        "Runtime": "PYTHON_3",
                        "RuntimeEnvironmentVariables": [
                            {
                                "NAME": "Jane"
                            }
                        ],
                        "StartCommand": "python server.py"
                    },
                    "ConfigurationSource": "Api"
                },
                "RepositoryUrl": "https://github.com/my-account/python-hello",
                "SourceCodeVersion": {
                    "Type": "BRANCH",
                    "Value": "main"
                }
            }
        },
        "Status": "OPERATION_IN_PROGRESS",
        "InstanceConfiguration": {
            "CPU": "1 vCPU",
            "Memory": "3 GB"
        }
    }
}
```
+  Pour plus de détails sur l'API, reportez-vous [DeleteService](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/apprunner/delete-service.html)à la section *Référence des AWS CLI commandes*. 

### `describe-auto-scaling-configuration`
<a name="apprunner_DescribeAutoScalingConfiguration_cli_topic"></a>

L'exemple de code suivant montre comment utiliser`describe-auto-scaling-configuration`.

**AWS CLI**  
**Exemple 1 : pour décrire la dernière révision active d’une configuration autoscaling**  
L’exemple `describe-auto-scaling-configuration` suivant obtient une description de la dernière révision active d’une configuration autoscaling d’App Runner. Pour décrire la dernière révision active, spécifiez un ARN qui se termine par le nom de la configuration, sans le composant de révision.  
Dans l’exemple, deux révisions existent. Par conséquent, la révision `2` (la plus récente) est décrite. L’objet obtenu affiche `"Latest": true`.  

```
aws apprunner describe-auto-scaling-configuration \
    --cli-input-json file://input.json
```
Contenu de `input.json` :  

```
{
    "AutoScalingConfigurationArn": "arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/high-availability"
}
```
Sortie :  

```
{
    "AutoScalingConfiguration": {
        "AutoScalingConfigurationArn": "arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/high-availability/2/e76562f50d78042e819fead0f59672e6",
        "AutoScalingConfigurationName": "high-availability",
        "AutoScalingConfigurationRevision": 2,
        "CreatedAt": "2021-02-25T17:42:59Z",
        "Latest": true,
        "Status": "ACTIVE",
        "MaxConcurrency": 30,
        "MaxSize": 90,
        "MinSize": 5
    }
}
```
**Exemple 2 : pour décrire une révision spécifique d’une configuration autoscaling**  
L’exemple `describe-auto-scaling-configuration` suivant obtient une description d’une révision spécifique d’une configuration autoscaling d’App Runner. Pour décrire une révision spécifique, spécifiez un ARN qui inclut le numéro de révision.  
Dans l’exemple, plusieurs révisions existent et la révision `1` est interrogée. L’objet obtenu affiche `"Latest": false`.  

```
aws apprunner describe-auto-scaling-configuration \
    --cli-input-json file://input.json
```
Contenu de `input.json` :  

```
{
    "AutoScalingConfigurationArn": "arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/high-availability/1"
}
```
Sortie :  

```
{
    "AutoScalingConfiguration": {
        "AutoScalingConfigurationArn": "arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/high-availability/1/2f50e7656d7819fead0f59672e68042e",
        "AutoScalingConfigurationName": "high-availability",
        "AutoScalingConfigurationRevision": 1,
        "CreatedAt": "2020-11-03T00:29:17Z",
        "Latest": false,
        "Status": "ACTIVE",
        "MaxConcurrency": 100,
        "MaxSize": 50,
        "MinSize": 5
    }
}
```
+  Pour plus de détails sur l'API, reportez-vous [DescribeAutoScalingConfiguration](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/apprunner/describe-auto-scaling-configuration.html)à la section *Référence des AWS CLI commandes*. 

### `describe-custom-domains`
<a name="apprunner_DescribeCustomDomains_cli_topic"></a>

L'exemple de code suivant montre comment utiliser`describe-custom-domains`.

**AWS CLI**  
**Pour obtenir des descriptions de noms de domaine personnalisés associés à un service**  
L’exemple `describe-custom-domains` suivant obtient des descriptions et statuts des noms de domaine personnalisés associés à un service App Runner.  

```
aws apprunner describe-custom-domains \
    --cli-input-json file://input.json
```
Contenu de `input.json` :  

```
{
    "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa",
    "DomainName": "example.com",
    "EnableWWWSubdomain": true
}
```
Sortie :  

```
{
    "CustomDomains": [
        {
            "CertificateValidationRecords": [
                {
                    "Name": "_70d3f50a94f7c72dc28784cf55db2f6b.example.com",
                    "Status": "PENDING_VALIDATION",
                    "Type": "CNAME",
                    "Value": "_1270c137383c6307b6832db02504c4b0.bsgbmzkfwj.acm-validations.aws."
                },
                {
                    "Name": "_287870d3f50a94f7c72dc4cf55db2f6b.www.example.com",
                    "Status": "PENDING_VALIDATION",
                    "Type": "CNAME",
                    "Value": "_832db01270c137383c6307b62504c4b0.mzkbsgbfwj.acm-validations.aws."
                }
            ],
            "DomainName": "example.com",
            "EnableWWWSubdomain": true,
            "Status": "PENDING_CERTIFICATE_DNS_VALIDATION"
        },
        {
            "CertificateValidationRecords": [
                {
                    "Name": "_a94f784c70d3f507c72dc28f55db2f6b.deals.example.com",
                    "Status": "SUCCESS",
                    "Type": "CNAME",
                    "Value": "_2db02504c1270c137383c6307b6834b0.bsgbmzkfwj.acm-validations.aws."
                }
            ],
            "DomainName": "deals.example.com",
            "EnableWWWSubdomain": false,
            "Status": "ACTIVE"
        }
    ],
    "DNSTarget": "psbqam834h.us-east-1.awsapprunner.com",
    "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa"
}
```
+  Pour plus de détails sur l'API, reportez-vous [DescribeCustomDomains](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/apprunner/describe-custom-domains.html)à la section *Référence des AWS CLI commandes*. 

### `describe-service`
<a name="apprunner_DescribeService_cli_topic"></a>

L'exemple de code suivant montre comment utiliser`describe-service`.

**AWS CLI**  
**Pour décrire un service**  
L’exemple `describe-service` suivant obtient une description d’un service App Runner.  

```
aws apprunner describe-service \
    --cli-input-json file://input.json
```
Contenu de `input.json` :  

```
{
    "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa"
}
```
Sortie :  

```
{
    "Service": {
        "CreatedAt": "2020-11-20T19:05:25Z",
        "UpdatedAt": "2020-11-20T19:05:25Z",
        "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa",
        "ServiceId": "8fe1e10304f84fd2b0df550fe98a71fa",
        "ServiceName": "python-app",
        "ServiceUrl": "psbqam834h.us-east-1.awsapprunner.com",
        "SourceConfiguration": {
            "AuthenticationConfiguration": {
                "ConnectionArn": "arn:aws:apprunner:us-east-1:123456789012:connection/my-github-connection/e7656250f67242d7819feade6800f59e"
            },
            "AutoDeploymentsEnabled": true,
            "CodeRepository": {
                "CodeConfiguration": {
                    "CodeConfigurationValues": {
                        "BuildCommand": "pip install -r requirements.txt",
                        "Port": "8080",
                        "Runtime": "PYTHON_3",
                        "RuntimeEnvironmentVariables": [
                            {
                                "NAME": "Jane"
                            }
                        ],
                        "StartCommand": "python server.py"
                    },
                    "ConfigurationSource": "Api"
                },
                "RepositoryUrl": "https://github.com/my-account/python-hello",
                "SourceCodeVersion": {
                    "Type": "BRANCH",
                    "Value": "main"
                }
            }
        },
        "Status": "RUNNING",
        "InstanceConfiguration": {
            "CPU": "1 vCPU",
            "Memory": "3 GB"
        }
    }
}
```
+  Pour plus de détails sur l'API, reportez-vous [DescribeService](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/apprunner/describe-service.html)à la section *Référence des AWS CLI commandes*. 

### `disassociate-custom-domain`
<a name="apprunner_DisassociateCustomDomain_cli_topic"></a>

L'exemple de code suivant montre comment utiliser`disassociate-custom-domain`.

**AWS CLI**  
**Pour dissocier un nom de domaine d’un service**  
L’exemple `disassociate-custom-domain` suivant dissocie le domaine `example.com` d’un service App Runner. L’appel dissocie également le sous-domaine `www.example.com` qui était associé au domaine racine.  

```
aws apprunner disassociate-custom-domain \
    --cli-input-json file://input.json
```
Contenu de `input.json` :  

```
{
    "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa",
    "DomainName": "example.com"
}
```
Sortie :  

```
{
    "CustomDomain": {
        "CertificateValidationRecords": [
            {
                "Name": "_70d3f50a94f7c72dc28784cf55db2f6b.example.com",
                "Status": "PENDING_VALIDATION",
                "Type": "CNAME",
                "Value": "_1270c137383c6307b6832db02504c4b0.bsgbmzkfwj.acm-validations.aws."
            },
            {
                "Name": "_287870d3f50a94f7c72dc4cf55db2f6b.www.example.com",
                "Status": "PENDING_VALIDATION",
                "Type": "CNAME",
                "Value": "_832db01270c137383c6307b62504c4b0.mzkbsgbfwj.acm-validations.aws."
            }
        ],
        "DomainName": "example.com",
        "EnableWWWSubdomain": true,
        "Status": "DELETING"
    },
    "DNSTarget": "psbqam834h.us-east-1.awsapprunner.com",
    "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa"
}
```
+  Pour plus de détails sur l'API, reportez-vous [DisassociateCustomDomain](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/apprunner/disassociate-custom-domain.html)à la section *Référence des AWS CLI commandes*. 

### `list-auto-scaling-configurations`
<a name="apprunner_ListAutoScalingConfigurations_cli_topic"></a>

L'exemple de code suivant montre comment utiliser`list-auto-scaling-configurations`.

**AWS CLI**  
**Pour obtenir une liste paginée des configurations autoscaling d’App Runner**  
L'`list-auto-scaling-configurations`exemple suivant répertorie toutes les configurations de mise à l'échelle automatique d'App Runner de votre AWS compte. Jusqu’à cinq configurations autoscaling sont répertoriées dans chaque réponse. `AutoScalingConfigurationName` et `LatestOnly` ne sont pas spécifiés. Leurs valeurs par défaut répertorient la dernière révision de toutes les configurations actives.  
Dans cet exemple, la réponse inclut seulement deux résultats. Aucun résultat `NextToken` n’est donc renvoyé.  

```
aws apprunner list-auto-scaling-configurations \
    --cli-input-json file://input.json
```
Contenu de `input.json` :  

```
{
    "MaxResults": 5
}
```
Sortie :  

```
{
    "AutoScalingConfigurationSummaryList": [
        {
            "AutoScalingConfigurationArn": "arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/high-availability/2/e76562f50d78042e819fead0f59672e6",
            "AutoScalingConfigurationName": "high-availability",
            "AutoScalingConfigurationRevision": 2
        },
        {
            "AutoScalingConfigurationArn": "arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/low-cost/1/50d7804e7656fead0f59672e62f2e819",
            "AutoScalingConfigurationName": "low-cost",
            "AutoScalingConfigurationRevision": 1
        }
    ]
}
```
+  Pour plus de détails sur l'API, reportez-vous [ListAutoScalingConfigurations](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/apprunner/list-auto-scaling-configurations.html)à la section *Référence des AWS CLI commandes*. 

### `list-connections`
<a name="apprunner_ListConnections_cli_topic"></a>

L'exemple de code suivant montre comment utiliser`list-connections`.

**AWS CLI**  
**Exemple 1 : pour répertorier toutes les connexions**  
L'`list-connections`exemple suivant répertorie toutes les connexions App Runner du AWS compte.  

```
aws apprunner list-connections
```
Sortie :  

```
{
    "ConnectionSummaryList": [
        {
            "ConnectionArn": "arn:aws:apprunner:us-east-1:123456789012:connection/my-github-connection",
            "ConnectionName": "my-github-connection",
            "Status": "AVAILABLE",
            "CreatedAt": "2020-11-03T00:32:51Z",
            "ProviderType": "GITHUB"
        },
        {
            "ConnectionArn": "arn:aws:apprunner:us-east-1:123456789012:connection/my-github-org-connection",
            "ConnectionName": "my-github-org-connection",
            "Status": "AVAILABLE",
            "CreatedAt": "2020-11-03T02:54:17Z",
            "ProviderType": "GITHUB"
        }
    ]
}
```
**Exemple 2 : pour répertorier une connexion par nom**  
L’exemple `list-connections` suivant répertorie une connexion par son nom.  

```
aws apprunner list-connections \
    --cli-input-json file://input.json
```
Contenu de `input.json` :  

```
{
    "ConnectionName": "my-github-org-connection"
}
```
Sortie :  

```
{
    "ConnectionSummaryList": [
        {
            "ConnectionArn": "arn:aws:apprunner:us-east-1:123456789012:connection/my-github-org-connection",
            "ConnectionName": "my-github-org-connection",
            "Status": "AVAILABLE",
            "CreatedAt": "2020-11-03T02:54:17Z",
            "ProviderType": "GITHUB"
        }
    ]
}
```
+  Pour plus de détails sur l'API, reportez-vous [ListConnections](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/apprunner/list-connections.html)à la section *Référence des AWS CLI commandes*. 

### `list-operations`
<a name="apprunner_ListOperations_cli_topic"></a>

L'exemple de code suivant montre comment utiliser`list-operations`.

**AWS CLI**  
**Pour répertorier les opérations exécutées sur un service**  
L’exemple `list-operations` suivant répertorie toutes les opérations exécutées jusqu’à présent sur un service App Runner. Dans cet exemple, le service est nouveau et une seule opération de type `CREATE_SERVICE` s’est produite.  

```
aws apprunner list-operations \
    --cli-input-json file://input.json
```
Contenu de `input.json` :  

```
{
    "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa"
}
```
Sortie :  

```
{
    "OperationSummaryList": [
        {
            "EndedAt": 1606156217,
            "Id": "17fe9f55-7e91-4097-b243-fcabbb69a4cf",
            "StartedAt": 1606156014,
            "Status": "SUCCEEDED",
            "TargetArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa",
            "Type": "CREATE_SERVICE",
            "UpdatedAt": 1606156217
        }
    ]
}
```
+  Pour plus de détails sur l'API, reportez-vous [ListOperations](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/apprunner/list-operations.html)à la section *Référence des AWS CLI commandes*. 

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

L'exemple de code suivant montre comment utiliser`list-services`.

**AWS CLI**  
**Pour obtenir une liste paginée des services App Runner**  
L'`list-services`exemple suivant répertorie tous les services App Runner du AWS compte. Jusqu’à deux services sont répertoriés dans chaque réponse. Cet exemple montre la première demande. La réponse inclut deux résultats et un jeton qui peut être utilisé dans la prochaine demande. Lorsqu’une réponse ultérieure n’inclut pas de jeton, tous les services ont été répertoriés.  

```
aws apprunner list-services \
    --cli-input-json file://input.json
```
Contenu de `input.json` :  

```
{
    "MaxResults": 2
}
```
Sortie :  

```
{
    "NextToken": "eyJDdXN0b21lckFjY291bnRJZCI6IjI3MDIwNTQwMjg0NSIsIlNlcnZpY2VTdGF0dXNDb2RlIjoiUFJPVklTSU9OSU5HIiwiSGFzaEtleSI6IjI3MDIwNTQwMjg0NSNhYjhmOTRjZmUyOWE0NjBmYjg3NjBhZmQyZWU4NzU1NSJ9",
    "ServiceSummaryList": [
        {
            "CreatedAt": "2020-11-20T19:05:25Z",
            "UpdatedAt": "2020-11-23T12:41:37Z",
            "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa",
            "ServiceId": "8fe1e10304f84fd2b0df550fe98a71fa",
            "ServiceName": "python-app",
            "ServiceUrl": "psbqam834h.us-east-1.awsapprunner.com",
            "Status": "RUNNING"
        },
        {
            "CreatedAt": "2020-11-06T23:15:30Z",
            "UpdatedAt": "2020-11-23T13:21:22Z",
            "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/golang-container-app/ab8f94cfe29a460fb8760afd2ee87555",
            "ServiceId": "ab8f94cfe29a460fb8760afd2ee87555",
            "ServiceName": "golang-container-app",
            "ServiceUrl": "e2m8rrrx33.us-east-1.awsapprunner.com",
            "Status": "RUNNING"
        }
    ]
}
```
+  Pour plus de détails sur l'API, reportez-vous [ListServices](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/apprunner/list-services.html)à la section *Référence des AWS CLI commandes*. 

### `list-tags-for-resource`
<a name="apprunner_ListTagsForResource_cli_topic"></a>

L'exemple de code suivant montre comment utiliser`list-tags-for-resource`.

**AWS CLI**  
**Pour répertorier les balises associées à un service App Runner**  
L’exemple `list-tags-for-resource` suivant répertorie toutes les balises associées à un service App Runner.  

```
aws apprunner list-tags-for-resource \
    --cli-input-json file://input.json
```
Contenu de `input.json` :  

```
{
    "ResourceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa"
}
```
Sortie :  

```
{
    "Tags": [
        {
            "Key": "Department",
            "Value": "Retail"
        },
        {
            "Key": "CustomerId",
            "Value": "56439872357912"
        }
    ]
}
```
+  Pour plus de détails sur l'API, reportez-vous [ListTagsForResource](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/apprunner/list-tags-for-resource.html)à la section *Référence des AWS CLI commandes*. 

### `pause-service`
<a name="apprunner_PauseService_cli_topic"></a>

L'exemple de code suivant montre comment utiliser`pause-service`.

**AWS CLI**  
**Pour suspendre un service**  
L’exemple `pause-service` suivant suspend un service App Runner.  

```
aws apprunner pause-service \
    --cli-input-json file://input.json
```
Contenu de `input.json` :  

```
{
    "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa"
}
```
Sortie :  

```
{
    "OperationId": "17fe9f55-7e91-4097-b243-fcabbb69a4cf",
    "Service": {
        "CreatedAt": "2020-11-20T19:05:25Z",
        "UpdatedAt": "2020-11-23T12:41:37Z",
        "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa",
        "ServiceId": "8fe1e10304f84fd2b0df550fe98a71fa",
        "ServiceName": "python-app",
        "ServiceUrl": "psbqam834h.us-east-1.awsapprunner.com",
        "SourceConfiguration": {
            "AuthenticationConfiguration": {
                "ConnectionArn": "arn:aws:apprunner:us-east-1:123456789012:connection/my-github-connection/e7656250f67242d7819feade6800f59e"
            },
            "AutoDeploymentsEnabled": true,
            "CodeRepository": {
                "CodeConfiguration": {
                    "CodeConfigurationValues": {
                        "BuildCommand": "pip install -r requirements.txt",
                        "Port": "8080",
                        "Runtime": "PYTHON_3",
                        "RuntimeEnvironmentVariables": [
                            {
                                "NAME": "Jane"
                            }
                        ],
                        "StartCommand": "python server.py"
                    },
                    "ConfigurationSource": "Api"
                },
                "RepositoryUrl": "https://github.com/my-account/python-hello",
                "SourceCodeVersion": {
                    "Type": "BRANCH",
                    "Value": "main"
                }
            }
        },
        "Status": "OPERATION_IN_PROGRESS",
        "InstanceConfiguration": {
            "CPU": "1 vCPU",
            "Memory": "3 GB"
        }
    }
}
```
+  Pour plus de détails sur l'API, reportez-vous [PauseService](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/apprunner/pause-service.html)à la section *Référence des AWS CLI commandes*. 

### `resume-service`
<a name="apprunner_ResumeService_cli_topic"></a>

L'exemple de code suivant montre comment utiliser`resume-service`.

**AWS CLI**  
**Pour reprendre un service**  
L’exemple `resume-service` suivant reprend un service App Runner.  

```
aws apprunner resume-service \
    --cli-input-json file://input.json
```
Contenu de `input.json` :  

```
{
    "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa"
}
```
Sortie :  

```
{
    "OperationId": "17fe9f55-7e91-4097-b243-fcabbb69a4cf",
    "Service": {
        "CreatedAt": "2020-11-20T19:05:25Z",
        "UpdatedAt": "2020-11-23T12:41:37Z",
        "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa",
        "ServiceId": "8fe1e10304f84fd2b0df550fe98a71fa",
        "ServiceName": "python-app",
        "ServiceUrl": "psbqam834h.us-east-1.awsapprunner.com",
        "SourceConfiguration": {
            "AuthenticationConfiguration": {
                "ConnectionArn": "arn:aws:apprunner:us-east-1:123456789012:connection/my-github-connection/e7656250f67242d7819feade6800f59e"
            },
            "AutoDeploymentsEnabled": true,
            "CodeRepository": {
                "CodeConfiguration": {
                    "CodeConfigurationValues": {
                        "BuildCommand": "pip install -r requirements.txt",
                        "Port": "8080",
                        "Runtime": "PYTHON_3",
                        "RuntimeEnvironmentVariables": [
                            {
                                "NAME": "Jane"
                            }
                        ],
                        "StartCommand": "python server.py"
                    },
                    "ConfigurationSource": "Api"
                },
                "RepositoryUrl": "https://github.com/my-account/python-hello",
                "SourceCodeVersion": {
                    "Type": "BRANCH",
                    "Value": "main"
                }
            }
        },
        "Status": "OPERATION_IN_PROGRESS",
        "InstanceConfiguration": {
            "CPU": "1 vCPU",
            "Memory": "3 GB"
        }
    }
}
```
+  Pour plus de détails sur l'API, reportez-vous [ResumeService](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/apprunner/resume-service.html)à la section *Référence des AWS CLI commandes*. 

### `start-deployment`
<a name="apprunner_StartDeployment_cli_topic"></a>

L'exemple de code suivant montre comment utiliser`start-deployment`.

**AWS CLI**  
**Pour lancer un déploiement manuel**  
L’exemple `start-deployment` suivant effectue un déploiement manuel vers un service App Runner.  

```
aws apprunner start-deployment \
    --cli-input-json file://input.json
```
Contenu de `input.json` :  

```
{
    "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa"
}
```
Sortie :  

```
{
    "OperationId": "853a7d5b-fc9f-4730-831b-fd8037ab832a"
}
```
+  Pour plus de détails sur l'API, reportez-vous [StartDeployment](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/apprunner/start-deployment.html)à la section *Référence des AWS CLI commandes*. 

### `tag-resource`
<a name="apprunner_TagResource_cli_topic"></a>

L'exemple de code suivant montre comment utiliser`tag-resource`.

**AWS CLI**  
**Pour ajouter des balises à un service App Runner**  
L’exemple `tag-resource` suivant ajoute deux balises à un service App Runner.  

```
aws apprunner tag-resource \
    --cli-input-json file://input.json
```
Contenu de `input.json` :  

```
{
    "ResourceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa",
    "Tags": [
        {
            "Key": "Department",
            "Value": "Retail"
        },
        {
            "Key": "CustomerId",
            "Value": "56439872357912"
        }
    ]
}
```
Cette commande ne produit aucune sortie.  
+  Pour plus de détails sur l'API, reportez-vous [TagResource](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/apprunner/tag-resource.html)à la section *Référence des AWS CLI commandes*. 

### `untag-resource`
<a name="apprunner_UntagResource_cli_topic"></a>

L'exemple de code suivant montre comment utiliser`untag-resource`.

**AWS CLI**  
**Pour supprimer des balises d’un service App Runner**  
L’exemple `untag-resource` suivant supprime deux balises d’un service App Runner.  

```
aws apprunner untag-resource \
    --cli-input-json file://input.json
```
Contenu de `input.json` :  

```
{
    "ResourceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa",
    "TagKeys": [
        "Department",
        "CustomerId"
    ]
}
```
Cette commande ne produit aucune sortie.  
+  Pour plus de détails sur l'API, reportez-vous [UntagResource](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/apprunner/untag-resource.html)à la section *Référence des AWS CLI commandes*. 

### `update-service`
<a name="apprunner_UpdateService_cli_topic"></a>

L'exemple de code suivant montre comment utiliser`update-service`.

**AWS CLI**  
**Pour mettre à jour la taille de la mémoire**  
L’exemple `update-service` suivant met à jour la taille de mémoire des instances (unités de mise à l’échelle) d’un service App Runner à 2 048 Mio.  
Lorsque l’appel aboutit, App Runner lance un processus de mise à jour asynchrone. La structure `Service` renvoyée par l’appel reflète la nouvelle valeur de mémoire appliquée par cet appel.  

```
aws apprunner update-service \
    --cli-input-json file://input.json
```
Contenu de `input.json` :  

```
{
    "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa",
    "InstanceConfiguration": {
        "Memory": "4 GB"
    }
}
```
Sortie :  

```
{
    "OperationId": "17fe9f55-7e91-4097-b243-fcabbb69a4cf",
    "Service": {
        "CreatedAt": "2020-11-20T19:05:25Z",
        "UpdatedAt": "2020-11-23T12:41:37Z",
        "ServiceArn": "arn:aws:apprunner:us-east-1:123456789012:service/python-app/8fe1e10304f84fd2b0df550fe98a71fa",
        "ServiceId": "8fe1e10304f84fd2b0df550fe98a71fa",
        "ServiceName": "python-app",
        "ServiceUrl": "psbqam834h.us-east-1.awsapprunner.com",
        "SourceConfiguration": {
            "AuthenticationConfiguration": {
                "ConnectionArn": "arn:aws:apprunner:us-east-1:123456789012:connection/my-github-connection/e7656250f67242d7819feade6800f59e"
            },
            "AutoDeploymentsEnabled": true,
            "CodeRepository": {
                "CodeConfiguration": {
                    "CodeConfigurationValues": {
                        "BuildCommand": "pip install -r requirements.txt",
                        "Port": "8080",
                        "Runtime": "PYTHON_3",
                        "RuntimeEnvironmentVariables": [
                            {
                                "NAME": "Jane"
                            }
                        ],
                        "StartCommand": "python server.py"
                    },
                    "ConfigurationSource": "Api"
                },
                "RepositoryUrl": "https://github.com/my-account/python-hello",
                "SourceCodeVersion": {
                    "Type": "BRANCH",
                    "Value": "main"
                }
            }
        },
        "Status": "OPERATION_IN_PROGRESS",
        "InstanceConfiguration": {
            "CPU": "1 vCPU",
            "Memory": "4 GB"
        }
    }
}
```
+  Pour plus de détails sur l'API, reportez-vous [UpdateService](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/apprunner/update-service.html)à la section *Référence des AWS CLI commandes*. 