4

In May AWS introduced the ability to tag elastic beanstalk environments. We can't figure out how to tag an elastic beanstalk environment when we create it using "eb start."

We use the "eb command line interface" to create our environments. Using this mechanism you pass configuration parameters through the command line or using an .elasticbeanstalk/optionsettings.environment_name file. Anyone figure out how to tag an environment using an optionsettings file?

If not, does anyone know a way to tag an environment after it has been created?

tpml7
  • 479
  • 1
  • 5
  • 21
Peter M
  • 973
  • 2
  • 15
  • 27

2 Answers2

3

Unfortunately this is not currently possible with the eb cli. Tags are also immutable and cannot be changed after the environment is created.

You can however create the environment with tags using the aws cli.

$ aws elasticbeanstalk create-environment --application-name myapp --environment-name myenv --solution-stack-name "64bit Amazon Linux 2014.09 v1.0.9 running PHP 5.5" --tags Key=foo,Value=bar Key=myid,Value=2
Humdinger
  • 336
  • 1
  • 8
3

In note of the recent EB CLI release, you can now do this with the EB CLI v3.

eb create --tags foo=bar
Humdinger
  • 336
  • 1
  • 8
  • And if you need multiple tags you can do eb create --tags foo=bar,bar=baz (see https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.tagging.html) – tschumann Jun 04 '21 at 02:25