Création d'environnements pour votre application dans AWS AppConfig - AWS AppConfig

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.

Création d'environnements pour votre application dans AWS AppConfig

Pour chaque AWS AppConfig application, vous définissez un ou plusieurs environnements. Un environnement est un groupe de déploiement logique de AppConfig cibles, telles que des applications dans un Beta Production environnement, des AWS Lambda fonctions ou des conteneurs. Vous pouvez également définir des environnements pour les sous-composants de l'application, tels que WebMobile, etBack-end. Vous pouvez configurer les CloudWatch alarmes Amazon pour chaque environnement. Le système surveille les alarmes lors d'un déploiement de configuration. Si une alarme est déclenchée, le système annule la configuration.

Avant de commencer

Si vous AWS AppConfig souhaitez activer l'annulation d'une configuration en réponse à une CloudWatch alarme, vous devez configurer un rôle AWS Identity and Access Management (IAM) avec des autorisations permettant de répondre AWS AppConfig aux CloudWatch alarmes. Vous choisissez ce rôle dans la procédure suivante. Pour de plus amples informations, veuillez consulter (Recommandé) Configurer les autorisations pour la restauration automatique.

Création d'un AWS AppConfig environnement (console)

Pour créer un AWS AppConfig environnement à l'aide de la AWS Systems Manager console, procédez comme suit.

Pour créer un environnement .
  1. Ouvrez la AWS Systems Manager console à l'adresse https://console.aws.amazon.com/systems-manager/appconfig/.

  2. Dans le volet de navigation, choisissez Applications, puis le nom d'une application pour ouvrir la page de détails.

  3. Choisissez l'onglet Environnements, puis sélectionnez Créer un environnement.

  4. Pour Name (Nom), entrez un nom pour l'environnement.

  5. Pour Description, entrez les informations concernant l'environnement.

  6. (Facultatif) Dans la section Moniteurs, choisissez le champ Rôle IAM, puis choisissez un rôle IAM autorisé à faire appel cloudwatch:DescribeAlarms aux métriques que vous souhaitez surveiller pour détecter les alarmes.

  7. Dans la liste des CloudWatch alarmes, entrez dans Amazon Resource Names (ARNs) une ou plusieurs métriques à surveiller. AWS AppConfig annule le déploiement de votre configuration si l'une de ces métriques passe à un ALARM état. Pour plus d'informations sur les mesures recommandées, voir Surveillance des déploiements pour une annulation automatique

  8. (Facultatif) Dans la section Associer des extensions, choisissez une extension dans la liste. Pour de plus amples informations, veuillez consulter Comprendre les AWS AppConfig extensions.

  9. (Facultatif) Dans la section Balises, entrez une clé et une valeur facultative. Vous pouvez spécifier un maximum de 50 balises par ressource.

  10. Choisissez Create environment.

AWS AppConfig crée l'environnement, puis affiche la page des détails de l'environnement. Passez à Création d'un profil de configuration dans AWS AppConfig.

Création d'un AWS AppConfig environnement (ligne de commande)

La procédure suivante décrit comment utiliser AWS CLI (sous Linux ou Windows) ou comment Outils AWS pour PowerShell créer un AWS AppConfig environnement.

Pour créer un environnement étape par étape
  1. Ouvrez le AWS CLI.

  2. Exécutez la commande suivante pour créer un environnement.

    Linux
    aws appconfig create-environment \ --application-id The_application_ID \ --name A_name_for_the_environment \ --description A_description_of_the_environment \ --monitors "AlarmArn=ARN_of_the_Amazon_CloudWatch_alarm,AlarmArnRole=ARN_of_the_IAM role_for_AWS AppConfig_to_monitor_AlarmArn" \ --tags User_defined_key_value_pair_metadata_of_the_environment
    Windows
    aws appconfig create-environment ^ --application-id The_application_ID ^ --name A_name_for_the_environment ^ --description A_description_of_the_environment ^ --monitors "AlarmArn=ARN_of_the_Amazon_CloudWatch_alarm,AlarmArnRole=ARN_of_the_IAM role_for_AWS AppConfig_to_monitor_AlarmArn" ^ --tags User_defined_key_value_pair_metadata_of_the_environment
    PowerShell
    New-APPCEnvironment ` -Name Name_for_the_environment ` -ApplicationId The_application_ID -Description Description_of_the_environment ` -Monitors @{"AlarmArn=ARN_of_the_Amazon_CloudWatch_alarm,AlarmArnRole=ARN_of_the_IAM role_for_AWS AppConfig_to_monitor_AlarmArn"} ` -Tag Hashtable_type_user_defined_key_value_pair_metadata_of_the_environment

    Le système retourne des informations telles que les suivantes.

    Linux
    {
       "ApplicationId": "The application ID",
       "Id": "The_environment ID",
       "Name": "Name of the environment",
       "State": "The state of the environment",
       "Description": "Description of the environment",
       
       "Monitors": [ 
          { 
             "AlarmArn": "ARN of the Amazon CloudWatch alarm",
             "AlarmRoleArn": "ARN of the IAM role for AppConfig to monitor AlarmArn"
          }
       ]  
    }
    Windows
    {
       "ApplicationId": "The application ID",
       "Id": "The environment ID",
       "Name": "Name of the environment",
       "State": "The state of the environment"
       "Description": "Description of the environment",
       
       "Monitors": [ 
          { 
             "AlarmArn": "ARN of the Amazon CloudWatch alarm",
             "AlarmRoleArn": "ARN of the IAM role for AppConfig to monitor AlarmArn"
          }
       ] 
    }
    PowerShell
    ApplicationId     : The application ID
    ContentLength     : Runtime of the command
    Description       : Description of the environment
    HttpStatusCode    : HTTP Status of the runtime
    Id                : The environment ID
    Monitors          : {ARN of the Amazon CloudWatch alarm, ARN of the IAM role for AppConfig to monitor AlarmArn}
    Name              : Name of the environment
    Response Metadata : Runtime Metadata
    State             : State of the environment

Passez à Création d'un profil de configuration dans AWS AppConfig.