Labeling Beanstalk Objects Created with a Cloud Framework

When creating an elastic beanstalk environment using Cloud Formation, how do you set tags dedicated to the environment and instances?

For example, I have the following resource definition:

"BeanstalkEnvironment" : {
  "Type" : "AWS::ElasticBeanstalk::Environment",
  "Properties" : {
    "ApplicationName" : { "Ref" : "BeanstalkApplication" },
     "Description" :  "AWS Elastic Beanstalk Environment running Demo Application",
     "SolutionStackName" : "64bit Windows Server 2012 R2 running IIS 8.5",
     "EnvironmentName" : "Test Site",
     "CNAMEPrefix" : { "Ref" : "URLPrefix" },
     "OptionSettings" : [
       {"Namespace" : "aws:autoscaling:launchconfiguration", "OptionName" : "EC2KeyName", "Value" : { "Ref" : "KeyName" }},
       {"Namespace" : "aws:ec2:vpc", "OptionName" : "VPCId", "Value" : { "Ref" : "VPC" }},
       {"Namespace" : "aws:ec2:vpc", "OptionName" : "Subnets", "Value" : { "Fn::Join" : [ ",", [ { "Ref" : "SubnetA" }, { "Ref" : "SubnetB" }, { "Ref" : "SubnetC" } ] ] } },
       {"Namespace" : "aws:ec2:vpc", "OptionName" : "ELBSubnets", "Value" : { "Fn::Join" : [ ",", [ { "Ref" : "SubnetA" }, { "Ref" : "SubnetB" }, { "Ref" : "SubnetC" } ] ] } },
       {"Namespace" : "aws:autoscaling:launchconfiguration", "OptionName":"InstanceType", "Value" : "t2.micro" },
       {"Namespace" : "aws:ec2:vpc", "OptionName":"AssociatePublicIpAddress", "Value":"true" },
       {"Namespace" : "aws:autoscaling:updatepolicy:rollingupdate", "OptionName":"MaxBatchSize", "Value": "1" },
       {"Namespace" : "aws:autoscaling:updatepolicy:rollingupdate", "OptionName":"MinInstancesInService", "Value": "1" },
       {"Namespace" : "aws:autoscaling:updatepolicy:rollingupdate", "OptionName":"PauseTime", "Value": "PT5M30S" },
       {"Namespace" : "aws:autoscaling:updatepolicy:rollingupdate", "OptionName":"RollingUpdateEnabled", "Value": "true" },
       {"Namespace" : "aws:elasticbeanstalk:command", "OptionName":"BatchSize", "Value": "30" },
       {"Namespace" : "aws:elb:policies", "OptionName":"ConnectionDrainingEnabled", "Value": "true" }
      ],
     "VersionLabel" : "Sample .NET Application"
    }
  }

      

A complete working example of a template is at this value .

And would like to add a set of labels to Beanstalk and the instances it creates, like this:

"Tags" : [ 
          { "Key" : "Contact", "Value" : { "Ref" : "Contact" } },
          { "Key" : "BudgetCode", "Value" : { "Ref" : "BudgetCode" } } 
        ]

      

There is no Tags element for Beanstalk Resilient Resource Type as well as for other types (for example, S3 Buckets ).

Any suggestions on how to do this? It would be very helpful to ensure that the instances that are created are tagged correctly so that we can keep track of which instances are being used for different projects.

+3


source to share


3 answers


Now an example is given by the OP.

AWS added support for tagging Beanstalk elastic slices on 08/24/2015: http://aws.amazon.com/about-aws/whats-new/2015/08/aws-cloudformation-updates-support-for-amazon-vpc-aws- lambda-aws-elastic-beanstalk-amazon-rds-and-amazon-s3 /



Usage is the same as other CFN resource types that support tags - includes the "Tags" key in property mappings and assigns a list of key mappings, values: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide /aws-properties-beanstalk-environment.html#cfn-beanstalk-environment-tags

+2


source


I wish I had an answer, but instead I have the same problem. You can do this in the cli creation environment and in the api, but there seems to be no namespace for this in the options settings for this in the cloudformation template. (At least this is an undocumented namespace from what I can see). My google-fu doesn't show anyone yet with an answer to this.



0


source


I have the same problem and Amazon support pointed out this is a functionality gap.

0


source







All Articles