Exam Terraform Associate All QuestionsBrowse all questions from this exam
Question 52

In Terraform 0.13 and above, outside of the required_providers block, Terraform configurations always refer to providers by their local names.

    Correct Answer: A

    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.

Discussion
BereOption: A

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.

EltoothOption: A

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

bigboi23Option: A

Correct! https://www.terraform.io/language/providers/requirements

ChehhOption: A

"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

BJ5Option: B

What about aliases provider "aws" { region="us-west-1" alias = "west" } resource "aws_instance" "ec2" { provider = aws.west }

chaoscreater

that's still referencing the provider name "aws" first

campsOption: A

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.

Power123Option: A

A is correct

AShahine21Option: B

what about alias ? I am going to say false