JSONパラメータファイルを送信するcloudformationテンプレートがあります。私のパラメータファイルは以前は次のようになっていたので、これは実際の問題ではありませんでした。
[
"InstanceType=t2.medium",
"AmiStack=amilookup-stack"
]
ただし、次のようなリストをパラメータファイルに追加したいと思います。
[
"InstanceType=t2.medium",
"AmiStack=amilookup-stack",
[
"CertificateArn1=arn:aws:acm:us-east-1:xxx",
"CertificateArn2=arn:aws:acm:us-east-1:xxy",
]
]
これをパラメーターjsonファイルで表現する最良の方法と、cloudformationテンプレート自体でこれを表現する方法は何ですか?enter code here
これはCloudformationの既知の問題です。パラメータタイプとしてコンマ区切りリストを使用できます。
Cloudformationテンプレート(test.json)
{
"AWSTemplateFormatVersion": "2010-09-09",
"Parameters": {
"Name": {
"Type": "String",
"Description": "SubnetGroup Name"
},
"Subnets": {
"Type": "CommaDelimitedList",
"Description": "The list of SubnetIds in your Virtual Private Cloud (VPC)"
}
},
"Resources": {
"myDBSubnetGroup": {
"Type": "AWS::RDS::DBSubnetGroup",
"Properties": {
"DBSubnetGroupDescription": "description",
"DBSubnetGroupName": {
"Ref": "Name"
},
"SubnetIds": {
"Ref": "Subnets"
}
}
}
}
}
Parameter.json
[
{
"ParameterKey": "Name",
"ParameterValue": "testName"
},
{
"ParameterKey": "Subnets",
"ParameterValue": "subnet-abcdefg,subnet-abcdef1,subnet-abcdef2"
}
]
aws cloudformation create-stack --stack-name testStack --template-body file://test.json --parameters file://parameter.json --profile yourawsprofile
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加