0
0
Terraformcloud~10 mins

Terraform import command - Interactive Code Practice

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

Complete the command to import an AWS S3 bucket named 'my-bucket' into Terraform state.

Terraform
terraform import [1] my-bucket
Drag options to blanks, or click blank then click option'
Aaws_lambda_function.func
Baws_instance.my_instance
Caws_vpc.main
Daws_s3_bucket.my-bucket
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong resource type like aws_instance or aws_vpc.
Forgetting to specify the resource name after the resource type.
2fill in blank
medium

Complete the command to import an AWS EC2 instance with ID 'i-1234567890abcdef0' into Terraform state.

Terraform
terraform import [1] i-1234567890abcdef0
Drag options to blanks, or click blank then click option'
Aaws_instance.my_ec2
Baws_iam_role.role
Caws_security_group.sg
Daws_s3_bucket.my_bucket
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong resource type like aws_s3_bucket or aws_security_group.
Using the instance ID as the resource name instead of the import ID.
3fill in blank
hard

Fix the error in the import command to correctly import an AWS VPC with ID 'vpc-0a1b2c3d4e5f6g7h8'.

Terraform
terraform import [1] vpc-0a1b2c3d4e5f6g7h8
Drag options to blanks, or click blank then click option'
Aaws_vpc.main
Baws_instance.main
Caws_subnet.main
Daws_route_table.main
Attempts:
3 left
💡 Hint
Common Mistakes
Using resource types for instances or subnets instead of VPC.
Using incorrect resource names that do not exist in the configuration.
4fill in blank
hard

Fill both blanks to import an AWS IAM role named 'my-role' with ARN 'arn:aws:iam::123456789012:role/my-role'.

Terraform
terraform import [1] [2]
Drag options to blanks, or click blank then click option'
Aaws_iam_role.my-role
Baws_iam_policy.my_policy
Carn:aws:iam::123456789012:role/my-role
Dmy-role
Attempts:
3 left
💡 Hint
Common Mistakes
Using the role name instead of the ARN for the import ID.
Using the wrong resource type like aws_iam_policy.
5fill in blank
hard

Fill both blanks to import an AWS RDS instance with identifier 'mydbinstance' into Terraform state.

Terraform
terraform import [1] [2]
Drag options to blanks, or click blank then click option'
Aaws_db_instance.mydb
Bmydbinstance
Caws_rds_instance.mydb
Daws_db_instance.mydbinstance
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect resource types like aws_rds_instance.
Using the wrong import ID or resource name.