0
0
Terraformcloud~10 mins

Import limitations and considerations 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 existing AWS S3 bucket into Terraform state.

Terraform
terraform import aws_s3_bucket.example [1]
Drag options to blanks, or click blank then click option'
Abucket_name
Bbucket_id
Caws_s3_bucket.example
Dexample_bucket
Attempts:
3 left
💡 Hint
Common Mistakes
Using the Terraform resource name instead of the actual bucket name.
Using a placeholder like 'bucket_id' instead of the real identifier.
2fill in blank
medium

Complete the code to import an AWS EC2 instance with the correct ID format.

Terraform
terraform import aws_instance.web [1]
Drag options to blanks, or click blank then click option'
Ai-1234567890abcdef0
Binstance-1234
Cweb-instance
Daws_instance.web
Attempts:
3 left
💡 Hint
Common Mistakes
Using the resource name or tag instead of the instance ID.
Using an incorrect ID format.
3fill in blank
hard

Fix the error in the import command by choosing the correct resource address format.

Terraform
terraform import [1] my-resource-id
Drag options to blanks, or click blank then click option'
Amy_bucket.aws_s3_bucket
Baws_s3_bucket/my_bucket
Caws_s3_bucket.my_bucket
Dmy_bucket
Attempts:
3 left
💡 Hint
Common Mistakes
Using slashes instead of dots in resource addresses.
Reversing resource type and name order.
4fill in blank
hard

Fill both blanks to correctly import a resource and specify its ID.

Terraform
terraform import [1] [2]
Drag options to blanks, or click blank then click option'
Aaws_db_instance.prod_db
Bdb-prod-01
Cprod_db_instance
Daws_db_instance/db-prod-01
Attempts:
3 left
💡 Hint
Common Mistakes
Using slashes in resource address.
Using resource name instead of resource ID.
5fill in blank
hard

Fill the blanks to import an AWS IAM user with the correct resource address and user name.

Terraform
terraform import [1] [2]
Drag options to blanks, or click blank then click option'
Aaws_iam_user.admin
Badmin-user
Caws_iam_user/admin-user
Dadmin
Attempts:
3 left
💡 Hint
Common Mistakes
Using slashes in resource address.
Using incorrect user name format.