{"id":2132,"date":"2019-08-22T08:50:38","date_gmt":"2019-08-22T08:50:38","guid":{"rendered":"https:\/\/www.testpreptraining.com\/tutorial\/?page_id=2132"},"modified":"2020-05-02T07:35:33","modified_gmt":"2020-05-02T07:35:33","slug":"cloudformation-templates","status":"publish","type":"page","link":"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/cloudformation-templates\/","title":{"rendered":"CloudFormation Templates"},"content":{"rendered":"\n<ul class=\"wp-block-list\"><li>It is a JSON or YAML formatted text file. <\/li><li>save them with any extension, such as <ul><li>.json <\/li><\/ul><ul><li>.yaml<\/li><\/ul><ul><li>.template<\/li><\/ul><ul><li>.txt <\/li><\/ul><\/li><li>CloudFormation uses them for building AWS resources. <\/li><li>Example template with EC2 instance needs<ul><li>instance type<\/li><\/ul><ul><li>the AMI ID<\/li><\/ul><ul><li>block device mappings<\/li><\/ul><ul><li>and its Amazon EC2 key pair name. <\/li><\/ul><\/li><li>Whenever you create a stack, you also specify a template that AWS CloudFormation uses to create whatever you described in the template. <\/li><li>For JSON, it follows the ECMA-404 JSON standard<\/li><li>For XAML, supports the YAML Version 1.1 specification with exceptions, as<ul><li>The binary, omap, pairs, set, and timestamp tags<\/li><\/ul><ul><li>Aliases<\/li><li>Hash merges <\/li><\/ul><\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"227\" height=\"400\" src=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2019\/08\/image021-1-227x400.png\" alt=\"\" class=\"wp-image-2133\" srcset=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2019\/08\/image021-1-227x400.png 227w, https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2019\/08\/image021-1.png 522w\" sizes=\"auto, (max-width: 227px) 100vw, 227px\" \/><\/figure>\n\n\n\n<p><strong>JSON formatted template layout<\/strong><\/p>\n\n\n\n<p>{<\/p>\n\n\n\n<p>&nbsp;\n&#8220;AWSTemplateFormatVersion&#8221; : &#8220;version date&#8221;,<\/p>\n\n\n\n<p>&nbsp;\n&#8220;Description&#8221; : &#8220;JSON string&#8221;,<\/p>\n\n\n\n<p>&nbsp;\n&#8220;Metadata&#8221; : {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;\ntemplate metadata<\/p>\n\n\n\n<p>&nbsp;\n},<\/p>\n\n\n\n<p>&nbsp;\n&#8220;Parameters&#8221; : {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;\nset of parameters<\/p>\n\n\n\n<p>&nbsp;\n},<\/p>\n\n\n\n<p>&nbsp;\n&#8220;Mappings&#8221; : {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;\nset of mappings<\/p>\n\n\n\n<p>&nbsp;\n},<\/p>\n\n\n\n<p>&nbsp;\n&#8220;Conditions&#8221; : {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;\nset of conditions<\/p>\n\n\n\n<p>&nbsp;\n},<\/p>\n\n\n\n<p>&nbsp;\n&#8220;Transform&#8221; : {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;\nset of transforms<\/p>\n\n\n\n<p>&nbsp;\n},<\/p>\n\n\n\n<p>&nbsp;\n&#8220;Resources&#8221; : {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;\nset of resources<\/p>\n\n\n\n<p>&nbsp;\n},<\/p>\n\n\n\n<p>&nbsp;\n&#8220;Outputs&#8221; : {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;\nset of outputs<\/p>\n\n\n\n<p>&nbsp; } } <\/p>\n\n\n\n<p><strong>XAML formatted template layout<\/strong><\/p>\n\n\n\n<p>&#8212;<\/p>\n\n\n\n<p>AWSTemplateFormatVersion:\n&#8220;version date&#8221;<\/p>\n\n\n\n<p>Description:<\/p>\n\n\n\n<p>&nbsp;\nString<\/p>\n\n\n\n<p>Metadata:<\/p>\n\n\n\n<p>&nbsp;\ntemplate metadata<\/p>\n\n\n\n<p>Parameters:<\/p>\n\n\n\n<p>&nbsp;\nset of parameters<\/p>\n\n\n\n<p>Mappings:<\/p>\n\n\n\n<p>&nbsp;\nset of mappings<\/p>\n\n\n\n<p>Conditions:<\/p>\n\n\n\n<p>&nbsp;\nset of conditions<\/p>\n\n\n\n<p>Transform:<\/p>\n\n\n\n<p>&nbsp;\nset of transforms<\/p>\n\n\n\n<p>Resources:<\/p>\n\n\n\n<p>&nbsp;\nset of resources<\/p>\n\n\n\n<p>Outputs: set of outputs <\/p>\n\n\n\n<p>Template Sections<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Templates has many sections. <\/li><li>The Resources section is the only required section. <\/li><li>Some sections in a template can be in any order.<\/li><li>Various templates sections are <ul><li>Resources (required) &#8211; stack resources and their properties<\/li><\/ul><ul><li>Format Version (optional) &#8211; template format version that template conforms to. <\/li><\/ul><ul><li>Description (optional) &#8211; text string describing the template. Must always follow template format version section.<\/li><\/ul><ul><li>Metadata (optional) &#8211; Objects that provide additional information about the template.<\/li><\/ul><ul><li>Parameters (optional) &#8211; Values to pass to template at runtime <\/li><\/ul><ul><li>Mappings (optional) &#8211; A mapping of keys and associated values to specify conditional parameter values, similar to a lookup table. <\/li><\/ul><ul><li>Conditions (optional) &#8211; Conditions controlling resource creation or resource property assignment during stack creation or update. <\/li><\/ul><ul><li>Transform (optional) &#8211; For serverless applications, specifying version of AWS Serverless Application Model to use. <\/li><li>Outputs (optional) &#8211; Describes values returned whenever viewing stack&#8217;s properties. <\/li><\/ul><\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"525\" height=\"366\" src=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2019\/08\/image022-1.png\" alt=\"\" class=\"wp-image-2134\"\/><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>It is a JSON or YAML formatted text file. save them with any extension, such as .json .yaml .template .txt CloudFormation uses them for building AWS resources. Example template with EC2 instance needs instance type the AMI ID block device mappings and its Amazon EC2 key pair name. Whenever you create a stack, you also&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":2084,"menu_order":12,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"categories":[2],"tags":[7,387,383,372,380],"class_list":["post-2132","page","type-page","status-publish","hentry","category-amazon-aws","tag-aws","tag-cloudformation-templates","tag-containers","tag-devops","tag-devops-engineer"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>CloudFormation Templates - Testprep Training Tutorials<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/cloudformation-templates\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CloudFormation Templates - Testprep Training Tutorials\" \/>\n<meta property=\"og:description\" content=\"It is a JSON or YAML formatted text file. save them with any extension, such as .json .yaml .template .txt CloudFormation uses them for building AWS resources. Example template with EC2 instance needs instance type the AMI ID block device mappings and its Amazon EC2 key pair name. Whenever you create a stack, you also...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/cloudformation-templates\/\" \/>\n<meta property=\"og:site_name\" content=\"Testprep Training Tutorials\" \/>\n<meta property=\"article:modified_time\" content=\"2020-05-02T07:35:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2019\/08\/image021-1-227x400.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/cloudformation-templates\/\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/cloudformation-templates\/\",\"name\":\"CloudFormation Templates - Testprep Training Tutorials\",\"isPartOf\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#website\"},\"datePublished\":\"2019-08-22T08:50:38+00:00\",\"dateModified\":\"2020-05-02T07:35:33+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/cloudformation-templates\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/cloudformation-templates\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/cloudformation-templates\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"AWS Certified DevOps Engineer Professional\",\"item\":\"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"CloudFormation Templates\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#website\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\",\"name\":\"Testprep Training Tutorials\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.testpreptraining.ai\/tutorial\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#organization\",\"name\":\"Testprep Training\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png\",\"contentUrl\":\"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png\",\"width\":583,\"height\":153,\"caption\":\"Testprep Training\"},\"image\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"CloudFormation Templates - Testprep Training Tutorials","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/cloudformation-templates\/","og_locale":"en_US","og_type":"article","og_title":"CloudFormation Templates - Testprep Training Tutorials","og_description":"It is a JSON or YAML formatted text file. save them with any extension, such as .json .yaml .template .txt CloudFormation uses them for building AWS resources. Example template with EC2 instance needs instance type the AMI ID block device mappings and its Amazon EC2 key pair name. Whenever you create a stack, you also...","og_url":"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/cloudformation-templates\/","og_site_name":"Testprep Training Tutorials","article_modified_time":"2020-05-02T07:35:33+00:00","og_image":[{"url":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2019\/08\/image021-1-227x400.png"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/cloudformation-templates\/","url":"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/cloudformation-templates\/","name":"CloudFormation Templates - Testprep Training Tutorials","isPartOf":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#website"},"datePublished":"2019-08-22T08:50:38+00:00","dateModified":"2020-05-02T07:35:33+00:00","breadcrumb":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/cloudformation-templates\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/cloudformation-templates\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/cloudformation-templates\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.testpreptraining.ai\/tutorial\/"},{"@type":"ListItem","position":2,"name":"AWS Certified DevOps Engineer Professional","item":"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/"},{"@type":"ListItem","position":3,"name":"CloudFormation Templates"}]},{"@type":"WebSite","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#website","url":"https:\/\/www.testpreptraining.ai\/tutorial\/","name":"Testprep Training Tutorials","description":"","publisher":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.testpreptraining.ai\/tutorial\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#organization","name":"Testprep Training","url":"https:\/\/www.testpreptraining.ai\/tutorial\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/","url":"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png","contentUrl":"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png","width":583,"height":153,"caption":"Testprep Training"},"image":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/2132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/comments?post=2132"}],"version-history":[{"count":3,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/2132\/revisions"}],"predecessor-version":[{"id":2409,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/2132\/revisions\/2409"}],"up":[{"embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/2084"}],"wp:attachment":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/media?parent=2132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/categories?post=2132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/tags?post=2132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}