本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
使用 AWS CloudFormation 來部署加速組態變更
如果您想要使用 部署CustomerManagedAlarms組態設定檔 AWS CloudFormation,您可以使用下列 AWS CloudFormation 範本。將您想要的 JSON 組態放在 AMSAlarmManagerConfigurationVersion.Content 欄位中。
當您在 AWS CloudFormation 堆疊或堆疊集中部署範本時,如果您未遵循組態所需的 JSON 格式,AMSResourceTaggerDeployment資源的部署將會失敗。加速組態設定檔:監控 如需預期格式的詳細資訊,請參閱 。
如需將這些範本部署為 CloudFormation 堆疊或堆疊集的說明,請參閱下列相關的 AWS CloudFormation 文件:
注意
如果您使用其中一個範本部署組態版本,然後刪除 CloudFormation 堆疊/堆疊集,則範本組態版本會保留為目前部署的版本,而且不會進行任何額外的部署。如果您想要還原為預設組態,您將需要手動部署空白組態 (即僅 {}),或將堆疊更新為空白組態,而不是刪除堆疊。
JSON
{ "Description": "Custom configuration for the AMS Alarm Manager.", "Resources": { "AMSAlarmManagerConfigurationVersion": { "Type": "AWS::AppConfig::HostedConfigurationVersion", "Properties": { "ApplicationId": { "Fn::ImportValue": "AMS-Alarm-Manager-Configuration-ApplicationId" }, "ConfigurationProfileId": { "Fn::ImportValue": "AMS-Alarm-Manager-Configuration-CustomerManagedAlarms-ProfileID" }, "Content": "{}", "ContentType": "application/json" } }, "AMSAlarmManagerDeployment": { "Type": "AWS::AppConfig::Deployment", "Properties": { "ApplicationId": { "Fn::ImportValue": "AMS-Alarm-Manager-Configuration-ApplicationId" }, "ConfigurationProfileId": { "Fn::ImportValue": "AMS-Alarm-Manager-Configuration-CustomerManagedAlarms-ProfileID" }, "ConfigurationVersion": { "Ref": "AMSAlarmManagerConfigurationVersion" }, "DeploymentStrategyId": { "Fn::ImportValue": "AMS-Alarm-Manager-Configuration-Deployment-StrategyID" }, "EnvironmentId": { "Fn::ImportValue": "AMS-Alarm-Manager-Configuration-EnvironmentId" } } } } }
YAML
Description: Custom configuration for the AMS Alarm Manager. Resources: AMSAlarmManagerConfigurationVersion: Type: AWS::AppConfig::HostedConfigurationVersion Properties: ApplicationId: !ImportValue AMS-Alarm-Manager-Configuration-ApplicationId ConfigurationProfileId: !ImportValue AMS-Alarm-Manager-Configuration-CustomerManagedAlarms-ProfileID Content: | { } ContentType: application/json AMSAlarmManagerDeployment: Type: AWS::AppConfig::Deployment Properties: ApplicationId: !ImportValue AMS-Alarm-Manager-Configuration-ApplicationId ConfigurationProfileId: !ImportValue AMS-Alarm-Manager-Configuration-CustomerManagedAlarms-ProfileID ConfigurationVersion: !Ref AMSAlarmManagerConfigurationVersion DeploymentStrategyId: !ImportValue AMS-Alarm-Manager-Configuration-Deployment-StrategyID EnvironmentId: !ImportValue AMS-Alarm-Manager-Configuration-EnvironmentId