The Terraform Associate 004 certification validates a professional's proficiency in using HashiCorp Terraform to manage infrastructure as code. It covers the fundamental concepts of provisioning and managing cloud resources across multiple providers using a declarative configuration language. Holding the symbol TERRA_A_004 demonstrates the technical skills needed to automate infrastructure deployment and ensure consistency in the cloud.
---------- Question 1
You have a set of legacy infrastructure resources that were created manually through the cloud provider console. You want to start managing these resources using Terraform without destroying and recreating them. Which Terraform command should you use to bring these existing resources under Terraform management?
- terraform plan -import
- terraform refresh
- terraform import
- terraform pull
---------- Question 2
A team is developing a complex Terraform configuration that requires a specific version of the HashiCorp AWS provider to ensure compatibility with certain legacy resources. They also need to use a community-developed provider for a third-party SaaS platform. How should the team properly manage these provider requirements and their respective versions within the Terraform block?
- They should use the required_providers block to specify the source address and version constraints for both the official and community providers.
- They must manually download the provider binaries and place them in the root directory of their project before running any Terraform commands.
- Terraform automatically detects the required versions by scanning the resource blocks, so explicit version definitions in the configuration are considered bad practice.
- They should use the terraform init -upgrade command which will automatically generate the source and version requirements based on the resources used.
---------- Question 3
A developer is troubleshooting a provider error that only occurs during the apply phase. They need to see the raw HTTP requests and responses between Terraform and the cloud API to identify the issue. How can they enable this level of detail in the console output?
- By setting the environment variable TF_LOG to the value TRACE before running the terraform apply command.
- By adding the --verbose flag to the terraform apply command and specifying the level as level-5.
- By enabling the verbose_logging = true argument inside the provider block for the specific cloud service being used.
- By running the terraform inspect command on the state file and looking for the network_logs attribute in the JSON output.
---------- Question 4
An engineer is troubleshooting a provider-related error that only occurs during the application phase. The error message provided by the CLI is too vague to identify the root cause. Which environment variable should the engineer set to see the raw API requests and responses between Terraform and the cloud provider, and what is the most detailed level available?
- Set the TF_LOG environment variable to TRACE to enable the most verbose logging output, which includes every internal step and API communication details.
- Set the TERRAFORM_DEBUG variable to 1 to enable the developer mode, which prints the stack trace of the Terraform binary whenever an error occurs during execution.
- Set the TF_LOG_LEVEL variable to INFO to filter out all non-essential messages and focus only on the specific API calls that returned an error code.
- Set the TF_VERBOSE_LOGGING variable to true and provide a path to a log file where the provider will dump its internal debugging information.
---------- Question 5
A global enterprise is transitioning from manual infrastructure provisioning to using Terraform for their multi-cloud strategy involving AWS and Azure. They want to ensure that their infrastructure is reproducible and that they can use the same workflow regardless of the cloud provider. Which specific advantage of the Infrastructure as Code pattern allows them to manage these diverse environments using a single toolset while remaining service-agnostic?
- Terraform provides a single unified API that abstracts all cloud provider differences into a universal resource syntax that never changes between vendors.
- Terraform utilizes a provider-based architecture where specific plugins interface between the HCL core and the cloud APIs, allowing for a consistent workflow across multiple platforms.
- Terraform acts as a local agent on virtual machines to automatically detect manual changes and revert them to the desired state without requiring a central server.
- Terraform requires all cloud providers to adhere to the HashiCorp Standard Specification, which ensures that an S3 bucket and an Azure Blob use the exact same resource arguments.
---------- Question 6
A junior administrator is attempting to deploy a new infrastructure stack and has just finished writing the HCL files. They run the terraform plan command but receive an error stating that the provider plugins are missing. Which step of the Core Terraform Workflow did the administrator neglect to perform before attempting to generate an execution plan?
- The administrator forgot to run terraform validate to ensure that the syntax of the provider blocks was written correctly.
- The administrator skipped the terraform init command, which is responsible for downloading the necessary provider plugins and preparing the working directory.
- The administrator did not run terraform fmt, which is a mandatory step that must be completed before Terraform allows any planning operations.
- The administrator failed to create a manual .terraform directory and copy the provider binaries into it from the HashiCorp website.
---------- Question 7
A developer needs to create a variable that can hold a list of objects, where each object contains a string for a username and a number for an age. Which Terraform complex type definition correctly represents this data structure to ensure strict type checking during execution?
- type = list(any)
- type = map(string)
- type = list(object({ username = string, age = number }))
- type = set(tuple([string, number]))
---------- Question 8
After successfully applying a configuration, a developer realizes they need to change the formatting of their files to meet the teams style guidelines. Additionally, they want to remove all resources managed by the current configuration to avoid unnecessary costs. Which two Terraform commands should be used to achieve these specific goals of formatting and infrastructure removal?
- terraform fmt and terraform destroy
- terraform clean and terraform delete
- terraform style and terraform remove
- terraform lint and terraform terminate
---------- Question 9
A system administrator notices that a security group rule was manually modified in the AWS Console, but the Terraform configuration remains unchanged. This discrepancy is known as drift. When the administrator runs a terraform plan, how does Terraform detect this drift, and what action will it propose to resolve the discrepancy in the next step?
- Terraform ignores the manual change because it only cares about what is in the configuration files and will do nothing until the code is updated.
- Terraform compares the current state file against the remote infrastructure during the refresh phase and proposes to revert the manual change to match the code.
- Terraform will automatically update the configuration files to match the manual changes made in the AWS Console to ensure the code is always current.
- Terraform will fail with a checksum mismatch error and refuse to run until the manual changes are deleted from the AWS Console by the administrator.
---------- Question 10
An engineer needs to create multiple AWS EC2 instances, but the number of instances varies based on the environment (development vs. production). They also need to ensure that each instance has a unique tag based on its index. Which Terraform feature is most appropriate for iterating over a list or count to create these resources efficiently within a single block?
- Use a series of nested if-else statements within the resource block to define each instance manually based on the environment name.
- Use the count meta-argument to specify the number of instances and use the count.index property to provide a unique value for each resource tag.
- Use the terraform loop command to execute the resource block multiple times, passing a different variable each time the command runs.
- Use the dynamic block syntax which is specifically designed for creating multiple top-level resources like EC2 instances from a map variable.
Are they useful?
Click here to get 360 more questions to pass this certification at the first try! Explanation for each answer is included!
Follow the below LINKEDIN channel to stay updated about 89+ exams!

Comments
Post a Comment