部署組態 - AWS AppConfig

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

部署組態

建立使用功能旗標和自由格式組態資料所需的成品後,您可以使用 AWS Management Console AWS CLI、或 SDK 建立新部署。在中啟動部署會 AWS AppConfig 呼叫 StartDeploymentAPI 作業。此呼叫包含 AWS AppConfig 應用程式、環境、組態描述檔的 ID,以及要 (選擇性) 部署的組態資料版本。呼叫也包含要使用的部署策略 ID,這會決定組態資料如何部署。

如果您部署存放在中的密碼 AWS Secrets Manager、使用客戶受管金鑰加密的 Amazon 簡單儲存服務 (Amazon S3) 物件,或使用客戶受管金鑰加密存放在 AWS Systems Manager 參數存放區中存放的安全字串參數,則必須為KmsKeyIdentifier參數指定值。如果您的組態未加密或使用加密 AWS 受管金鑰,則不需要為KmsKeyIdentifier參數指定值。

注意

您指定的值KmsKeyIdentifier必須是客戶管理的金鑰。這不一定與您用來加密配置的密鑰相同。

使用開始部署時KmsKeyIdentifier,附加至 AWS Identity and Access Management (IAM) 主體的權限政策必須允許該kms:GenerateDataKey作業。

AWS AppConfig 監視所有主機的分發並報告狀態。如果發行版失敗,則回 AWS AppConfig 復組態。

注意

您一次只能將一個組態部署至一個環境。不過,您可以同時將一個組態分別部署到不同的環境。

部署設定 (主控台)

使用下列程序來使用 AWS Systems Manager 主控台部署 AWS AppConfig 組態。

使用主控台部署組態
  1. 請在以下位置開啟 AWS Systems Manager 主控台。 https://console.aws.amazon.com/systems-manager/appconfig/

  2. 在功能窗格中,選擇 [應用程式],然後選擇您在其中建立的應用程式為您的應用程式建立命名空間 AWS AppConfig

  3. 在 [環] 索引標籤上,填入環境的選項按鈕,然後選擇 [檢視詳細資料]。

  4. 選擇 Start deployment (啟動部署)

  5. 對於 Configuration (組態),請從清單中選擇一個組態。

  6. 根據組態的來源,使用版本清單來選擇您要部署的版本。

  7. 對於 Deployment strategy (部署策略),請從清單中選擇策略。

  8. (選擇性) 對於部署說明,請輸入說明。

  9. 對於其他加密選項,請從清單中選擇 AWS Key Management Service 金鑰。

  10. (選擇性) 在「標」區段中,選擇「新增標籤」,然後輸入金鑰和選用值。您可以為資源指定最多 50 個標籤。

  11. 選擇 Start deployment (啟動部署)

部署配置(命令行)

下列程序說明如何使用 AWS CLI (在 Linux 或 Windows 上) 或 AWS Tools for PowerShell 部署組 AWS AppConfig 態。

若要逐步部署組態
  1. 開啟 AWS CLI.

  2. 執行下列命令以部署組態。

    Linux
    aws appconfig start-deployment \ --application-id The_application_ID \ --environment-id The_environment_ID \ --deployment-strategy-id The_deployment_strategy_ID \ --configuration-profile-id The_configuration_profile_ID \ --configuration-version The_configuration_version_to_deploy \ --description A_description_of_the_deployment \ --tags User_defined_key_value_pair_metadata_of_the_deployment
    Windows
    aws appconfig start-deployment ^ --application-id The_application_ID ^ --environment-id The_environment_ID ^ --deployment-strategy-id The_deployment_strategy_ID ^ --configuration-profile-id The_configuration_profile_ID ^ --configuration-version The_configuration_version_to_deploy ^ --description A_description_of_the_deployment ^ --tags User_defined_key_value_pair_metadata_of_the_deployment
    PowerShell
    Start-APPCDeployment ` -ApplicationId The_application_ID ` -ConfigurationProfileId The_configuration_profile_ID ` -ConfigurationVersion The_configuration_version_to_deploy ` -DeploymentStrategyId The_deployment_strategy_ID ` -Description A_description_of_the_deployment ` -EnvironmentId The_environment_ID ` -Tag Hashtable_type_user_defined_key_value_pair_metadata_of_the_deployment

    系統會傳回相關資訊,如下所示。

    Linux
    {   
       "ApplicationId": "The ID of the application that was deployed",
       "EnvironmentId" : "The ID of the environment",
       "DeploymentStrategyId": "The ID of the deployment strategy that was deployed",
       "ConfigurationProfileId": "The ID of the configuration profile that was deployed",
       "DeploymentNumber": The sequence number of the deployment,
       "ConfigurationName": "The name of the configuration",
       "ConfigurationLocationUri": "Information about the source location of the configuration",
       "ConfigurationVersion": "The configuration version that was deployed",
       "Description": "The description of the deployment",
       "DeploymentDurationInMinutes": Total amount of time the deployment lasted,
       "GrowthType": "The linear or exponential algorithm used to define how percentage grew over time",
       "GrowthFactor": The percentage of targets to receive a deployed configuration during each interval,
       "FinalBakeTimeInMinutes": Time AWS AppConfig monitored for alarms before considering the deployment to be complete,
       "State": "The state of the deployment",  
    
       "EventLog": [ 
          { 
             "Description": "A description of the deployment event",
             "EventType": "The type of deployment event",
             "OccurredAt": The date and time the event occurred,
             "TriggeredBy": "The entity that triggered the deployment event"
          }
       ],
    
       "PercentageComplete": The percentage of targets for which the deployment is available,
       "StartedAt": The time the deployment started,
       "CompletedAt": The time the deployment completed   
    }
    Windows
    {
       "ApplicationId": "The ID of the application that was deployed",
       "EnvironmentId" : "The ID of the environment",
       "DeploymentStrategyId": "The ID of the deployment strategy that was deployed",
       "ConfigurationProfileId": "The ID of the configuration profile that was deployed",
       "DeploymentNumber": The sequence number of the deployment,
       "ConfigurationName": "The name of the configuration",
       "ConfigurationLocationUri": "Information about the source location of the configuration",
       "ConfigurationVersion": "The configuration version that was deployed",
       "Description": "The description of the deployment",
       "DeploymentDurationInMinutes": Total amount of time the deployment lasted,
       "GrowthType": "The linear or exponential algorithm used to define how percentage grew over time",
       "GrowthFactor": The percentage of targets to receive a deployed configuration during each interval,
       "FinalBakeTimeInMinutes": Time AWS AppConfig monitored for alarms before considering the deployment to be complete,
       "State": "The state of the deployment",  
    
       "EventLog": [ 
          { 
             "Description": "A description of the deployment event",
             "EventType": "The type of deployment event",
             "OccurredAt": The date and time the event occurred,
             "TriggeredBy": "The entity that triggered the deployment event"
          }
       ],
    
       "PercentageComplete": The percentage of targets for which the deployment is available,
       "StartedAt": The time the deployment started,
       "CompletedAt": The time the deployment completed 
    }
    PowerShell
    ApplicationId               : The ID of the application that was deployed
    CompletedAt                 : The time the deployment completed
    ConfigurationLocationUri    : Information about the source location of the configuration
    ConfigurationName           : The name of the configuration
    ConfigurationProfileId      : The ID of the configuration profile that was deployed
    ConfigurationVersion        : The configuration version that was deployed
    ContentLength               : Runtime of the deployment 
    DeploymentDurationInMinutes : Total amount of time the deployment lasted
    DeploymentNumber            : The sequence number of the deployment
    DeploymentStrategyId        : The ID of the deployment strategy that was deployed
    Description                 : The description of the deployment
    EnvironmentId               : The ID of the environment that was deployed
    EventLog                    : {Description : A description of the deployment event, EventType : The type of deployment event, OccurredAt : The date and time the event occurred,
             TriggeredBy : The entity that triggered the deployment event}
    FinalBakeTimeInMinutes      : Time AWS AppConfig monitored for alarms before considering the deployment to be complete
    GrowthFactor                : The percentage of targets to receive a deployed configuration during each interval
    GrowthType                  : The linear or exponential algorithm used to define how percentage grew over time
    HttpStatusCode              : HTTP Status of the runtime
    PercentageComplete          : The percentage of targets for which the deployment is available
    ResponseMetadata            : Runtime Metadata
    StartedAt                   : The time the deployment started
    State                       : The state of the deployment