【发布时间】:2017-11-30 05:27:11
【问题描述】:
我在参数部分有这个,
Parameters:
PlatformSelect:
Description: Cockpit platform Select.
Type: String
Default: qa-1
AllowedValues: [qa-1, qa-2, staging, production]
我需要在我的 UserData 中引用这个值。我在两者之间使用映射。
Mappings:
bootstrap:
ubuntu:
print: echo ${PlatformSelect} >>test.txt
Resources:
EC2Instance:
Type: AWS::EC2::Instance
Properties:
InstanceType: !Ref ‘InstanceType’
KeyName: !Ref ‘KeyName’
Tags:
- Key: Name
Value: Test
UserData:
Fn::Base64:
Fn::Join:
- ‘’
- - |
#!/bin/bash
- Fn::FindInMap:
- bootstrap
- ubuntu
- print
- |2+
这不起作用。不知道我提到它的方式首先是错误的!
我应该在它之前使用一些东西,比如“${AWS::Parameters:PlatformSelect}”吗?
【问题讨论】:
标签: amazon-web-services amazon-ec2 amazon-cloudformation