{"id":1074,"date":"2018-02-18T17:45:51","date_gmt":"2018-02-18T17:45:51","guid":{"rendered":"http:\/\/wiki.thomasandsofia.com\/?p=1074"},"modified":"2018-03-03T22:01:53","modified_gmt":"2018-03-03T22:01:53","slug":"cloud-formation-main-menu","status":"publish","type":"post","link":"https:\/\/wiki.thomasandsofia.com\/?p=1074","title":{"rendered":"Cloud Formation &#8211; Main Menu"},"content":{"rendered":"<p><a href=\"https:\/\/docs.aws.amazon.com\/AWSCloudFormation\/latest\/UserGuide\/aws-template-resource-type-ref.html\" target=\"_blank\" rel=\"noopener\"><strong>AWS Resource Reference Link<\/strong><\/a><\/p>\n<h2>Main Menu<\/h2>\n<ul>\n<li><a href=\"#gettingstarted\">Getting Started<\/a><\/li>\n<li>Course Introduction\n<ul>\n<li><a href=\"#whatis\">What is CloudFormation<\/a><\/li>\n<li><a href=\"#benefits\">Benefits of CloudFormation<\/a><\/li>\n<li><a href=\"#code\">Code Downloads and Tools<\/a><\/li>\n<li><a href=\"#first\">First AWS CloudFormation template<\/a><\/li>\n<li><a href=\"#summary\">Summary<\/a><\/li>\n<li><a href=\"#quiz\">Quiz<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"http:\/\/wiki.thomasandsofia.com\/2018\/02\/18\/cloud-formation-first-hands-on\/\">CloudFormation First Hands-On<\/a><\/li>\n<li><a href=\"http:\/\/wiki.thomasandsofia.com\/2018\/02\/18\/cloudformation-parameters\/\">CloudFormation Parameters<\/a><\/li>\n<li><a href=\"http:\/\/wiki.thomasandsofia.com\/2018\/02\/19\/cloudformation-resources\/\">CloudFormation Resources<\/a><\/li>\n<li><a href=\"http:\/\/wiki.thomasandsofia.com\/2018\/02\/20\/cloudformation-mappings\/\" rel=\"noopener\">CloudFormation Mappings<\/a><\/li>\n<li><a href=\"http:\/\/wiki.thomasandsofia.com\/2018\/02\/20\/cloudformation-outputs\/\">CloudFormation Outputs<\/a><\/li>\n<li><a href=\"http:\/\/wiki.thomasandsofia.com\/2018\/02\/22\/cloudformation-conditions\/\">CloudFormation Conditions<\/a><\/li>\n<li><a href=\"http:\/\/wiki.thomasandsofia.com\/2018\/02\/23\/cloudformation-metadata\/\">CloudFormation Metadata<\/a><\/li>\n<li><a href=\"http:\/\/wiki.thomasandsofia.com\/2018\/02\/24\/cfn-init-and-ec2-user-data\/\">CFN Init and EC2 User Data<\/a><\/li>\n<li><a href=\"http:\/\/wiki.thomasandsofia.com\/2018\/02\/25\/cloudformation-advanced-topics\/\">CloudFormation Advanced Topics<\/a><\/li>\n<\/ul>\n<p><a name=\"gettingstarted\"><\/a><\/p>\n<h2>Getting Started<\/h2>\n<h4>How to install Atom JSON\/YAML editor in Ubuntu<\/h4>\n<pre>sudo add-apt-repository ppa:webupd8team\/atom\r\nsudo apt-get update\r\nsudo apt-get -y install atom<\/pre>\n<p><a name=\"whatis\"><\/a><\/p>\n<h2>What is CloudFormation<\/h2>\n<ul>\n<li>A declarative way of outlining your aWS Infrastructure for any resource<\/li>\n<li>Example, &#8220;I need&#8221;\n<ul>\n<li>A Security Group<\/li>\n<li>2 EC2 Instances<\/li>\n<li>2 Elastic IPs for the instances<\/li>\n<li>An S3 bucket<\/li>\n<li>An ELB<\/li>\n<\/ul>\n<\/li>\n<li>CloudFormation creates these for you, in the right order, with the exact configuration that you specify<\/li>\n<\/ul>\n<p><a name=\"benefits\"><\/a><\/p>\n<h2>Benefits of CloudFormation<\/h2>\n<ul>\n<li>Infrastructure as code\n<ul>\n<li>No manually created resources, great for control<\/li>\n<li>Code can be version controlled using GIT<\/li>\n<li>Changes are reviewed through code<\/li>\n<\/ul>\n<\/li>\n<li>Cost\n<ul>\n<li>Each resources with the stack are tagged with an identifier to easily see how much a stack costs<\/li>\n<li>You can estimate the cost of your resources using the template<\/li>\n<li>Savings: In Dev, you can automate deletion of a stack at 5:00pm and recreate safely at 8:00am<\/li>\n<\/ul>\n<\/li>\n<li>Productivity\n<ul>\n<li>Re-create and destroy infrastructure on the fly<\/li>\n<li>Automatic Diagram generation (What??? How Cool!)<\/li>\n<li>Declarative programming<\/li>\n<\/ul>\n<\/li>\n<li>Separation of concern\n<ul>\n<li>VPC stacks<\/li>\n<li>Network stacks<\/li>\n<li>App stacks<\/li>\n<\/ul>\n<\/li>\n<li>Don&#8217;t reinvent the wheel\n<ul>\n<li>Leverage existing templates\n<ul>\n<li>Tweak as required<\/li>\n<\/ul>\n<\/li>\n<li>Leverage the documentation<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><a name=\"code\"><\/a><\/p>\n<h2>Code Download and Tools<\/h2>\n<ul>\n<li><a href=\"https:\/\/support.udemy.com\/hc\/en-us\/articles\/229604708-Downloading-Supplemental-Resources\" target=\"_blank\" rel=\"noopener\">https:\/\/support.udemy.com\/hc\/en-us\/articles\/229604708-Downloading-Supplemental-Resources<\/a><\/li>\n<li><a href=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2018\/02\/code-v2.zip.txt\">code-v2.zip<\/a><\/li>\n<\/ul>\n<p><a name=\"first\"><\/a><\/p>\n<h2>Introductory Examples<\/h2>\n<p><a href=\"https:\/\/www.udemy.com\/aws-cloudformation-master-class\/learn\/v4\/t\/lecture\/8138960?start=0\" target=\"_blank\" rel=\"noopener\">https:\/\/www.udemy.com\/aws-cloudformation-master-class\/learn\/v4\/t\/lecture\/8138960?start=0<\/a><\/p>\n<ul>\n<li>Adding a new Stack\n<ul>\n<li>CloudFormation &gt; [Create a new stack]\n<ul>\n<li>Upload File<\/li>\n<li>Name Stack (Introduction)\n<ul>\n<li>Stack names cannot be edited after creation!<\/li>\n<\/ul>\n<\/li>\n<li>Add tags\n<ul>\n<li>\u00a0awe:cloudformation:logical-id<\/li>\n<li>aws:cloudformation:stack-id<\/li>\n<li>aws:cloudformation:stack-name<\/li>\n<\/ul>\n<\/li>\n<li>[Create]<\/li>\n<li>CloudFormation will provision items in the correct order.\u00a0 You do not have to plan this out.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>Changing an Existing Stack\n<ul>\n<li>Upload the file<\/li>\n<li>Edit tags<\/li>\n<li>Preview will show you the changes\n<ul>\n<li>Existing EC2 Instances that have been modified will be deleted and replaced.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>Delete a Stack\n<ul>\n<li>CloudFormation &gt; Select Stack &gt; Actions &gt; Delete Stack<\/li>\n<li>This will delete the entire stack (all services created with the script) in the correct order.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><a name=\"summary\"><\/a><\/p>\n<h2>Summary<\/h2>\n<ul>\n<li>Templates are uploaded in S3 and then referenced in CloudFormation<\/li>\n<li>You cannot edit previous templates.\u00a0 You must re-upload a new version.\n<ul>\n<li>AWS will determine what changes, does not change, needs to be added or deleted, etc., and in the correct order.<\/li>\n<\/ul>\n<\/li>\n<li>Stacks are identified by name, so use unique names<\/li>\n<li>Deleting a stack deletes every single artifact that was created by CloudFormation.<\/li>\n<\/ul>\n<p><a name=\"quiz\"><\/a><\/p>\n<h2>Quiz<\/h2>\n<ul>\n<li>Which of the following is a benefit of using CloudFormation\n<ul>\n<li>Infrastructure as Code<\/li>\n<li>Cost<\/li>\n<li>Productivity<\/li>\n<li>Separation of Concerns<\/li>\n<li>Don&#8217;t reinvent the wheel<\/li>\n<li><strong>All of the above<\/strong><\/li>\n<\/ul>\n<\/li>\n<li>When we delete a CloudFormation stack, we have to delete everything that was created by it manually.\n<ul>\n<li>Yes<\/li>\n<li><strong>No<\/strong><\/li>\n<\/ul>\n<\/li>\n<li>Stacks must have unique names\n<ul>\n<li><strong>Yes<\/strong><\/li>\n<li>No<\/li>\n<li>* All stacks are identified by name, per Region<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>AWS Resource Reference Link Main Menu Getting Started Course Introduction What is CloudFormation Benefits of CloudFormation Code Downloads and Tools First AWS CloudFormation template Summary Quiz CloudFormation First Hands-On CloudFormation Parameters CloudFormation Resources CloudFormation Mappings CloudFormation Outputs CloudFormation Conditions CloudFormation Metadata CFN Init and EC2 User Data CloudFormation Advanced Topics Getting Started How to install ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/wiki.thomasandsofia.com\/?p=1074\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18,26],"tags":[],"class_list":["post-1074","post","type-post","status-publish","format-standard","hentry","category-amazon-web-services-aws","category-cloudformation"],"_links":{"self":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/1074","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1074"}],"version-history":[{"count":21,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/1074\/revisions"}],"predecessor-version":[{"id":1235,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/1074\/revisions\/1235"}],"wp:attachment":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1074"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1074"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1074"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}