TF-003 Understand IaC concepts • Complete Question Bank
Complete TF-003 Understand IaC concepts 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"
provisioner "local-exec" {
command = "echo ${aws_instance.web.public_ip} > ip.txt"
}
}
```Drag steps to the numbered slots on the right, or tap a step then tap a slot.
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.
Initialize a working directory with provider plugins
Create an execution plan
Execute the actions proposed in a plan
Destroy previously-created infrastructure
Check configuration for syntax and internal consistency
Drag a concept onto its matching description — or click a concept then click the description.
Organize state and runs for different environments
Integrate third-party policy or compliance checks
Policy as code framework for governance
Store state securely in Terraform Cloud
Trigger runs automatically from version control
# terraform plan output
Terraform will perform the following actions:
# aws_instance.web will be created
+ resource "aws_instance" "web" {
+ ami = "ami-0c55b159cbfafe1f0"
+ instance_type = "t2.micro"
+ tags = {
+ "Name" = "WebServer"
}
}
# aws_instance.db will be destroyed
- resource "aws_instance" "db" {
- ami = "ami-0c55b159cbfafe1f0" -> null
- instance_type = "t2.micro" -> null
}
Plan: 1 to add, 0 to change, 1 to destroy.resource "aws_instance" "web" {
ami = "ami-0c55b159cbfafe1f0"
instance_type = "t2.micro"
tags = {
Name = "WebServer"
}
lifecycle {
create_before_destroy = true
}
}# backend.tf
terraform {
backend "s3" {
bucket = "my-terraform-state"
key = "prod/terraform.tfstate"
region = "us-east-1"
}
}terraform {
backend "s3" {
bucket = "mycompany-terraform-state"
key = "prod/terraform.tfstate"
region = "us-east-1"
dynamodb_table = "terraform-state-lock"
}
}resource "aws_instance" "web" {
ami = "ami-0c55b159cbfafe1f0"
instance_type = "t2.micro"
tags = {
Name = "WebServer"
}
}resource "aws_iam_user" "example" {
path = "/system/"
}