Question 1mediummultiple choice
Read the full Understand Terraform's purpose explanation →TF-003 Understand Terraform's purpose • Complete Question Bank
Complete TF-003 Understand Terraform's purpose question bank — all 0 questions with answers and detailed explanations.
Refer to the exhibit.
```hcl
resource "aws_instance" "web" {
ami = "ami-0c55b159cbfafe1f0"
instance_type = "t2.micro"
}
resource "aws_s3_bucket" "data" {
bucket = "my-data-bucket"
}
```Refer to the exhibit.
```hcl
resource "aws_instance" "web" {
ami = "ami-0c55b159cbfafe1f0"
instance_type = "t2.micro"
}
resource "null_resource" "provisioner" {
provisioner "local-exec" {
command = "echo ${aws_instance.web.public_ip}"
}
}
```Drag steps to the numbered slots on the right, or tap a step then tap a slot.
Drag a concept onto its matching description — or click a concept then click the description.
Success – no errors
Error – command failed
Error – CLI argument parsing error
Error – configuration errors
Error – state lock error
Plan: 0 to add, 1 to change, 0 to destroy.
resource "aws_instance" "web" {
ami = data.aws_ami.ubuntu.id
instance_type = "t2.micro"
}
data "aws_ami" "ubuntu" {
most_recent = true
owners = ["099720109477"]
filter {
name = "name"
values = ["ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*"]
}
}aws_instance.web aws_security_group.sg
Terraform will perform the following actions:
# aws_instance.example will be updated in-place
~ resource "aws_instance" "example" {
ami = "ami-0c55b159cbfafe1f0"
~ instance_type = "t2.micro" -> "t2.small"
tags = {}
}provider "aws" {
region = "us-east-1"
}
resource "aws_s3_bucket" "mybucket" {
bucket = "my-unique-bucket-12345"
acl = "private"
}
resource "aws_s3_bucket" "mybucket" {
bucket = "my-unique-bucket-67890"
acl = "public-read"
}{
"version": 4,
"terraform_version": "1.5.0",
"resources": [
{
"mode": "managed",
"type": "aws_instance",
"name": "web",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"attributes": {
"id": "i-0a1b2c3d4e5f67890",
"instance_type": "t2.micro"
},
"dependencies": [
"aws_security_group.web_sg"
]
}
]
}
]
}terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.0"
}
}
}