Download presentation
Presentation is loading. Please wait.
Published byRoxanne Bruce Modified over 6 years ago
1
TA Section 2017-4-1 Zhenyu Zhao
DevOps Engineer at HUIT Infrastructure Technology Services
2
Agenda CloudFormation template anatomy: built-in functions, mappings, parameters How to update a stack without deleting it Demo Building a simple infrastructure from the scratch with VPC, subnet, route table, network ACL, security group, an EC2 instance with User Data Q & A
3
How CloudFormation Works
4
How CloudFormation Change Set Works
5
JSON Components Structurally, starts with an object and key-value pairs are building block and every item is represented by a string literal {} represents an object (like a dictionary of key-value pairs) [] represents an array (a list of string values) The goal is to represent data structure relationship Syntactically, JSON is straightforward. Semantically, it is up to JSON parser to interpreter the code. CloudFormation template uses JSON to structure the code
6
CloudFormatrion Boilerplate code
See code File: boilerplate
7
Built-in functions, Mappings and Parameters
Built-in Functions that we are using here: Ref Fn::FindInMap Fn::Join Fn::Select Fn::GetAZs Fn::Base64 Reference: function-reference.html
8
Built-in functions, Mappings and Parameters
Multi-dimentional data structure Analogous to Python dictionary data structure Always use Fn::FindInMap to look up a key
9
Built-in functions, Mappings and Parameters
Dynamic and user-driven Always use Ref to return pointer to a parameter
10
Demo We are building a simple infrastructure from the scratch: A VPC
A Internet gateway A public subnet A network ACL that is attached to the public subnet A route table that is attached to the public subnet A security group An EC2 instance with User Data to set up Apache, MySQL, & PHP zhen-ta-tempate5-base => zhen-ta-tempate5-update1 => zhen-ta-tempate5-update2 => zhen-ta-tempate5-update3 => zhen-ta-tempate5-update4 => zhen-ta-tempate5-update5 => zhen-ta-tempate5-update6
11
Q & A When creating a new CloudFormation stack, how do you correctly reference existing resources (such as a VPC or subnet) in your script? (From Harry) Can you have two AWS resource of same type with same value for the Name tag? where are the files from section stored on the course site?
12
Q & A Can we get this vlcid using Parameters?Like a dropdown Explore the parameter type in AWS documentation Zhen, if “ZhenVPC” was an existing VPC in my account, would I just delete the “ZhenVPC” section you have in “Resources”?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.