问题
Is it possible to statically specify AWS::StackName inside a cloudformation template? Or can this only be specified as a parameter when you run the template?
As far as I understand, this value can only be read via pseudo parameters, not set:
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/pseudo-parameter-reference.html#cfn-pseudo-param-stackname
回答1:
No, you can't.
Template is just a content of your stack, it doesn't set it's metainfo (like name, deployment region etc.).
Note, that you can use same template for multiple stacks, or even sub-stacks.
来源:https://stackoverflow.com/questions/51828313/is-it-possible-to-statically-specify-awsstackname-inside-a-cloudformation-temp