In Terraform 0.13 and above, outside of the required_providers block, Terraform configurations always refer to providers by their local names.
In Terraform 0.13 and above, outside of the required_providers block, Terraform configurations always refer to providers by their local names.
In Terraform 0.13 and above, outside of the required_providers block, Terraform configurations always refer to providers by their local names. Local names are assigned when requiring a provider within a module and are used consistently throughout the Terraform configuration. This ensures that each module has a clear and consistent way to reference the providers it depends on, helping to manage dependencies and configurations effectively.
Here's an example that demonstrates this: terraform { required_providers { aws = { source = "hashicorp/aws" version = "~> 3.0" } } } provider "aws" { region = "us-west-2" } resource "aws_instance" "example" { ami = "ami-0123456789abcdef0" instance_type = "t2.micro" } In this example, the required_providers block specifies the source and version constraints for the AWS provider. In the rest of the configuration, the provider is referred to by its local name aws, such as in the provider "aws" block and the aws_instance resource block.
A is correct answer. "Local names are module-specific, and are assigned when requiring a provider. Local names must be unique per-module. Outside of the required_providers block, Terraform configurations always refer to providers by their local names." https://www.terraform.io/language/providers/requirements#local-names
Correct! https://www.terraform.io/language/providers/requirements
"Outside of the required_providers block, Terraform configurations always refer to providers by their local names." https://www.terraform.io/language/providers/requirements#local-names
What about aliases provider "aws" { region="us-west-1" alias = "west" } resource "aws_instance" "ec2" { provider = aws.west }
that's still referencing the provider name "aws" first
A. True. In Terraform 0.13 and above, provider references are always specified using their local name, rather than the legacy name-based syntax used in earlier versions. The provider's local name is specified in the required_providers block, and this local name is used in all provider references in the configuration.
A is correct
what about alias ? I am going to say false