【发布时间】:2020-03-27 20:06:58
【问题描述】:
我是 cloudformation 和内在函数的新手。 我正在尝试使用接受 ent 类型作为参数的模板运行堆栈 使用此参数,我想命名我的 s3 存储桶。
但我收到 400 错误请求
我的模板 { "AWSTemplateFormatVersion": "2010-09-09", "Description": "使用提供的参数创建一个 S3 存储桶。", “参数”:{
"AssetInsightId": {
"Description": "Asset Insight ID",
"Type": "String",
"Default": "###"
},
"ResourceOwner": {
"Description": "tr:resource-owner",
"Type": "String",
"Default": "###"
},
"EnvironmentType": {
"Description": "tr:environment-type",
"Default": "PREPROD",
"Type": "String",
"AllowedValues": ["PREPROD", "PROD"],
"ConstraintDescription": "must specify PREPROD, PROD."
}
},
"Resources": {
"ResourceBucket": {
"Type": "AWS::S3::Bucket",
"Properties": {
"BucketName": "!Sub a${AssetInsightId}-S3Bucket-${EnvironmentType}",
"VersioningConfiguration": {
"Status": "Enabled"
},
"Tags": [
{
"Key": "tr:application-asset-insight-id",
"Value": "${AssetInsightId}"
},
{
"Key": "tr:resource-owner",
"Value": "${ResourceOwner}"
},
{
"Key": "tr:environment-type",
"Value": "${EnvironmentType}"
}
]
}
}
},
"Outputs": {
"BucketName": {
"Description": "Name of the S3 Resource Bucket",
"Value": "!Ref ResourceBucket"
}
}
}
【问题讨论】:
标签: amazon-web-services amazon-s3 amazon-cloudformation