Terraform Associate Exam 2

1 / 10

Question

You’ve been assigned to work on a Terraform project that uses remote state storage to manage state across multiple team members. During a Terraform apply, you encounter the following error:

Error: Lock failed
The state cannot be acquired. This may be due to another user or process holding a lock.

What is the most likely cause of this error, and how should you resolve it?

2 / 10

Question

You are tasked with managing a large-scale multi-cloud infrastructure deployment using Terraform. The team uses Terraform modules extensively, and you notice that resource dependencies are sometimes not clear, leading to unexpected resource creation order or failures.

How can you explicitly define dependencies between resources in Terraform to avoid these issues?

3 / 10

Question

Your team uses Terraform modules to deploy AWS resources across different accounts. You recently noticed that a module is being invoked multiple times with slightly different configurations, causing resources to overlap and conflicts. To address this issue, you want to ensure the unique identification of module instances across different deployments.

Which approach should you use to avoid this issue?

4 / 10

Question

You are part of a team using Terraform to manage AWS infrastructure. During a recent Terraform apply, you accidentally applied changes to the wrong environment. To mitigate the impact, you need to rollback the changes safely without destroying all the resources in the environment.

Which Terraform command should you use to undo only the recent changes without affecting the entire state or resources?

5 / 10

Question

You are using Terraform to manage infrastructure in AWS. Your team uses modules extensively to standardize code, but you notice that changes in one environment unexpectedly affect resources in other environments.

Which of the following is the most likely cause of this issue?

6 / 10

Question

You are collaborating on a Terraform project with a team. The team has implemented remote state storage with Amazon S3 and state locking with DynamoDB. During the execution of a Terraform run, you encounter an error stating that Terraform cannot access the S3 remote state due to insufficient permissions.

What is the most likely reason for this error?

7 / 10

Question

You are managing a Terraform project that uses modules to deploy AWS resources across multiple environments (development, staging, production). You want to ensure that configuration settings like VPC CIDR blocks or instance sizes vary across these environments without duplicating code.

Which Terraform feature should you use to make this configuration dynamic and environment-specific?

8 / 10

Question

You are working on a team that uses Terraform with remote state storage in AWS S3 and state locking with DynamoDB. Your team notices that when changes are applied, Terraform is taking a long time to compute the plan and apply. You suspect that the remote state is unnecessarily large due to storing resources that are no longer needed.

What is the recommended approach to optimize Terraform’s state file and ensure only necessary resources are included?

9 / 10

Question

You are managing Terraform in a production environment. Your team has been tasked to set up logging for Terraform operations to monitor and debug changes. You need to ensure that logs are stored securely and persist across runs.

Which approach is the most appropriate to achieve this?

10 / 10

Question

You are working on a Terraform project that provisions resources in AWS. Your team uses remote state storage with S3 and has enabled DynamoDB for state locking to prevent simultaneous changes. However, you notice that during certain deployments, Terraform fails with an error stating that the state is locked by another operation.

What should you do to resolve this issue safely?

Your score is

The average score is 0%

0%