surajincloud / awsctl

AWS CLI written in Go
https://surajincloud.github.io/awsctl/
Apache License 2.0
8 stars 7 forks source link

[FEATURE] filter resources by tags #18

Closed surajnarwade closed 1 year ago

surajnarwade commented 1 year ago

Description

Similar to kubectl where we filter resources based on labels for example,

kubectl get pods -l foo=bar

we should be able to do the same,

awsctl get <resource> -t foo=bar

here, -t or --tag will be particular tag.

Screenshots

No response

Additional information

No response

riteshsonawane1372 commented 1 year ago

How to display the tag key and value

riteshsonawane1372 commented 1 year ago

found this https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/ec2#Client.DescribeTags and

https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/ec2#DescribeTagsOutput

riteshsonawane1372 commented 1 year ago

we can have up to 49 key: value pairs, should I put them in a file? In the output section will add a column for location of tags.

surajnarwade commented 1 year ago

example,

Currently we have following command,

awsctl get ec2

we should be able to do,

awsctl get ec2 -t env=production
adityasimant commented 1 year ago

Can you assign me this issue?

riteshsonawane1372 commented 1 year ago

What if we don't know the value?, For example I want all instances with key "ritesh" and I don't know what value I have given and there exists more than one instance with same key "ritesh"

example,

Currently we have following command,

awsctl get ec2

we should be able to do,

awsctl get ec2 -t env=production
riteshsonawane1372 commented 1 year ago

Closing this issue #31