0
0
Terraformcloud~10 mins

Creating your first resource in Terraform - Interactive Practice

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

Complete the code to define an AWS S3 bucket resource with the name 'my_bucket'.

Terraform
resource "aws_s3_bucket" "[1]" {
  bucket = "my-unique-bucket-name"
}
Drag options to blanks, or click blank then click option'
As3_bucket
Bbucket_name
Cmy_bucket
Dbucket
Attempts:
3 left
💡 Hint
Common Mistakes
Using the actual bucket name instead of a resource identifier.
Using invalid characters or spaces in the resource name.
2fill in blank
medium

Complete the code to specify the AWS provider version in Terraform.

Terraform
terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "[1]"
    }
  }
}
Drag options to blanks, or click blank then click option'
A"~> 4.0"
B"^ 4.0"
C"~> 2.0"
D"= 3.0"
Attempts:
3 left
💡 Hint
Common Mistakes
Using '^ 4.0' which has invalid syntax (space after ^).
Using exact version '=' which is too restrictive.
3fill in blank
hard

Fix the error in the resource block by completing the missing attribute for the AWS EC2 instance type.

Terraform
resource "aws_instance" "example" {
  ami           = "ami-0c55b159cbfafe1f0"
  [1] = "t2.micro"
}
Drag options to blanks, or click blank then click option'
Avm_type
Binstance_type
Cec2_type
Dtype_instance
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect attribute names like 'type_instance' or 'vm_type'.
Omitting the instance type attribute entirely.
4fill in blank
hard

Fill both blanks to create a resource block for an AWS security group with a description and a name.

Terraform
resource "aws_security_group" "[1]" {
  name        = "[2]"
  description = "Allow SSH access"
}
Drag options to blanks, or click blank then click option'
Assh_sg
Bweb_sg
Cssh_security_group
Dssh-access
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing resource name and AWS resource name.
Using spaces or invalid characters in names.
5fill in blank
hard

Fill all three blanks to define an AWS IAM user resource with a name, path, and tags.

Terraform
resource "aws_iam_user" "[1]" {
  name = "[2]"
  path = "[3]"
  tags = {
    Environment = "Dev"
  }
}
Drag options to blanks, or click blank then click option'
Adev_user
Bdeveloper
C/developers/
D/dev/
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing resource name with IAM user name.
Using paths without slashes or invalid characters.