Is there a way to do this from Beanstalk? or do I have to do it myself once the new instance is up via .ebextensions or something like that?
This feature was not available at the time this question was asked. There were many requests for this ever since the tagging feature was first introduced in 2014.
Support for updating EB tags was eventually added in Oct 2017.
You can now manage tags in the Beanstalk Management Console, with the EB CLI or with the AWS CLI.
If you want to set the tags from within your Elastic Beanstalk instance, you can certainly SSH in, install the AWS CLI and set the tags via the command line. Or, whatever application you're deploying on Beanstalk can do so via the SDK (e.g. Java).
Via CLI:
http://docs.aws.amazon.com/cli/latest/reference/ec2/create-tags.html
create-tags [--dry-run | --no-dry-run] --resources <value> --tags <value> [--cli-input-json <value>] [--generate-cli-skeleton]
Via SDK:
http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/ec2/model/CreateTagsRequest.html
(pseudo-code)
Authorize via credentials
Instantiate CreateTagsRequest with specific resource ID
call setTags(Collection<<**String**>> tags) on the CreateTagsRequest object
From outside the environment, you can set the tags via the console or via EB CLI. http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.tagging.html
eb create --tags mytag1=value1,mytag2=value2
Note, you can also set regular environment variables via eb create.
eb create --envvars key=value
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With