Recall & Review
beginner
What is the purpose of using multiple provider configurations in Terraform?
Multiple provider configurations allow Terraform to manage resources across different accounts, regions, or cloud providers within the same configuration.
Click to reveal answer
beginner
How do you define an additional provider configuration in Terraform?
You define an additional provider by giving it an alias inside the provider block, for example:
provider "aws" { alias = "west" region = "us-west-2" }Click to reveal answer
beginner
How do you specify which provider configuration a resource should use?
You specify the provider by using the 'provider' argument inside the resource block, referencing the provider alias, for example:
resource "aws_instance" "example" { provider = aws.west }Click to reveal answer
intermediate
Can you use multiple providers of the same type in one Terraform configuration?
Yes, by using aliases you can configure multiple providers of the same type to manage resources in different regions or accounts.
Click to reveal answer
intermediate
What happens if you do not specify a provider alias for a resource when multiple providers are configured?
Terraform uses the default provider configuration without an alias. If multiple providers exist, resources without a specified provider use the default one.
Click to reveal answer
How do you create a second AWS provider configuration for the us-east-1 region?
✗ Incorrect
You create a second provider by adding an alias inside the provider block with the desired region.
How do you tell a resource to use the aliased provider 'aws.west'?
✗ Incorrect
Inside the resource block, you set provider = aws.west without quotes to specify the aliased provider.
What is the default provider configuration called in Terraform?
✗ Incorrect
The default provider configuration is the one without an alias.
Can you use multiple providers of different cloud types in one Terraform configuration?
✗ Incorrect
Terraform supports multiple providers from different cloud vendors in the same configuration.
What is the benefit of using multiple provider configurations?
✗ Incorrect
Multiple providers let you manage resources in different accounts or regions within one Terraform setup.
Explain how to configure and use multiple AWS providers in Terraform.
Think about how you tell Terraform which AWS region or account to use for each resource.
You got /3 concepts.
Describe what happens if you have multiple provider configurations but a resource does not specify which one to use.
Consider the provider without an alias as the fallback.
You got /3 concepts.