Data Source: aws_resourcegroupstaggingapi_resources

Provides details about resource tagging.

Example Usage

Get All Resource Tag Mappings

data "aws_resourcegroupstaggingapi_resources" "test" {}

Filter By Tag Key and Value

data "aws_resourcegroupstaggingapi_resources" "test" {
  tag_filter {
    key    = "tag-key"
    values = ["tag-value-1", "tag-value-2"]
  }
}

Filter By Resource Type

data "aws_resourcegroupstaggingapi_resources" "test" {
  resource_type_filters = ["ec2:instance"]
}

Argument Reference

This data source supports the following arguments:

Tag Filter

A tag_filter block supports the following arguments:

If you do specify tag_filter, the response returns only those resources that are currently associated with the specified tag. If you don't specify a tag_filter, the response includes all resources that were ever associated with tags. Resources that currently don't have associated tags are shown with an empty tag set.

Attribute Reference

This data source exports the following attributes in addition to the arguments above: