Exam 2 Review Flashcards

1
Q

Where are TF plugins downloaded and stored on the server?

A

By default, terraform init downloads plugins into a subdirectory of the working directory, .terraform/providers so that each working directory is self-contained.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Explicit dependencies in Terraform are dependencies that are explicitly declared in the Terraform configuration. These dependencies are used to control

A

the order in which Terraform creates, updates, and destroys resources.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

In Terraform, you can declare explicit dependencies using the depends_on argument in a resource block.

Explain how the depends_on argument works?

A

The depends_on argument takes a list of resource names and specifies that the resource block in which it is declared depends on those resources.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the main benefit of using the depends_onargument?

A

By declaring explicit dependencies, you can ensure that Terraform creates resources in the correct order, so that dependent resources are available before other resources that depend on them.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Terraform Cloud supports the following VCS providers as of February 2023:

A

GitHub
GitLab
BitBucket
Azure DevOps Server

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

From the code below, identify the implicit dependency:

resource "aws_eip" "public_ip" {
    vpc = true
    instance = aws_instance.web_server.id
}
 
resource "aws_instance" "web_server" {
  ami           = "ami-2757f631"
  instance_type = "t2.micro"
  depends_on = [aws_s3_bucket.company_data]
}
A

The EC2 instance labeled web_server is the implicit dependency as the aws_eip cannot be created until the aws_instance labeled web_server has been provisioned and the id is available.

Note that aws_s3_bucket.company_data is an explicit dependency for the aws_instance.web_server

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

In order to reduce the time it takes to provision resources, Terraform uses parallelism. By default, how many resources will Terraform provision concurrently during a terraform apply?

A

By default, Terraform will provision resources concurrently with a maximum of 10 concurrent resource operations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

terraform apply - refresh-only - this command is used to

A

reconcile any changes to the real-world resources and update state to reflect those changes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly