This repo is agregated guide for preparation to Hashicorp terraform associate exam
exam booking guide
Check list before exam
How can you reference all of the subnets that are created by this resource block?
#Deploy the private subnets
resource "aws_subnet" "private_subnets" {
for_each = var.private_subnets
vpc_id = aws_vpc.vpc.id
cidr_block = cidrsubnet(var.vpc_cidr, 8, each.value)
availability_zone = tolist(data.aws_availability_zones.available.names)[each.value]
tags = {
Name = each.key
Terraform = "true"
}
}
Answer
aws_subnet.private_subnets[*]
What two options are available to delete all of your managed infrastructure?
Answer
terraform destroy
terraform apply -destroy
Which option will you use to run provisioners that are not associated with any resources?
A. Local-exec
B. Null_resource
C. Salt-masterless
D. Remote-exec
Answer
Option B is correct If you need to run provisioners that aren’t directly associated with a specific resource, you can associate them with a null_resource.