0
0
Terraformcloud~10 mins

AWS provider setup in Terraform - Interactive Code Practice

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

Complete the code to specify the AWS provider version.

Terraform
provider "aws" {
  version = "~> [1]"
}
Drag options to blanks, or click blank then click option'
A3.0
B5.0
C4.0
D2.5
Attempts:
3 left
💡 Hint
Common Mistakes
Using an outdated provider version like 2.5.
Specifying a version without the ~> operator.
2fill in blank
medium

Complete the code to set the AWS region to us-west-2.

Terraform
provider "aws" {
  region = "[1]"
}
Drag options to blanks, or click blank then click option'
Aap-southeast-1
Bus-east-1
Ceu-central-1
Dus-west-2
Attempts:
3 left
💡 Hint
Common Mistakes
Using a region code that does not exist.
Mixing up region codes like us-east-1 and us-west-2.
3fill in blank
hard

Fix the error in the provider block by completing the missing argument.

Terraform
provider "aws" {
  [1] = "us-east-1"
}
Drag options to blanks, or click blank then click option'
Aprofile
Baccess_key
Cregion
Dsecret_key
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'profile' instead of 'region' to set the AWS region.
Trying to set access_key or secret_key directly in the provider block.
4fill in blank
hard

Fill both blanks to configure the AWS provider with a profile and region.

Terraform
provider "aws" {
  [1] = "myprofile"
  [2] = "eu-west-1"
}
Drag options to blanks, or click blank then click option'
Aprofile
Bregion
Caccess_key
Dsecret_key
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing 'access_key' with 'profile'.
Setting 'secret_key' instead of 'region'.
5fill in blank
hard

Fill all three blanks to configure the AWS provider with region, profile, and enable shared credentials file.

Terraform
provider "aws" {
  [1] = "ap-northeast-1"
  [2] = "devprofile"
  [3] = "~/.aws/credentials"
}
Drag options to blanks, or click blank then click option'
Aregion
Bprofile
Cshared_credentials_file
Dshared_credentials_file_enabled
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'shared_credentials_file_enabled' which does not exist, instead of 'shared_credentials_file'.
Mixing up the order of arguments.