Is there a way to parameterize cloud formation resource names?

回眸只為那壹抹淺笑 提交于 2019-12-20 02:48:37

问题


I'm trying to make AutoScalingGroup names on cloud formation templates dynamic. I was thinking if this is possible via parameters, or any other way?

"DynamicASGName": {
      "Type": "AWS::AutoScaling::AutoScalingGroup",
      "Properties": {
      ...properties here...
      }
    }

回答1:


CloudFormation uses two sets of names: the logical resource name, to identify a resource within the stack, and the physical name which uniquely identifies it across the whole region.

CloudFormation doesn't support setting the logical name dynamically, but with certain types, you can set the physical name in the template with the Name property. Unfortunately, AutoScalingGroup doesn't support this.

A better solution is probably to use Tags on your resources. Most AWS resource types (including AutoScalingGroup) support Tags and they can be set dynamically in a CloudFormation template.



来源:https://stackoverflow.com/questions/37854949/is-there-a-way-to-parameterize-cloud-formation-resource-names

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!