{"id":1165,"date":"2018-02-23T11:17:53","date_gmt":"2018-02-23T11:17:53","guid":{"rendered":"http:\/\/wiki.thomasandsofia.com\/?p=1165"},"modified":"2018-02-23T12:01:33","modified_gmt":"2018-02-23T12:01:33","slug":"cloudformation-metadata","status":"publish","type":"post","link":"https:\/\/wiki.thomasandsofia.com\/?p=1165","title":{"rendered":"CloudFormation Metadata"},"content":{"rendered":"<p><a href=\"http:\/\/wiki.thomasandsofia.com\/2018\/02\/18\/cloud-formation-main-menu\/\" rel=\"noopener\">Course Main Menu<\/a><\/p>\n<h2>Section 4 Main Menu<\/h2>\n<ul>\n<li><a href=\"#Overview\">Overview<\/a><\/li>\n<li><a href=\"#Hands\">Designer Hands On<\/a><\/li>\n<li><a href=\"#Interface\">Interface Hands On<\/a><\/li>\n<li><a href=\"#quiz\">Quiz<\/a><\/li>\n<\/ul>\n<p><a name=\"Overview\"><\/a><\/p>\n<h2>Overview<\/h2>\n<p><a href=\"https:\/\/www.udemy.com\/aws-cloudformation-master-class\/learn\/v4\/t\/lecture\/8162170?start=0\" target=\"_blank\" rel=\"noopener\">https:\/\/www.udemy.com\/aws-cloudformation-master-class\/learn\/v4\/t\/lecture\/8162170?start=0<\/a><\/p>\n<p>What is Metadata?<\/p>\n<ul>\n<li>You can use the <i>optional<\/i> metadata section to include arbitrary YAML that provides details about the template or resources.<\/li>\n<\/ul>\n<pre>Metadata:\r\n   Instances:\r\n      Description: \"Information about the instances\"\r\n   Databases:\r\n      Description: \"Information about the databases\"<\/pre>\n<p>Special metadata keys<\/p>\n<ul>\n<li>There are 3 metadata keys that have special meaning:\n<ul>\n<li>AWS::CloudFormation::Designer\n<ul>\n<li>Describes how the resources are laid out in your template.\u00a0 This is automatically added by the AWS Designer.<\/li>\n<\/ul>\n<\/li>\n<li>AWS::CloudFormation::Interface\n<ul>\n<li>Defines grouping and ordering of input paramters when they are displayed in the AWS Console.<\/li>\n<\/ul>\n<\/li>\n<li>AWS::CloudFormation::Init\n<ul>\n<li>Defines configuration tasks for cfn-init.\u00a0 This is the most powerful usage of the metadata to be discussed in the next section.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><a name=\"Hands\"><\/a><\/p>\n<h2>Designer Hands On<\/h2>\n<p><a href=\"https:\/\/www.udemy.com\/aws-cloudformation-master-class\/learn\/v4\/t\/lecture\/8162172?start=0\" target=\"_blank\" rel=\"noopener\">https:\/\/www.udemy.com\/aws-cloudformation-master-class\/learn\/v4\/t\/lecture\/8162172?start=0<\/a><\/p>\n<ul>\n<li>This is the easiest kind of Metadata.\u00a0 It is automatically generated for you.\n<ul>\n<li>Use it to move item placement or their size in Designer<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre>Metadata:\r\n  'AWS::CloudFormation::Designer':\r\n    6b0c3e59-...-888dcdb37=da:\r\n      size:\r\n        width: 60\r\n        height: 60\r\n      position:\r\n        x: 250\r\n        y: 250\r\n        z: 0<\/pre>\n<p><a name=\"Interface\"><\/a><\/p>\n<h2>Interface Hands On<\/h2>\n<ul>\n<li>Define grouping and ordering of input parameters when they are displayed in the AWS Console<\/li>\n<li>This is meant when users must input template parameters manually<\/li>\n<li>You provide them with grouping, or sorting, that allow them to input parameters efficiently\n<ul>\n<li>Example: Group all the EC2 related parameters together<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre>---\r\nParameters:\r\n  KeyName:\r\n    Description: Name of an existing EC2 key pair for SSH access to the EC2 instance.\r\n    Type: AWS::EC2::KeyPair::KeyName\r\n  InstanceType:\r\n    Description: EC2 instance type.\r\n    Type: String\r\n    Default: t2.micro\r\n    AllowedValues:\r\n    - t2.micro\r\n    - t2.small\r\n    - t2.medium\r\n    - m3.medium\r\n    - m3.large\r\n    - m3.xlarge\r\n    - m3.2xlarge\r\n  SSHLocation:\r\n    Description: The IP address range that can SSH to the EC2 instance.\r\n    Type: String\r\n    MinLength: '9'\r\n    MaxLength: '18'\r\n    Default: 0.0.0.0\/0\r\n    AllowedPattern: \"(\\\\d{1,3})\\\\.(\\\\d{1,3})\\\\.(\\\\d{1,3})\\\\.(\\\\d{1,3})\/(\\\\d{1,2})\"\r\n    ConstraintDescription: Must be a valid IP CIDR range of the form x.x.x.x\/x.\r\n  VPCID:\r\n    Description: VPC to operate in\r\n    Type: AWS::EC2::VPC::Id\r\n  SubnetID:\r\n    Description: Subnet ID\r\n    Type: AWS::EC2::Subnet::Id\r\n  SecurityGroupID:\r\n    Description: Security Group\r\n    Type: AWS::EC2::SecurityGroup::Id\r\n\r\nResources:\r\n  MyEC2Instance:\r\n    Type: \"AWS::EC2::Instance\"\r\n    Properties:\r\n      AvailabilityZone: us-east-1a\r\n      ImageId: ami-a4c7edb2\r\n      InstanceType: !Ref InstanceType\r\n      SecurityGroups:\r\n        - !Ref SecurityGroupID\r\n      SubnetID: !Ref SubnetID\r\n\r\nMetadata:\r\n  AWS::CloudFormation::Interface:\r\n    ParameterGroups:\r\n      - Label:\r\n          default: \"Network Configuration\"\r\n        Parameters:\r\n          - VPCID\r\n          - SubnetID\r\n          - SecurityGroupID\r\n      - Label:\r\n          default: \"Amazon EC2 Configuration\"\r\n        Parameters:\r\n          - InstanceType\r\n          - KeyName\r\n    ParameterLabels:\r\n      VPCID:\r\n        default: \"Which VPC should this be deployed to?\"<\/pre>\n<p><a href=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2018\/02\/metadata-interface.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1171\" src=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2018\/02\/metadata-interface.png\" alt=\"\" width=\"831\" height=\"895\" srcset=\"https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2018\/02\/metadata-interface.png 831w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2018\/02\/metadata-interface-279x300.png 279w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2018\/02\/metadata-interface-768x827.png 768w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2018\/02\/metadata-interface-139x150.png 139w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2018\/02\/metadata-interface-300x323.png 300w\" sizes=\"auto, (max-width: 831px) 100vw, 831px\" \/><\/a><br \/>\n<a name=\"Quiz\"><\/a><\/p>\n<h2>Quiz<\/h2>\n<h4>Metadata is<\/h4>\n<ul>\n<li><strong>Optional<\/strong><\/li>\n<li>Mandatory<\/li>\n<\/ul>\n<h4>Metadata can take<\/h4>\n<ul>\n<li><strong>Any value<\/strong><\/li>\n<li>One the values AWS::CloudFormation::Designer, ::Interface, ::Init<\/li>\n<\/ul>\n<p>Metadata is whatever YAML you want, but some values have special meaning in AWS.<\/p>\n<p>&nbsp;<\/p>\n<h2><\/h2>\n","protected":false},"excerpt":{"rendered":"<p>Course Main Menu Section 4 Main Menu Overview Designer Hands On Interface Hands On Quiz Overview https:\/\/www.udemy.com\/aws-cloudformation-master-class\/learn\/v4\/t\/lecture\/8162170?start=0 What is Metadata? You can use the optional metadata section to include arbitrary YAML that provides details about the template or resources. Metadata: Instances: Description: &#8220;Information about the instances&#8221; Databases: Description: &#8220;Information about the databases&#8221; Special metadata keys ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/wiki.thomasandsofia.com\/?p=1165\" 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-1165","post","type-post","status-publish","format-standard","hentry","category-cloudformation"],"_links":{"self":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/1165","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=1165"}],"version-history":[{"count":6,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/1165\/revisions"}],"predecessor-version":[{"id":1173,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/1165\/revisions\/1173"}],"wp:attachment":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1165"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}