https://pulumi.com logo
#python
Title
# python
g

gorgeous-minister-41131

10/28/2021, 9:50 PM
https://www.pulumi.com/registry/packages/aws/api-docs/kms/key/#look-up is there a way to lookup keys’ by tags? similar to the ec2.get_subnets() or vpcs awaitable?
f

famous-leather-94346

10/31/2021, 6:16 AM
Hi, I don't think, it might return multiple ones. I can recommend to use AWS SDK instead (or combine results with pulumi).
g

gorgeous-minister-41131

11/09/2021, 2:30 PM
I looked into it further, I guess it is because the kms API itself doesn’t allow for pulling via only tags… you have to know the ID 😕 I guess this makes sense on why the terraform provider never had it either. One would have to pull down all KMS’s with the list-keys API and do a client-side filter which seems inefficient since it’s a pagination operation (assuming you have a lot of keys I guess).