- 
                Notifications
    
You must be signed in to change notification settings  - Fork 42
 
Open
Description
I work with a client that uses colons in tag names as part of aws best tagging practices.
I tried to do this and I could not get it to work with tag corp:env and value prod
aws-gate session corp:env:prod
aws-gate session corp\:env:prod
aws-gate session "corp:env":prod
aws-gate session "corp\:env":prod
Seems like colons in tag names aren't supported by aws-gate yet. However, they are supported by aws.
Thank you for considering this
Lines 59 to 71 in 52f7281
| def getinstanceidbytag(name, ec2=None): | |
| # One of the allowed characters in tags is ":", which might break tag | |
| # parsing. For this reason,we have to differentiate 2 cases for | |
| # provided name: | |
| # - aws: special prefixed tags in the form of aws:<service>:<tag_name>:<tag_value> | |
| # - regular cases in the form <tag_name>:<tag_value> | |
| if name.startswith("aws:"): | |
| key, value = ":".join(name.split(":", 3)[:3]), name.split(":", 3)[-1] | |
| else: | |
| key, value = name.split(":", 1) | |
| filters = [{"Name": f"tag:{key}", "Values": [value]}] | |
| return _query_aws_api(filters=filters, ec2=ec2) | 
Metadata
Metadata
Assignees
Labels
No labels