0
0
Terraformcloud~10 mins

State replace-provider in Terraform - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to replace the provider source in Terraform state.

Terraform
terraform state replace-provider [1]
Drag options to blanks, or click blank then click option'
A"registry.terraform.io/hashicorp/google" "registry.terraform.io/hashicorp/aws"
B"registry.terraform.io/hashicorp/aws" "registry.terraform.io/hashicorp/google"
C"registry.terraform.io/hashicorp/aws" "registry.terraform.io/hashicorp/azurerm"
D"registry.terraform.io/hashicorp/azurerm" "registry.terraform.io/hashicorp/google"
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the order of old and new providers
Using incorrect provider source names
Omitting quotes around provider addresses
2fill in blank
medium

Complete the command to replace the provider source from AWS to Google Cloud in Terraform state.

Terraform
terraform state replace-provider [1]
Drag options to blanks, or click blank then click option'
A"registry.terraform.io/hashicorp/google" "registry.terraform.io/hashicorp/aws"
B"registry.terraform.io/hashicorp/aws" "registry.terraform.io/hashicorp/google"
C"registry.terraform.io/hashicorp/azurerm" "registry.terraform.io/hashicorp/google"
D"registry.terraform.io/hashicorp/google" "registry.terraform.io/hashicorp/azurerm"
Attempts:
3 left
💡 Hint
Common Mistakes
Reversing the old and new provider order
Using incomplete provider names
Forgetting to quote the provider addresses
3fill in blank
hard

Fix the error in the command to replace the provider source from AzureRM to AWS in Terraform state.

Terraform
terraform state replace-provider [1]
Drag options to blanks, or click blank then click option'
A"registry.terraform.io/hashicorp/azurerm" "registry.terraform.io/hashicorp/aws"
B"registry.terraform.io/hashicorp/google" "registry.terraform.io/hashicorp/aws"
C"registry.terraform.io/hashicorp/aws" "registry.terraform.io/hashicorp/azurerm"
D"registry.terraform.io/hashicorp/aws" "registry.terraform.io/hashicorp/google"
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping old and new providers
Using wrong provider source names
4fill in blank
hard

Fill both blanks to replace the provider source from AWS to AzureRM in Terraform state and confirm the action.

Terraform
terraform state replace-provider [1] [2] -auto-approve
Drag options to blanks, or click blank then click option'
A"registry.terraform.io/hashicorp/aws"
B"registry.terraform.io/hashicorp/google"
C"registry.terraform.io/hashicorp/azurerm"
D-auto-approve
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong provider order
Confusing -force with -auto-approve
Omitting quotes around provider names
5fill in blank
hard

Fill all three blanks to replace the provider source from Google to AWS in Terraform state, force the action (skip confirmation).

Terraform
terraform state replace-provider [1] [2] [3]
Drag options to blanks, or click blank then click option'
A"registry.terraform.io/hashicorp/google"
B"registry.terraform.io/hashicorp/aws"
C-auto-approve
D-verbose
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up old and new providers
Using -verbose instead of -auto-approve to skip confirmation
Omitting quotes around provider names