Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] ec2metadata: Add support for --tags #58

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

samveen
Copy link

@samveen samveen commented Sep 3, 2024

Metadata tag support was added to the EC2 metadata API in 2022. As per the relevant AWS documentation, both IMDS version 2 and version 1 support exists.

I've used that to implement support for --tags to return a dict, similar to the list returned by --public-keys.

However, before this is merged, I request a quick review to answer whether the output should be

  • a python dictonary as is
    {'App': 'cardprocessor', 'Domain': 'stage-cardprocessor.sabpaisa.in', 'Name': 'cardprocessor-asg-member', 'aws:autoscaling:groupName': 'cardprocessor-autoscaling-group', 'aws:ec2launchtemplate:id': 'lt-0c7210c3de4129ea6', 'aws:ec2launchtemplate:version': '4'}
    
  • A json dict
    {"App": "cardprocessor", "Domain": "stage-cardprocessor.sabpaisa.in", "Name": "cardprocessor-asg-member", "aws:autoscaling:groupName": "cardprocessor-autoscaling-group", "aws:ec2launchtemplate:id": "lt-0c7210c3de4129ea6", "aws:ec2launchtemplate:version": "4"}
    
  • A flat tag: value list like default output of ec2metadata:
    Name: myasg-member
    aws:autoscaling:groupName: myasg
    aws:ec2launchtemplate:id: lt-deadbea1b00b10b155ad
    
  • A list as above, but with a tag: prefix:
    tag:Name: myasg-member
    tag:aws:autoscaling:groupName: myasg
    tag:aws:ec2launchtemplate:id: lt-deadbea1b00b10b155ad
    
  • Something else better than all the above, which I couldn't figure.

NOTE: I have signed the CLA already

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.

1 participant