Public Repository

Last pushed: 2 years ago
Short Description
Convert EC2 instance tags to environment variables
Full Description

Tagging AWS EC2 instances, particularly via autoscaling groups, is a great way to convey information about the role and intended behaviour of the instance.

This simple script enables an instance to discover its own tags and write them as environment variables for consumption by applications.

It is preferable to authenticate an instance via IAM roles, in which case you can simply run:

docker run rlister/ec2tags

Alternatively, you can auth using the standard AWS environment variables:

docker run \
  -e AWS_ACCESS_KEY_ID \
  -e AWS_SECRET_ACCESS_KEY \
  -e AWS_DEFAULT_REGION \
  rlister/ec2tags

If running on an EC2 instance, instance-id be discovered from instance metadata. Otherwise, you can pass the id as argument to ec2tags.

Tags are uppercased and formatted as environment variables, in the form: FOO=bar.

Docker Pull Command
Owner
rlister