1

Terraform show command will show all the resources in the state file.

But we need to display all the resources present in AWS (or region specific), not just the one in the state file.

How to do that using terraform?

From AWS CLI we can do like below.

aws resourcegroupstaggingapi get-resources --region us-east-1

But we want to acheive the same using terraform cli or any other hashicorp tool.

2 Answers 2

0

This operation is not available through any HashiCorp tool at the time I'm writing this answer.

Terraform in particular only tracks specific objects that it created or were imported into it, and avoids interacting with any other remote objects.

The AWS CLI is the best approach for retrieving arbitrary data from AWS when you are working at the command line.

0

Would aws_resourcegroupstaggingapi_resources data source help in that case?

Docs: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/resourcegroupstaggingapi_resources

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .