0
0
Terraformcloud~10 mins

Why providers connect to cloud APIs in Terraform - Test Your Understanding

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

Complete the code to specify the cloud provider in Terraform.

Terraform
provider "aws" {
  region = "[1]"
}
Drag options to blanks, or click blank then click option'
Aus-west-2
Bmy-bucket
Cvpc-12345
Dinstance-type
Attempts:
3 left
💡 Hint
Common Mistakes
Using a resource name instead of a region.
Leaving the region blank.
2fill in blank
medium

Complete the code to authenticate Terraform with the cloud provider.

Terraform
provider "aws" {
  access_key = "[1]"
}
Drag options to blanks, or click blank then click option'
Amy-region
BAKIAIOSFODNN7EXAMPLE
Cmy-instance-type
Dmy-vpc-id
Attempts:
3 left
💡 Hint
Common Mistakes
Using region or resource names instead of credentials.
Leaving the access key empty.
3fill in blank
hard

Fix the error in the provider block to correctly specify the cloud API endpoint.

Terraform
provider "aws" {
  endpoint = "[1]"
}
Drag options to blanks, or click blank then click option'
Ahttps://api.cloudprovider.com
Bhttps://api.aws.com
Chttps://ec2.us-west-2.amazonaws.com
Dhttps://mybucket.s3.amazonaws.com
Attempts:
3 left
💡 Hint
Common Mistakes
Using generic or incorrect URLs.
Using URLs for storage buckets instead of API endpoints.
4fill in blank
hard

Fill both blanks to configure Terraform to connect to the cloud API with region and profile.

Terraform
provider "aws" {
  region  = "[1]"
  profile = "[2]"
}
Drag options to blanks, or click blank then click option'
Aus-east-1
Bdefault
Cadmin
Dmy-profile
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up profile names with region codes.
Using invalid region or profile names.
5fill in blank
hard

Fill all three blanks to define a provider block with region, access key, and secret key for cloud API connection.

Terraform
provider "aws" {
  region     = "[1]"
  access_key = "[2]"
  secret_key = "[3]"
}
Drag options to blanks, or click blank then click option'
Aus-west-1
BAKIAIOSFODNN7EXAMPLE
CwJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Dmy-region
Attempts:
3 left
💡 Hint
Common Mistakes
Using invalid or placeholder values.
Mixing up access key and secret key.