Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to statically specify AWS::StackName inside a cloudformation template?

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

like image 416
RandomUser Avatar asked Aug 13 '18 18:08

RandomUser


People also ask

Which section of CloudFormation template does not allow for conditions?

According to the docs, Conditions should be used at the top level of the resource you want to conditionally create. Putting a Condition inside the Instance UserData section isn't supported. To use Conditions in your situation, you'd want separate Resources conditionally created based on the Parameter.

Which two types of syntax can be used within an AWS CloudFormation template?

You can author AWS CloudFormation templates in JSON or YAML formats. We support all AWS CloudFormation features and functions for both formats, including in AWS CloudFormation Designer.

What can an AWS CloudFormation template contain?

CloudFormation supports creating VPCs, subnets, gateways, route tables and network ACLs as well as creating resources such as elastic IPs, Amazon EC2 Instances, EC2 security groups, auto scaling groups, elastic load balancers, Amazon RDS database instances and Amazon RDS security groups in a VPC.

What is FN :: GetAtt in CloudFormation?

The Fn::GetAtt intrinsic function returns the value of an attribute from a resource in the template. For more information about GetAtt return values for a particular resource, refer to the documentation for that resource in the Resource and property reference.


1 Answers

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.

like image 52
Rafał Wrzeszcz Avatar answered Oct 07 '22 23:10

Rafał Wrzeszcz