As a member of an operations team that uses infrastructure as code (lac) practices, you are tasked with making a change to an infrastructure stack running in a public cloud. Which pattern would follow laC best practices for making a change?
Answer : E
You do not need to use different Terraform commands depending on the cloud provider you use. Terraform commands are consistent across different providers, as they operate on the Terraform configuration files and state files, not on the provider APIs directly.
What functionality do providers offer in Terraform? (Pick the 3 correct responses below.)
Answer : B, C, D
Rationale for Correct Answer:
B: Providers can manage on-premises services (e.g., vSphere, Kubernetes, GitHub, DNS, databases), not just public cloud.
C: Providers provision and manage public cloud resources (AWS, Azure, Google Cloud, etc.).
D: Providers are the plugin layer that interacts with APIs (cloud/service APIs) to create, read, update, and delete resources.
Analysis of Incorrect Options (Distractors):
A: This describes how Terraform configuration and state are organized (root module/workspace/state), not a provider function.
E: Policy enforcement is handled by separate policy-as-code systems (e.g., Sentinel/OPA integrations) rather than being a core provider responsibility.
Key Concept: Providers as plugins that implement resource/data source types and perform API interactions for many platforms.
====================
Why would you use the -replace flag for terraform apply?
Answer : D
The -replace flag is used with the terraform apply command when there is a need to explicitly force Terraform to destroy and then recreate a specific resource during the next apply. This can be necessary in situations where a simple update is insufficient or when a resource must be re-provisioned to pick up certain changes.
You can define multiple backend blocks in your Terraform configuration to store your state in multiple locations.
Answer : B
Rationale for Correct Answer: A Terraform configuration supports only one backend at a time. The backend determines where state is stored and how locking works. Terraform does not support writing the same state to multiple backends simultaneously via multiple backend blocks.
Analysis of Incorrect Options (Distractors):
A (True): Incorrect---Terraform allows only a single backend configuration for a given working directory/root module.
Key Concept: Single-backend design: one state location per configuration/workspace.
You want to define a single input variable to capture configuration values for a server. The values must represent memory as a number, and the server name as a string.
Which variable type could you use for this input?
Answer : B
This is the variable type that you could use for this input, as it can store multiple attributes of different types within a single value. The other options are either invalid or incorrect for this use case.
Which of the following ate advantages of using infrastructure as code (laC) instead of provisioning with a graphical user interface (GUI)? Choose two correct answers.
Answer : A, D
It lets you version, reuse, and share infrastructure configuration as code files, which can be stored in a source control system and integrated with your CI/CD pipeline.
It reduces risk of operator error by automating repetitive tasks and ensuring consistency across environments. IaC does not necessarily provision resources at a lower cost, secure your credentials, or prevent manual modifications to your resources - these depend on other factors such as your cloud provider, your security practices, and your access policies.
What is the provider for this resource?

Answer : D
In the given Terraform configuration snippet:
resource 'aws_vpc' 'main' {
name = 'test'
}
The provider for the resource aws_vpc is aws. The provider is specified by the prefix of the resource type. In this case, aws_vpc indicates that the resource type vpc is provided by the aws provider.
Terraform documentation on providers: Terraform Providers