【问题标题】:Get JSON template of a cloudformation stack via AWS CLI通过 AWS CLI 获取 cloudformation 堆栈的 JSON 模板
【发布时间】:2020-07-13 14:32:45
【问题描述】:

当我跑步时:

(AWS CLI)

aws --profile dev cloudformation describe-stacks --stack-name foo --output json

我明白了:


{
    "Stacks": [
        {
            "StackId": "arn:aws:cloudformation:foo_region:fooaccid:stack/foo/foo", 
            "DriftInformation": {
                "StackDriftStatus": "NOT_CHECKED"
            }, 
            "Description": "foo description", 
            "Parameters": [
                {
                    "ParameterValue": "foovalue", 
                    "ParameterKey": "fookey"
                }, 
                {
                    "ParameterValue": "foovalue2", 
                    "ParameterKey": "fookey2"
                }, 
            ], 
            "Tags": [], 
            "EnableTerminationProtection": false, 
            "CreationTime": "2020-01-07T23:58:57.747Z", 
            "Capabilities": [
                "CAPABILITY_NAMED_IAM"
            ], 
            "StackName": "fooname", 
            "NotificationARNs": [], 
            "StackStatus": "CREATE_COMPLETE", 
            "DisableRollback": false, 
            "RollbackConfiguration": {
                "RollbackTriggers": []
            }
        }
    ]
}

请注意,我没有取回堆栈的实际 JSON 模板(即堆栈的实际代码)。

有什么方法可以通过 AWS CLI 获得?

【问题讨论】:

    标签: amazon-web-services amazon-cloudformation aws-cli


    【解决方案1】:

    get-template

    aws --profile dev cloudformation get-template --stack-name foo
    

    【讨论】:

    • 感谢您的快速回答!
    猜你喜欢
    • 2022-01-16
    • 1970-01-01
    • 2019-03-23
    • 2019-03-08
    • 2021-12-29
    • 2018-06-05
    • 2014-07-11
    • 2019-08-27
    • 2020-10-25
    相关资源
    最近更新 更多