Question 1

Which of the following tasks does terraform init perform? (select three)

Question 2

What are some of the benefits that Terraform providers offer to users? (select three)

Question 3

What are some of the problems of how infrastructure was traditionally managed before Infrastructure as Code? (select three)

Question 4

Question 23: 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) 1. terraform { 2. required_providers { 3. aws = ""~> 1.2.0 4. } 5. }

Question 5

Which of the following is the best description of a dynamic block?

Question 6

You work for a retail organization that has multiple peak seasons throughout the year. During those peak seasons, your applications need to be scaled up quickly to handle the increased demand. However, the deployment of application servers is manual and new servers are only deployed when problems are reported by users. How can you reduce the effort required to deploy new resources, increase the speed of deployments, and reduce or eliminate the negative experiences of your customers?

Question 7

A new variable has been created using the list type as shown below. How would you reference terraform in your configuration? 1. variable ""products"" { 2. type = list(string) 3. default = [ 4. ""vault"", 5. ""consul"", 6. ""terraform"", 7. ""boundary"", 8. ""nomad 9. ] 10. }

Question 8

As part of a Terraform configuration, you are deploying a Linux-based server using a default image that needs to be customized based on input variables. What feature of Terraform can execute a script on the server once is has been provisioned?

Question 9

Using multi-cloud and provider-agnostic tools like Terraform provides which of the following benefit?

Question 10

True or False? Input variables that are marked as sensitive are NOT written to Terraform state.

Question 11

The command terraform destroy is actually just an alias to which command?

Question 12

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

Question 13

What function does the terraform init -upgrade command perform?

Question 14

Given a Terraform config that includes the following code, how would you reference the last instance that will be created? 1. resource ""aws_instance"" ""database"" { 2. # ... 3. for_each = { 4. ""vault"": ""value1"", 5. ""terraform"": ""value2"", 6. ""consul"": ""value3"", 7. ""nomad"": ""value4"", 8. } 9. }

Question 15

True or False? A main.tf file is always required when using Terraform?

Question 16

Scenario: You are deploying a new application and want to deploy it to multiple AWS regions within the same configuration file. Which of the following features will allow you to configure this?

Question 17

From the code below, identify the implicit dependency: 1. resource ""aws_eip"" ""public_ip"" { 2. vpc = true 3. instance = aws_instance.web_server.id 4. } 5 6. resource ""aws_instance"" ""web_server"" { 7. ami = ""ami-2757f631 8. instance_type = ""t2.micro 9. depends_on = [aws_s3_bucket.company_data] 10. }

Question 18

Larissa is interested in using a module to create an AWS VPC. She finds this code but isn't sure what all the declarations are beyond the source and version (such as name, cidr, azs, etc). What are these declarations used for? 1. module ""vpc"" { 2. source = ""terraform-aws-modules/vpc/aws 3. version = ""2.21.0 4 5. name = var.vpc_name 6. cidr = var.vpc_cidr 7 8. azs = var.vpc_azs 9. private_subnets = var.vpc_private_subnets 10. public_subnets = var.vpc_public_subnets 11 12. enable_nat_gateway = var.vpc_enable_nat_gateway 13 14. tags = var.vpc_tags 15. }

Question 19

What Terraform feature is shown in the example below? 1. resource ""aws_security_group"" ""example"" { 2. name = ""sg-app-web-01 3 4. dynamic ""ingress"" { 5. for_each = var.service_ports 6. content { 7. from_port = ingress.value 8. to_port = ingress.value 9. protocol = ""tcp 10. } 11. } 12. }

Question 20

You have been given requirements to create a security group for a new application. Since your organization standardizes on Terraform, you want to add this new security group with the fewest number of lines of code. What feature could you use to iterate over a list of required tcp ports to add to the new security group?

Question 1

Which of the following tasks does terraform init perform? (select three)

1 / 20

  • Course Set 1