私は、パラメータセクションの下にこれを持って、UserDataの中の参照パラメータ値
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}」のようなものを使用する必要がありますか?
ない特定の理由の組み合わせについてどう – Vineeth