Skip to content

Conversation

@jhundley9109
Copy link

@jhundley9109 jhundley9109 commented Mar 15, 2024

Add two new options to ec2metadata to query tags on a given instance if instance metadata tags are turned on.

Examples of new options:

$ ec2metadata --tags
aws:autoscaling:groupName=example-autoscaling-group-name
aws:ec2launchtemplate:version=1
etc..

$ ec2metadata --tag aws:autoscaling:groupName
example-autoscaling-group-name

Here is the article that outlines AWS's support for tags in instance metadata.
https://aws.amazon.com/about-aws/whats-new/2022/01/instance-tags-amazon-ec2-instance-metadata-service/

Perhaps this isn't 100% up to code standards but it should be pretty easy to get it there if you guys want to use it.

Thanks!

@jhundley9109 jhundley9109 changed the title Add support for --tags and -tag TAGNAME in the ec2metadata script Add support for --tags and --tag TAGNAME in the ec2metadata script Mar 15, 2024
@holmanb
Copy link
Member

holmanb commented Apr 1, 2024

@jhundley9109 Thanks for this PR. Please sign the cla.

@jhundley9109
Copy link
Author

@holmanb I signed the CLA. Do you need anything else from me to get the tests running/to pass. I'm obviously not super familiar with the project, just needed to make some changes to this script for my use case (:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants