小编Jyo*_*a K的帖子

aws cloudformation 中的 cfn-signal 具有 launchConfiguration 和 AutoScalingGroup

我的 AWS Cloudformation 模板中有以下配置。

该模板创建一个基于instance1. 我在 LaunchConfiguration 中使用对同一实例的引用来创建相同类型的实例。我面临的问题是在我的 AutoScalingGroup 模板中包含 CreationPolicy 元素。当 ASG 启动实例并等待 cfn 信号时,我收到以下错误。

+ /opt/aws/bin/cfn-signal -e 0 --stack ss07 --resource Instance1 --region us-west-2
ValidationError: Resource Instance1 is in CREATE_COMPLETE state and cannot be signaled
Run Code Online (Sandbox Code Playgroud)

似乎以某种方式引用了已经存在的实例1,而不是LaunchConfig 创建的实例。我看到了嵌入 LaunchConfig 的示例,但我想将实例详细信息保留在一处而不是两处。

"instance1": {
      "Type": "AWS::EC2::Instance",
      "Metadata": {
        "AWS::CloudFormation::Init": {
          "configSets": {
            "install": ["yum_packages","install_cfn"]
          },

          "yum_packages": {
              "packages" : {
                  "yum" : {
                    "awslogs"        : [],
                    "ruby"        : [],
                    "wget"        : [],
                    "httpd"       : []
                  }
            }
          },
          "install_cfn": …
Run Code Online (Sandbox Code Playgroud)

amazon-web-services aws-cloudformation

2
推荐指数
1
解决办法
1万
查看次数