我想使用cloudfomation运行aws-cli命令

时间:2015-09-16 09:31:31

标签: amazon-web-services

我可以使用aws-cli创建/删除一个cloudformation堆栈,但我想反向,就像使用cloudformation堆栈运行aws cli命令一样

1 个答案:

答案 0 :(得分:0)

尝试以下列方式使用任何命令:

"AWS::CloudFormation::Init" : {
    "configSets" : {
        "ascending" : [ "config1" , "config2" ],
        "descending" : [ "config2" , "config1" ]
    },
    "config1" : {
        "commands" : {
            "test" : {
                "command" : "echo \"$CFNTEST\" > test.txt",
                "env" : { "CFNTEST" : "I come from config1." },
                "cwd" : "~"
            }
        }
    },
    "config2" : {
        "commands" : {
            "test" : {
                "command" : "echo \"$CFNTEST\" > test.txt",
                "env" : { "CFNTEST" : "I come from config2" },
                "cwd" : "~"
            }
        }
    }
}