In this section you will explore the CloudFormation template and learn how you were able to deploy the web application infrastructure using it
Go to the AWS CloudFormation console at https://console.aws.amazon.com/cloudformation
Alternate: You previously downloaded the CloudFormation Template staticwebapp.yaml. You can also view it in the text editor of your choice
The template is written in a format called YAML , which is commonly used for configuration files. CloudFormation templates can also be written in JSON.
Look through the template. You will notice several sections:
The Parameters section is used to prompt for inputs that can be used elsewhere in the template. The template is asking for several inputs, but also provides default values for each one.
InstanceTypeis a parameter where the user can choose that Amazon EC2 instance type to deploy for the servers used in this Web App.
!Ref!is a built-in function that refrences the value of a parameter. Here you can see it is used to provide a value to the Auto Scaling Launch Configuration, which is used to laucnh new EC2 instances.
The Conditions section is where you can setup if/then-like control of what happens during template deployment. It defines the circumstances under which entities are created or configured.
The Resources section is the “heart” of the template. It is where you define the infrastructure to be deployed. Look at the first resource defined.
DynamoDBServiceMockTable. This logical ID is how we refer to the DynamoDB table resource within the CloudFormation template.
Typewhich tells CloudFormation which type of resource to create. In this case a
Propertiesthat define the values used to create the VPC
The Outputs section is used to display selective information about resources in the stack.
!GetAttto get the DNS Name for the Application Load Balancer.
The Metadata section here is used to group and order how the CloudFormation parameters are displayed when you deploy the template using the AWS Console