Exam 2 Review Flashcards
Where are TF plugins downloaded and stored on the server?
By default, terraform init downloads plugins into a subdirectory of the working directory, .terraform/providers
so that each working directory is self-contained.
Explicit dependencies in Terraform are dependencies that are explicitly declared in the Terraform configuration. These dependencies are used to control
the order in which Terraform creates, updates, and destroys resources.
In Terraform, you can declare explicit dependencies using the depends_on
argument in a resource block.
Explain how the depends_on
argument works?
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.
What is the main benefit of using the depends_on
argument?
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.
Terraform Cloud supports the following VCS providers as of February 2023:
GitHub
GitLab
BitBucket
Azure DevOps Server
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] }
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
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?
By default, Terraform will provision resources concurrently with a maximum of 10 concurrent resource operations.
terraform apply - refresh-only
- this command is used to
reconcile any changes to the real-world resources and update state to reflect those changes.