hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.74k stars 9.1k forks source link

[New Data Source]: aws_route53_resolver_rule_association to get the list of the vpc associations #36781

Open farisbacker opened 5 months ago

farisbacker commented 5 months ago

Description

Data source to get the list of associations for particular rule. There is already resource for the same https://registry.terraform.io/providers/hashicorp/aws/5.44.0/docs/resources/route53_resolver_rule_association

Requested Resource(s) and/or Data Source(s)

"aws_route53_resolver_rule_associations"

Potential Terraform Configuration

data "aws_route53_resolver_rule_associations" "existing_associations" {
  resolver_rule_id = ""
}

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 5 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

jtyrus commented 5 months ago

I can make this change. Looks like the api supports the following filters for rule associations Docs

So

data "aws_route53_resolver_rule_associations" "existing_associations" {
  name = ""
  resolver_rule_id = ""
  status = []
  vpc_id = ""
}
jtyrus commented 4 months ago

@farisbacker went with the filter pattern since that's what the CLI is taking, so would look like

data "aws_route53_resolver_rule_associations" "existing_associations" {
  filter {
    name = "ResolverRuleId"
    values = [ aws_route53_resolver_rule_association.existing.resolver_rule_id ]
  }
}