0
0
Terraformcloud~10 mins

Terraform vs CloudFormation vs Pulumi - 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 using Terraform.

Terraform
resource "aws_s3_bucket" "my_bucket" {
  bucket = "[1]"
}
Drag options to blanks, or click blank then click option'
Amy-random-bucket
Bmy-cloudformation-bucket
Cmy-terraform-bucket
Dmy-pulumi-bucket
Attempts:
3 left
💡 Hint
Common Mistakes
Using names related to other tools like CloudFormation or Pulumi.
Leaving the bucket name blank.
2fill in blank
medium

Complete the code to specify the AWS provider in Terraform.

Terraform
provider "aws" {
  region = "[1]"
}
Drag options to blanks, or click blank then click option'
Aus-west-2
Bap-southeast-1
Ceu-central-1
Dus-east-1
Attempts:
3 left
💡 Hint
Common Mistakes
Using invalid region codes.
Leaving the region blank.
3fill in blank
hard

Fix the error in the Terraform resource block by completing the missing argument.

Terraform
resource "aws_instance" "example" {
  ami           = "ami-0c55b159cbfafe1f0"
  instance_type = "[1]"
}
Drag options to blanks, or click blank then click option'
At2.micro
Bt2.small
Ct3.micro
Dm5.large
Attempts:
3 left
💡 Hint
Common Mistakes
Using instance types that do not exist or are too large for simple examples.
Leaving the instance_type blank.
4fill in blank
hard

Fill both blanks to create a Terraform output that shows the bucket name and its ARN.

Terraform
output "bucket_info" {
  value = {
    name = aws_s3_bucket.my_bucket.[1]
    arn  = aws_s3_bucket.my_bucket.[2]
  }
}
Drag options to blanks, or click blank then click option'
Abucket
Barn
Cid
Dname
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'name' instead of 'id' for the bucket name.
Mixing up 'bucket' and 'id' attributes.
5fill in blank
hard

Fill all three blanks to define a Terraform variable with a default value and description.

Terraform
variable "region" {
  type        = "[1]"
  default     = "[2]"
  description = "[3]"
}
Drag options to blanks, or click blank then click option'
Astring
Bus-east-1
CAWS region for deployment
Dnumber
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'number' type for a region variable.
Leaving description blank or unclear.