How do you address a specific instance of a resource with `count` or `for_each`?
BeginnerConceptProviders, Resources and Data Sources
Answer
With an index or key in brackets: aws_instance.web[0] for count, aws_subnet.private["a"] for for_each; inside modules prefix module.vpc.. Quote carefully in shells.
terraform state show 'module.vpc.aws_subnet.private["ap-south-1a"]'
More on Providers, Resources and Data Sources
What is a resource block and how is it addressed?BeginnerWhat is the difference between a resource and a data source?BeginnerHow do you configure a provider such as AWS?BeginnerHow do you use the same provider with multiple regions or accounts?IntermediateIn what order does the AWS provider look for credentials?IntermediateWhat does `default_tags` in the AWS provider do and what are its pitfalls?Intermediate