Is it possible to find s3 bucket by tag?
Let's assume that I've created an bucket: 12345-bucket-54321 and I added a tag (bucket:mypersonalbucket).
Is it possible to find this bucket in Terraform by tag?
I'm looking for something similar to: https://www.terraform.io/docs/providers/aws/d/ami.html#filter
Currently (04/26/19) it is not possible to get an S3 bucket by tag. If you look at the documentation when attempting to get an s3 bucket as a data source you can only perform lookup by the bucket name i.e.
data "aws_s3_bucket" "selected" {
 bucket = "bucket_name"
}
One thing you might want to do is open a feature request with the Terraform AWS Provider on Github requesting this functionality.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With