Terraform Quiz Questions and Answers

Terry is using a module to deploy some EC2 instances on AWS for a new project. He is viewing the code that is calling the module for deployment, which is shown below. Where is the value of the security group originating? module "ec2_instances " { source = "terraform-aws-modules/ec2-instance/aws " version = "2.12.0 " name = "my-ec2-cluster " instance_count = 2 ami = "ami-0c5204531f799e0c6 " instance_type = "t2.micro " vpc_security_group_ids = [module.vpc.default_security_group_id] subnet_id = module.vpc.public_subnets[0] tags = { Terraform = " True " Environment = "dev " }

Answer :
  • the output of another module

When using constraint expressions to signify a version of a provider, which of the following are valid provider versions that satisfy the expression found in the following code snippet? (Select two) terraform { required_providers { aws = "~ > 1.2.0 " } }

Answer :
  • 1.2.3
  • 1.2.9

Can we delete a specific resource with terraform destroy command?

Answer :
  • True

Your organization has moved to AWS and has manually deployed infrastructure using the console. Recently, a decision has been made to standardize Terraform for all deployments moving forward. What can you do to ensure that all existing is managed by Terraform moving forward without interruption to existing services?

Answer :
  • Using terraform-import, import the existing infrastructure into your Terraform state

Given the following snippet of code, what does servers = 4 reference? module "servers " { source = "./modules/aws-servers " servers = 4 }

Answer :
  • the value of an input variable

What is the git command that downloads your repository from Github to your computer?

Answer :
  • git clone

Terraform can't load all the configuration files within the specified directory.

Answer :
  • False

____________ are used to execute scripts on local or remote machines as part of resource creation or destruction.

Answer :
  • Provisioners

Terraform allows us to have multiple workspaces.

Answer :
  • True

____________ is used to import existing infrastructure.

Answer :
  • terraform import