我正在尝试使用YAML创建一个AWS CloudFormation模板。我如下添加UserPool资源。用户池名称和ID应通过参数值获取,即,如果参数paramUserPoolName的值为“ Sample”,则:
UserPoolName =示例
UserPool资源名称= SampleUserPool,即'paramUserPoolName + UserPool'的串联值
Parameters:
paramUserPoolName:
Type: String
Resources:
<I need 'paramUserPoolName + UserPool' here >:
Type: 'AWS::Cognito::UserPool'
Properties: {
"UserPoolName": paramUserPoolName
}
如何在CloudFormation模板中动态创建资源ID?
PS:
以下工作有效:
Resources:
SampleUserPool:
Type: 'AWS::Cognito::UserPool'
Properties:
UserPoolName: !Sub ${paramUserPoolName}UserPool