Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅中国的 Amazon Web Services 服务入门。本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
第 5 步:部署配置
在中开始部署Amazon AppConfig调用StartDeploymentAPI 操作。该调用包括 Amazon AppConfig 应用程序、环境和配置文件的 ID 以及(可选)要部署的配置数据版本。该调用还包括要使用的部署策略的 ID,该策略确定如何部署配置数据。
Amazon AppConfig 监控分发到所有主机的过程并报告状态。如果分发失败,Amazon AppConfig 将回滚配置。
一次只能将一个配置部署到一个环境中。但是,您可以同时将一个配置部署到不同的环境中。
部署配置(控制台)
可以使用以下过程通过 Amazon Systems Manager 控制台部署 Amazon AppConfig 配置。
使用控制台部署配置
打开Amazon Systems Manager控制台https://console.aws.amazon.com/systems-manager/appconfig/.
-
在导航窗格中,请选择 Amazon AppConfig。
-
在 Applications (应用程序) 选项卡上,选择一个应用程序,然后选择 View details (查看详细信息)。
-
在 Environments (环境) 选项卡上,选择一个环境,然后选择 View details (查看详细信息)。
-
选择开始部署。
-
对于 Configuration (配置),请从列表中选择一个配置。
-
根据配置的来源,使用 Document version (文档版本) 或 Parameter version (参数版本) 列表选择要部署的版本。
-
对于 Deployment strategy (部署策略),请从列表中选择一个策略。
-
对于 Deployment description (部署描述),请输入描述。
-
在 Tags (标签) 部分中,输入一个键和可选的值。您最多可以为一个资源指定 50 个标签。
-
选择开始部署。
部署配置(命令行)
以下过程介绍如何使用Amazon CLI(在 Linux 或 Windows 上)或Amazon Tools for PowerShell部署到Amazon AppConfig配置。
逐步部署配置
安装并配置 Amazon CLI 或 Amazon Tools for PowerShell(如果尚未执行该操作)。
有关信息,请参阅安装或升级 Amazon 命令行工具。
-
运行以下命令以部署配置。
- 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 Amazon 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 Amazon 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 Amazon 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