【发布时间】:2018-09-21 03:19:21
【问题描述】:
我尝试使用以下命令启动 cfn-init:
Fn::Base64: !Sub |
#!/bin/bash
sudo apt-get -y install python-setuptools
mkdir aws-cfn-bootstrap-latest
curl https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.tar.gz | tar xz -C aws-cfn-bootstrap-latest --strip-components 1
sudo easy_install aws-cfn-bootstrap-latest
sudo /usr/local/bin/cfn-init --stack !Ref 'AWS::StackName' --resource xxx --region !Ref 'AWS::Region'
第一步有效。我可以访问该实例并安装了cfn-init。当我在我的 ec2 实例中执行 cfn-init --stack.. 命令时,当我硬编码堆栈名称和区域的值时,它工作正常。
如何使它在yaml 脚本中工作?似乎无法读取 StackName 和 region 的值。
【问题讨论】:
标签: amazon-web-services yaml amazon-cloudformation