0
0
Terraformcloud~10 mins

Import state verification 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 import an AWS S3 bucket state using Terraform CLI.

Terraform
terraform import [1] my-bucket
Drag options to blanks, or click blank then click option'
Aaws_vpc.main
Baws_instance.web
Caws_s3_bucket.example
Daws_lambda_function.func
Attempts:
3 left
💡 Hint
Common Mistakes
Using a resource type that does not match the resource you want to import.
Forgetting to specify the full resource address.
2fill in blank
medium

Complete the Terraform command to verify the imported state of a resource.

Terraform
terraform state [1] aws_s3_bucket.example
Drag options to blanks, or click blank then click option'
Amv
Blist
Crm
Dshow
Attempts:
3 left
💡 Hint
Common Mistakes
Using list which shows all resources, not details of one.
Using rm which deletes the resource from state.
3fill in blank
hard

Fix the error in the Terraform import command to correctly import an AWS EC2 instance with ID i-1234567890abcdef0.

Terraform
terraform import aws_instance.web [1]
Drag options to blanks, or click blank then click option'
Aweb-instance
Bi-1234567890abcdef0
Cinstance-id
Daws_instance.web
Attempts:
3 left
💡 Hint
Common Mistakes
Using the resource name instead of the resource ID.
Using the Terraform resource address as the ID.
4fill in blank
hard

Fill both blanks to correctly remove a resource from Terraform state and then verify the state list.

Terraform
terraform state [1] aws_s3_bucket.example
terraform state [2]
Drag options to blanks, or click blank then click option'
Arm
Blist
Cshow
Dmv
Attempts:
3 left
💡 Hint
Common Mistakes
Using show instead of list to see all resources.
Using mv which moves resources instead of removing.
5fill in blank
hard

Fill both blanks to correctly move a resource in Terraform state and then show its details.

Terraform
terraform state [1] aws_instance.old_name aws_instance.new_name
terraform state [2] aws_instance.new_name
Drag options to blanks, or click blank then click option'
Amv
Brm
Cshow
Dlist
Attempts:
3 left
💡 Hint
Common Mistakes
Using rm instead of mv to move resources.
Using list instead of show to see resource details.