{"id":1081,"date":"2018-02-18T19:49:17","date_gmt":"2018-02-18T19:49:17","guid":{"rendered":"http:\/\/wiki.thomasandsofia.com\/?p=1081"},"modified":"2018-02-18T22:32:22","modified_gmt":"2018-02-18T22:32:22","slug":"cloud-formation-first-hands-on","status":"publish","type":"post","link":"https:\/\/wiki.thomasandsofia.com\/?p=1081","title":{"rendered":"Cloud Formation First Hands On"},"content":{"rendered":"<p><a href=\"https:\/\/www.udemy.com\/aws-cloudformation-master-class\/learn\/v4\/t\/lecture\/8138980?start=0\" target=\"_blank\" rel=\"noopener\">https:\/\/www.udemy.com\/aws-cloudformation-master-class\/learn\/v4\/t\/lecture\/8138980?start=0<\/a><\/p>\n<p><a href=\"http:\/\/wiki.thomasandsofia.com\/2018\/02\/18\/cloud-formation-main-menu\/\">Main Menu<\/a><\/p>\n<h2>Section Menu<\/h2>\n<ul>\n<li><a href='#yaml'>YAML Crash Course<\/a><\/li>\n<li><a href='#creating'>Creating an S3 Bucket<\/a><\/li>\n<li><a href='#updating'>Updating a Resource<\/a><\/li>\n<li><a href='#understanding'>Understanding the CloudFormation Template Options<\/a><\/li>\n<li><a href='#using'>Using the CloudFormation Designer<\/a><\/li>\n<li><a href='#building'>CloudFormation Building Blocks<\/a><\/li>\n<li><a href='#deploying'>Deploying CloudFormation Templates<\/a><\/li>\n<li><a href='#quiz'>Quiz<\/a><\/li>\n<\/ul>\n<p><a name='yaml'>&nbsp;<\/a><\/p>\n<h2>YAML Crash Course<\/h2>\n<p><a href=\"https:\/\/www.json2yaml.com\/\" target=\"_blank\" rel=\"noopener\">JSON to YAML Converter<\/a><\/p>\n<ul>\n<li>YAML and JSON both work for CF\n<ul>\n<li>JSON is horrible, YAML is awsome<\/li>\n<\/ul>\n<\/li>\n<li>Key-Value Pairs\n<ul>\n<li>Delimited by a colon &#8216;:&#8217;<\/li>\n<li>Key: Value\n<ul>\n<li>Values with colons &#8216;:&#8217; must be enclosed by quotes.\n<ul>\n<li>&#8220;AWS::S3::Bucket&#8221;<\/li>\n<\/ul>\n<\/li>\n<li>Empty sets noted with Open\/Closed curly brackets\n<ul>\n<li>Tags: {}<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>Nested objects (arrays) signified by tabs (similar to Perl)\n<ul>\n<li>bill-to:\n<ul>\n<li>last-name: Roberts<\/li>\n<li>first-name: Thomas<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>Support Arrays\n<ul>\n<li>Delimited by a minus &#8216;-&#8216; sign<\/li>\n<\/ul>\n<\/li>\n<li>Multi-line strings\n<ul>\n<li>Delimited by a pipe &#8216;|&#8217;<\/li>\n<li>Will display &#8216;as is&#8217; (auto &lt;br\/&gt;??)<\/li>\n<li>JSON does not include multi-line strings<\/li>\n<\/ul>\n<\/li>\n<li>Can include comments!\n<ul>\n<li>Delimited by the hash tag &#8216;#&#8217;<\/li>\n<li>JSON does not include comments!!<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre>{\r\n   \"course\":\"AWS Lambda\",\r\n   \"instructor\":\"Stephane Maarek\",\r\n   \"instructor-full\":{\r\n      \"first-name\":\"Stephane\",\r\n      \"last-name\":\"Maarek\",\r\n      \"awesomeness-level\":9000\r\n   },\r\n   \"sections-list\":[\r\n      \"Introduction\",\r\n      \"Deploying your first function\",\r\n      \"Learning AWS Lambda in depth\",\r\n      \"Real world examples\"\r\n   ],\r\n   \"lectures\":[\r\n      {\r\n         \"lecture-id\":1,\r\n         \"lecture-name\":\"intro\",\r\n         \"lecture-length\":\"5:03\"\r\n      },\r\n      {\r\n         \"lecture-id\":2,\r\n         \"lecture-name\":\"aws lambda\",\r\n         \"lecture-length\":\"10:47\"\r\n      }\r\n   ]\r\n}\r\n<\/pre>\n<pre>---\r\ncourse: AWS Lambda\r\ninstructor: Stephane Maarek\r\ninstructor-full:\r\n   first-name: Stephane\r\n   last-name: Maarek\r\n   awesomeness-level: 9000\r\nsections-list:\r\n-  Introduction\r\n-  Deploying your first function\r\n-  Learning AWS Lambda in depth\r\n-  Real world examples\r\nlectures:\r\n-  lecture-id: 1\r\n   lecture-name: intro\r\n   lecture-length: '5:03'\r\n-  lecture-id: 2\r\n   lecture-name: aws lambda\r\n   lecture-length: '10:47'\r\n<\/pre>\n<p><a name='creating'>&nbsp;<\/a><\/p>\n<h2>Creating an S3 Bucket<\/h2>\n<p><a href=\"https:\/\/docs.aws.amazon.com\/AWSCloudFormation\/latest\/UserGuide\/aws-properties-s3-bucket.html\" target=\"_blank\" rel=\"noopener\">https:\/\/docs.aws.amazon.com\/AWSCloudFormation\/latest\/UserGuide\/aws-properties-s3-bucket.html<\/a><\/p>\n<pre>---\r\nResources:\r\n   MyS3Bucket:\r\n      Type: \"AWS::S3::Bucket:\r\n      Properties: {}\r\n<\/pre>\n<p><a name='updating'>&nbsp;<\/a><\/p>\n<h2>Updating a Resource<\/h2>\n<p><a href=\"https:\/\/www.udemy.com\/aws-cloudformation-master-class\/learn\/v4\/t\/lecture\/8138992?start=0\" target=\"_blank\" rel=\"noopener\">https:\/\/www.udemy.com\/aws-cloudformation-master-class\/learn\/v4\/t\/lecture\/8138992?start=0<\/a><\/p>\n<ul>\n<li>Two types of updates\n<ul>\n<li>No Interruption (access controls, etc.)<\/li>\n<li>Replacement Updates (changing the name)\n<ul>\n<li>These will be noted in the AWS documentation for each value.<\/li>\n<li>Example: <a href=\"https:\/\/docs.aws.amazon.com\/AWSCloudFormation\/latest\/UserGuide\/aws-properties-s3-bucket.html#cfn-s3-bucket-name\" target=\"_blank\" rel=\"noopener\">https:\/\/docs.aws.amazon.com\/AWSCloudFormation\/latest\/UserGuide\/aws-properties-s3-bucket.html#cfn-s3-bucket-name<\/a><\/li>\n<li><span style=\"color: #ff0000;\"><strong>Replacements can cause a loss of data, such as changing the name of an S3 Bucket, so be careful!<\/strong><\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><a name='understanding'>&nbsp;<\/a><\/p>\n<h2>Understanding the CloudFormation Template Options<\/h2>\n<p><a href=\"https:\/\/www.udemy.com\/aws-cloudformation-master-class\/learn\/v4\/t\/lecture\/8139008?start=0\" target=\"_blank\" rel=\"noopener\">https:\/\/www.udemy.com\/aws-cloudformation-master-class\/learn\/v4\/t\/lecture\/8139008?start=0<\/a><\/p>\n<p>Parameters that are common to any CloudFormation template<\/p>\n<ul>\n<li>These are found on the Provisioning page in the AWS console!<\/li>\n<li>Tags\n<ul>\n<li>Will be applied to all services in the stack<\/li>\n<\/ul>\n<\/li>\n<li>Permissions<\/li>\n<li>Notification Options<\/li>\n<li>Timeouts<\/li>\n<li>Rollback on Failure<\/li>\n<li>Stack Policy<\/li>\n<\/ul>\n<p><a name='using'>&nbsp;<\/a><\/p>\n<h2>Using the CloudFormation Designer<\/h2>\n<p><a href=\"https:\/\/www.udemy.com\/aws-cloudformation-master-class\/learn\/v4\/t\/lecture\/8139016?start=0\" target=\"_blank\" rel=\"noopener\">https:\/\/www.udemy.com\/aws-cloudformation-master-class\/learn\/v4\/t\/lecture\/8139016?start=0<\/a><\/p>\n<ul>\n<li>CloudFormation &gt; [Design template]<\/li>\n<li>Drag and drop resources onto the screen<\/li>\n<li>Help visualize a CF Stack<\/li>\n<li>Handy to quickly draft a template<\/li>\n<li>Strong capabilities to verify that your template is well written<\/li>\n<li>Right Click and click &#8216;?&#8217; to get a link directly to the documentation page!<\/li>\n<\/ul>\n<p><a href=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2018\/02\/CloudFormation-Designer.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1088\" src=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2018\/02\/CloudFormation-Designer.png\" alt=\"\" width=\"844\" height=\"617\" srcset=\"https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2018\/02\/CloudFormation-Designer.png 844w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2018\/02\/CloudFormation-Designer-300x219.png 300w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2018\/02\/CloudFormation-Designer-768x561.png 768w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2018\/02\/CloudFormation-Designer-150x110.png 150w\" sizes=\"auto, (max-width: 844px) 100vw, 844px\" \/><\/a><\/p>\n<p><a name='building'>&nbsp;<\/a><\/p>\n<h2>CloudFormation Building Blocks<\/h2>\n<h3>Template Components<\/h3>\n<ul>\n<li>Resources: AWS resources declared in the template<\/li>\n<li>Parameters: Dynamic inputs for your template<\/li>\n<li>Mappings: Static variables for your template<\/li>\n<li>Outputs: References to what has been created<\/li>\n<li>Conditionals: List of conditions to perform resource creation<\/li>\n<li>Metadata<\/li>\n<\/ul>\n<h3>Template Helpers<\/h3>\n<ul>\n<li>References<\/li>\n<li>Functions<\/li>\n<\/ul>\n<p><a name='deploying'>&nbsp;<\/a><\/p>\n<h2>Deploying CloudFormation Templates<\/h2>\n<ul>\n<li>Manual\n<ul>\n<li>Editing templates in the CF Desgner<\/li>\n<li>Use the console to input parameters, etc.<\/li>\n<\/ul>\n<\/li>\n<li>Automated\n<ul>\n<li>Editing templates in a YAML file<\/li>\n<li>Using the AWS CLI to deploy the templates<\/li>\n<li>This will be in the Advanced Section<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><a name='quiz'>&nbsp;<\/a><\/p>\n<h2>Quiz<\/h2>\n<p>Updates can sometimes replace resources<\/p>\n<ul>\n<li><strong>Yes<\/strong><\/li>\n<li>No<\/li>\n<\/ul>\n<p>Which of the following is NOT an option while running a new CloudFormation template<\/p>\n<ul>\n<li>Tags<\/li>\n<li>Permissions<\/li>\n<li>Notification Options<\/li>\n<li>Timeouts<\/li>\n<li>Rollback on Failure<\/li>\n<li>Stack Policy<\/li>\n<li><strong>Custom Script<\/strong><\/li>\n<\/ul>\n<p>Which tool should I use for automating the deployment of CF templates?<\/p>\n<ul>\n<li>CF Designer<\/li>\n<li><strong>The AWS CLI<\/strong><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/www.udemy.com\/aws-cloudformation-master-class\/learn\/v4\/t\/lecture\/8138980?start=0 Main Menu Section Menu YAML Crash Course Creating an S3 Bucket Updating a Resource Understanding the CloudFormation Template Options Using the CloudFormation Designer CloudFormation Building Blocks Deploying CloudFormation Templates Quiz &nbsp; YAML Crash Course JSON to YAML Converter YAML and JSON both work for CF JSON is horrible, YAML is awsome Key-Value Pairs Delimited ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/wiki.thomasandsofia.com\/?p=1081\" 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":[26],"tags":[],"class_list":["post-1081","post","type-post","status-publish","format-standard","hentry","category-cloudformation"],"_links":{"self":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/1081","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=1081"}],"version-history":[{"count":8,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/1081\/revisions"}],"predecessor-version":[{"id":1091,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/1081\/revisions\/1091"}],"wp:attachment":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1081"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1081"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1081"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}