本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
建立部署策略
如果您不想使用其中一種預先定義的部署策略,您可以建立自己的部署策略。您最多可以建立 20 個部署策略。部署組態時,您可以選擇最適合應用程式和環境的部署策略。
建立 AWS AppConfig
部署策略 (主控台)
使用下列程序,使用 AWS Systems Manager 主控台建立 AWS AppConfig 部署策略。
建立部署策略
在https://console.aws.amazon.com/systems-manager/應用程序配置/打開 AWS Systems Manager 控制台。
-
在瀏覽窗格中,選擇 [部署策略],然後選擇 [建立部署策略]。
-
對於 Name (名稱),輸入部署策略的名稱。
-
對於 Description (描述),輸入有關部署策略的資訊。
-
對於 Deployment type (部署類型),請選擇類型。
-
對於 Step percentage (步驟百分比),選擇要在部署的每個步驟期間鎖定的呼叫端百分比。
-
對於 Deployment time (部署時間),輸入部署的總持續時間 (以分鐘或小時為單位)。
-
對於烘焙時間,請輸入總時間 (以分鐘或小時為單位) 以監控 Amazon CloudWatch 警示,然後再繼續部署的下一個步驟或考慮完成部署。
-
在 Tags (標籤) 區段中,輸入一個鍵和一個選用值。您可以為資源指定最多 50 個標籤。
-
選擇 Create deployment strategy (建立部署策略)。
如果您建立的組態設定檔 AWS CodePipeline,則必須在中建立指 CodePipeline 定 AWS AppConfig 為部署提供者的管線。你不需要執行部署組態。不過,您必須設定用戶端來接收應用程式組態更新,如中所述通過直接調用檢索配置 APIs。如需有關建立指定 AWS AppConfig 為部署提供者的管線的資訊,請參閱《使用指南》中的教學課程:建立用 AWS AppConfig 作部署提供AWS CodePipeline 者的管線。
繼續執行「部署組態」。
建立 AWS AppConfig 部署策略 (命令列)
下列程序說明如何使用 AWS CLI (在 Linux 或 Windows 上) 或 AWS Tools for PowerShell 建立 AWS AppConfig 部署策略。
若要逐步建立部署策略
-
開啟 AWS CLI.
-
執行下列命令以建立部署策略。
- Linux
-
aws appconfig create-deployment-strategy \
--name A_name_for_the_deployment_strategy
\
--description A_description_of_the_deployment_strategy
\
--deployment-duration-in-minutes Total_amount_of_time_for_a_deployment_to_last
\
--final-bake-time-in-minutes Amount_of_time_AWS AppConfig_monitors_for_alarms_before_considering_the_deployment_to_be_complete
\
--growth-factor The_percentage_of_targets_to_receive_a_deployed_configuration_during_each_interval
\
--growth-type The_linear_or_exponential_algorithm_used_to_define_how_percentage_grows_over_time
\
--replicate-to To_save_the_deployment_strategy_to_a_Systems_Manager_(SSM)_document
\
--tags User_defined_key_value_pair_metadata_of_the_deployment_strategy
- Windows
-
aws appconfig create-deployment-strategy ^
--name A_name_for_the_deployment_strategy
^
--description A_description_of_the_deployment_strategy
^
--deployment-duration-in-minutes Total_amount_of_time_for_a_deployment_to_last
^
--final-bake-time-in-minutes Amount_of_time_AWS AppConfig_monitors_for_alarms_before_considering_the_deployment_to_be_complete
^
--growth-factor The_percentage_of_targets_to_receive_a_deployed_configuration_during_each_interval
^
--growth-type The_linear_or_exponential_algorithm_used_to_define_how_percentage_grows_over_time
^
--name A_name_for_the_deployment_strategy
^
--replicate-to To_save_the_deployment_strategy_to_a_Systems_Manager_(SSM)_document
^
--tags User_defined_key_value_pair_metadata_of_the_deployment_strategy
- PowerShell
-
New-APPCDeploymentStrategy `
--Name A_name_for_the_deployment_strategy
`
--Description A_description_of_the_deployment_strategy
`
--DeploymentDurationInMinutes Total_amount_of_time_for_a_deployment_to_last
`
--FinalBakeTimeInMinutes Amount_of_time_AWS AppConfig_monitors_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_grows_over_time
`
--ReplicateTo To_save_the_deployment_strategy_to_a_Systems_Manager_(SSM)_document
`
--Tag Hashtable_type_User_defined_key_value_pair_metadata_of_the_deployment_strategy
系統會傳回相關資訊,如下所示。
- Linux
-
{
"Id": "Id of the deployment strategy",
"Name": "Name of the deployment strategy",
"Description": "Description of the deployment strategy",
"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 that received a deployed configuration during each interval",
"FinalBakeTimeInMinutes": "The amount of time AWS AppConfig monitored for alarms before considering the deployment to be complete",
"ReplicateTo": "The Systems Manager (SSM) document where the deployment strategy is saved"
}
- Windows
-
{
"Id": "Id of the deployment strategy",
"Name": "Name of the deployment strategy",
"Description": "Description of the deployment strategy",
"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 that received a deployed configuration during each interval",
"FinalBakeTimeInMinutes": "The amount of time AWS AppConfig monitored for alarms before considering the deployment to be complete",
"ReplicateTo": "The Systems Manager (SSM) document where the deployment strategy is saved"
}
- PowerShell
-
ContentLength : Runtime of the command
DeploymentDurationInMinutes : Total amount of time the deployment lasted
Description : Description of the deployment strategy
FinalBakeTimeInMinutes : The amount of time AWS AppConfig monitored for alarms before considering the deployment to be complete
GrowthFactor : The percentage of targets that received 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
Id : The deployment strategy ID
Name : Name of the deployment strategy
ReplicateTo : The Systems Manager (SSM) document where the deployment strategy is saved
ResponseMetadata : Runtime Metadata