The aws_db_subnet_group data block should allow tag lookups #25860
Labels
enhancement
Requests to existing resources that expand the functionality or scope.
good first issue
Call to action for new contributors looking for a place to start. Smaller or straightforward issues.
service/rds
Issues and PRs that pertain to the rds service.
Community Note
Description
The datablock for aws_db_subnet_group should support lookup by tag. If you create the group without a name, it gets a terraform generated ID which is not friendly, particularly in multi-region, multi-account envs.
This usually leads you to create a big if/else block enumerating all the subnet group names. Additionally, you can't move an RDS instance to another db subnet group in the same VPC - once you start using the group it's difficult to migrate.
If we could simply look the aws_db_subnet_group up using a filter similar to this data source we could pretty easily mitigate this issue by adding tags to the group (funny enough, the
Name
tag is likely what we'd use) then using a data block like:Name should also be added as an output attribute to the data source, it currently isn't. I assume that is because you don't need the lookup if you already know the name.
New or Affected Resource(s)
Potential Terraform Configuration
References
The text was updated successfully, but these errors were encountered: