Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to import an AWS S3 bucket resource using the new import block syntax.
Terraform
resource "aws_s3_bucket" "example" { bucket = "my-bucket" import { id = [1] } }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a different bucket name than the resource's bucket attribute.
Omitting quotes around the bucket name.
✗ Incorrect
The import block's id must match the actual resource identifier, which is the bucket name "my-bucket" here.
2fill in blank
mediumComplete the import block to import an AWS EC2 instance with ID i-1234567890abcdef0.
Terraform
resource "aws_instance" "web" { ami = "ami-0c55b159cbfafe1f0" instance_type = "t2.micro" import { id = [1] } }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using the AMI ID instead of the instance ID.
Using the resource name instead of the instance ID.
✗ Incorrect
The import block id for an EC2 instance is the instance ID string, here "i-1234567890abcdef0".
3fill in blank
hardFix the error in the import block by completing the id field correctly for a Google Cloud Storage bucket named 'my-gcs-bucket'.
Terraform
resource "google_storage_bucket" "bucket" { name = "my-gcs-bucket" import { id = [1] } }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using only the bucket name as the id.
Using an incorrect resource path format.
✗ Incorrect
Google Cloud Storage buckets require the full resource path as the import id, like "projects/_/buckets/my-gcs-bucket".
4fill in blank
hardComplete the import block to import an Azure resource group named 'my-resource-group' with the correct id.
Terraform
resource "azurerm_resource_group" "rg" { name = "my-resource-group" location = "East US" import { id = [1] } }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using only the resource group name as id.
✗ Incorrect
The import id for Azure resource groups is the full resource ID path "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group".
5fill in blank
hardFill both blanks to import a Kubernetes namespace named 'dev-namespace' with the correct id and provider alias 'k8s'.
Terraform
provider "kubernetes" { alias = "k8s" config_path = "~/.kube/config" } resource "kubernetes_namespace" "dev" { metadata { name = "dev-namespace" } import { id = [1] provider = [2] } }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect provider reference syntax.
Using wrong id strings.
✗ Incorrect
The import id is the namespace name "dev-namespace", and the provider uses the alias 'k8s' referenced as kubernetes.k8s.