Courseiva
Knowledge + Practice
CertificationsVendorsCareer RoadmapsLabs & ToolsStudy GuidesGlossaryPractice Questions
C
Courseiva

Free IT certification practice questions with explained answers for CCNA, CompTIA, AWS, Azure, Google Cloud, and more.

Certification Practice Questions

CCNA practice questionsSecurity+ SY0-701 practice questionsAWS SAA-C03 practice questionsAZ-104 practice questionsAZ-900 practice questionsCLF-C02 practice questionsA+ Core 1 practice questionsGoogle Cloud ACE practice questionsCySA+ CS0-003 practice questionsNetwork+ N10-009 practice questions
View all certifications →

Product

CertificationsCertification PathsExam TopicsPractice TestsExam Dumps vs Practice TestsStudy HubComparisons

Company

AboutContactEditorial PolicyQuestion Writing PolicyTrust Center

Legal

Privacy PolicyTerms of Service

Courseiva is a free IT certification practice platform offering original exam-style practice questions, detailed explanations, topic-based practice, mock exams, readiness tracking, and study analytics for Cisco, CompTIA, Microsoft, AWS, and other technology certifications.

© 2026 Courseiva. Courseiva is operated by JTNetSolutions Ltd. All rights reserved.

Courseiva is an independent certification practice platform and is not affiliated with, endorsed by, or sponsored by Cisco, Microsoft, AWS, CompTIA, Google, ISC2, ISACA, or any other certification vendor. Vendor names and certification marks are used only to identify the exams learners are preparing for.

← Interact with Terraform modules practice sets

TF-003 Interact with Terraform modules • Complete Question Bank

TF-003 Interact with Terraform modules — All Questions With Answers

Complete TF-003 Interact with Terraform modules question bank — all 0 questions with answers and detailed explanations.

65
Questions
Free
No signup
Certifications/TF-003/Practice Test/Interact with Terraform modules/All Questions
Question 1easymultiple choice
Read the full Interact with Terraform modules explanation →

A team is using a module from the public Terraform Registry. They want to ensure that the module is pinned to a specific version to avoid unexpected changes. Which approach should they use?

Question 2mediummultiple choice
Review the full subnetting walkthrough →

An engineer is refactoring a monolithic Terraform configuration into reusable modules. One module outputs a list of subnet IDs. Another module needs to use these subnet IDs to create resources. What is the best way to pass this data between modules?

Question 3hardmultiple choice
Read the full Interact with Terraform modules explanation →

A developer creates a module that provisions an AWS EC2 instance and an S3 bucket. The module outputs the instance ID and bucket ARN. When using this module, the root configuration references module.my_module.instance_id and module.my_module.bucket_arn. After running terraform apply, they notice that the bucket ARN is empty. What is the most likely cause?

Question 4mediummulti select
Read the full Interact with Terraform modules explanation →

Which TWO statements about Terraform module sources are correct? (Select TWO.)

Question 5hardmulti select
Read the full Interact with Terraform modules explanation →

Which THREE practices are recommended when using Terraform modules? (Select THREE.)

Question 6mediummultiple choice
Read the full Interact with Terraform modules explanation →

The above configuration references a module from the Terraform Registry. After running 'terraform init', the user runs 'terraform plan' and gets an error: 'Error: Unsupported argument' for 'version'. What is the most likely cause?

Exhibit

Refer to the exhibit.

```hcl
module "vpc" {
  source = "terraform-aws-modules/vpc/aws"
  version = "3.19.0"
  name = "my-vpc"
  cidr = "10.0.0.0/16"
  azs  = ["us-east-1a", "us-east-1b"]
  private_subnets = ["10.0.1.0/24", "10.0.2.0/24"]
  public_subnets  = ["10.0.101.0/24", "10.0.102.0/24"]
}

output "vpc_id" {
  value = module.vpc.vpc_id
}
```
Question 7hardmultiple choice
Read the full Interact with Terraform modules explanation →

After running 'terraform apply', the user sees that the 'aws_s3_bucket_object' is created successfully, but the bucket name is not as expected. What is the most likely reason?

Exhibit

Refer to the exhibit.

```hcl
module "bucket" {
  source = "./modules/s3-bucket"
  bucket_name = "my-app-data"
}

resource "aws_s3_bucket_object" "config" {
  bucket = module.bucket.bucket_name
  key    = "config.json"
  source = "config.json"
}
```

The module at './modules/s3-bucket' contains:

```hcl
variable "bucket_name" {}
resource "aws_s3_bucket" "this" {
  bucket = var.bucket_name
}
output "bucket_name" {
  value = aws_s3_bucket.this.id
}
```
Question 8hardmultiple choice
Read the full Interact with Terraform modules explanation →

You are a DevOps engineer at a company that manages infrastructure for multiple environments (dev, staging, prod) using Terraform. The team has created a reusable module for deploying an AWS ECS Fargate service. The module accepts variables for environment name, container image tag, and desired count. The module is stored in a private Git repository. The root configurations for each environment are stored in separate directories, each with its own backend configuration. Recently, a developer added a new feature to the module that requires a new variable 'enable_xray' (boolean, default false). After updating the module source to point to the new commit, the developer runs 'terraform init' and 'terraform plan' in the dev environment. The plan shows that the ECS service will be updated, but the output does not show any changes related to X-Ray. The developer expected that setting 'enable_xray = true' in the dev root module would enable X-Ray tracing. However, the plan shows no changes to the task definition. What is the most likely cause?

Question 9mediummultiple choice
Read the full Interact with Terraform modules explanation →

A team is using a module from the Terraform Registry. They want to ensure that changes to the module's source version are tested in a non-production environment before being applied to production. Which approach best supports this workflow?

Question 10hardmulti select
Read the full Interact with Terraform modules explanation →

Which TWO statements about Terraform module structure and best practices are correct? (Choose two.)

Question 11easymultiple choice
Read the full VPN explanation →

Refer to the exhibit. The configuration fails with an error indicating that the module does not support the 'enable_vpn_gateway' argument. What is the most likely cause?

Exhibit

Refer to the exhibit.

```hcl
module "vpc" {
  source  = "terraform-aws-modules/vpc/aws"
  version = "3.18.0"

  name = "my-vpc"
  cidr = "10.0.0.0/16"

  azs             = ["us-east-1a", "us-east-1b"]
  private_subnets = ["10.0.1.0/24", "10.0.2.0/24"]
  public_subnets  = ["10.0.101.0/24", "10.0.102.0/24"]

  enable_nat_gateway = true
  enable_vpn_gateway = true

  tags = {
    Terraform = "true"
    Environment = "dev"
  }
}
```
Question 12hardmultiple choice
Read the full DNS explanation →

You are managing a Terraform configuration that uses a public module from the registry to deploy an AWS VPC. The module is defined with a version constraint of '~> 3.0'. After running 'terraform init', you run 'terraform plan' and notice that the plan output indicates the module will be updated from version 3.18.0 to 3.20.1. However, you are concerned because the module's changelog shows that version 3.19.0 introduced a breaking change: it removed the 'enable_dns_hostnames' variable and replaced it with 'enable_dns_support'. Your configuration currently uses the 'enable_dns_hostnames' variable. You want to avoid any breaking changes in the production environment while still receiving non-breaking updates. What should you do?

Question 13easymulti select
Read the full Interact with Terraform modules explanation →

Which TWO options are valid ways to reference a Terraform module from a registry?

Question 14hardmultiple choice
Read the full VPN explanation →

A developer runs `terraform plan` and receives the error: "Error: Unsupported argument; An argument named 'enable_vpn_gateway' is not expected here." What is the most likely cause?

Exhibit

Refer to the exhibit.

```hcl
module "vpc" {
  source = "terraform-aws-modules/vpc/aws"
  version = "5.0.0"
  name = "my-vpc"
  cidr = "10.0.0.0/16"
  azs             = ["us-east-1a", "us-east-1b"]
  private_subnets = ["10.0.1.0/24", "10.0.2.0/24"]
  public_subnets  = ["10.0.101.0/24", "10.0.102.0/24"]
  enable_nat_gateway = true
  enable_vpn_gateway = false
}

output "vpc_id" {
  value = module.vpc.vpc_id
}
```
Question 15mediummultiple choice
Read the full NAT/PAT explanation →

Your company manages infrastructure for multiple environments (dev, staging, prod) using Terraform. You have a shared networking module stored in a private Git repository. The module is used by several root configurations. The current workflow requires developers to manually update the module version in each root module's source attribute when a new version is tagged. This has led to configuration drift and occasional use of incompatible module versions. You want to implement a more reliable approach that ensures all environments use the same consistent version of the module, while still allowing controlled upgrades. Which approach best addresses this concern?

Question 16mediummulti select
Read the full Interact with Terraform modules explanation →

Which three of the following describe correct practices or behaviors when interacting with Terraform modules? (Choose three.)

Question 17mediummulti select
Read the full Interact with Terraform modules explanation →

Which four of the following statements about interacting with Terraform modules are correct? (Choose four.)

Question 18mediumdrag order
Read the full Interact with Terraform modules explanation →

Drag and drop the steps to manage Terraform state locking with a backend in the correct order.

Drag steps to the numbered slots on the right, or tap a step then tap a slot.

Steps
Order
1Step 1
2Step 2
3Step 3
4Step 4
5Step 5
Question 19mediummatching
Read the full Interact with Terraform modules explanation →

Match each Terraform function to its category.

Drag a concept onto its matching description — or click a concept then click the description.

Concepts
Matches

List function

Map function

IP network function

Encoding function

Date and time function

Question 20mediummultiple choice
Read the full Interact with Terraform modules explanation →

A team is using a private module registry from a third-party vendor. When running terraform init, they receive an error: 'Error downloading module: could not download module... server responded with 401 Unauthorized'. What is the most likely cause?

Question 21hardmultiple choice
Read the full Interact with Terraform modules explanation →

A module block references a module with version constraint '>= 2.0, < 3.0'. An older version 1.5 is already cached from a previous init. The team wants to ensure they use a newer version. After running terraform init -upgrade, what happens?

Question 22easymultiple choice
Read the full Interact with Terraform modules explanation →

A Terraform module defines an output 'instance_ips'. In the root module, how should this value be referenced?

Question 23mediummultiple choice
Read the full Interact with Terraform modules explanation →

A developer creates a directory structure with a module located at './modules/networking'. The root configuration references it with source = './modules/networking'. What is the behavior when running terraform init from the root directory?

Question 24hardmultiple choice
Review the full subnetting walkthrough →

An organization uses Terraform modules to provision multiple environments. They have a module 'vpc' that uses a for_each argument in the root module to create VPCs per environment. Each VPC requires a unique CIDR block passed via variable. What is the best practice to pass different CIDRs per instance?

Question 25easymultiple choice
Read the full Interact with Terraform modules explanation →

A module 'web_app' defines an input variable 'instance_count' with type = number and a validation block ensuring it is between 1 and 10. What happens if a user sets instance_count = 0?

Question 26mediummultiple choice
Read the full Interact with Terraform modules explanation →

A root module uses a module that creates an AWS EC2 instance. The module outputs the instance ID. The root module then uses this output in a null_resource provisioner. After modifying the module, terraform plan shows that the EC2 instance will be destroyed and recreated. What is the impact on the null_resource?

Question 27hardmultiple choice
Read the full Interact with Terraform modules explanation →

A module requires a specific provider configuration with aliases. The root module has two provider configurations: provider 'aws' (default) and provider 'aws' with alias = 'uswest'. The module uses the us-west alias. How should the module block be configured to ensure the correct provider is used?

Question 28easymultiple choice
Read the full Interact with Terraform modules explanation →

After adding a new module sourced from a Git repository with a specific tag, terraform init reports that the module is being downloaded. What is the best practice to ensure the team uses the same version of this module consistently?

Question 29mediummulti select
Read the full Interact with Terraform modules explanation →

Which TWO statements are correct when refactoring a monolithic Terraform configuration into modules?

Question 30hardmulti select
Read the full Interact with Terraform modules explanation →

Which THREE of the following are valid ways to reference a module output value within the same Terraform configuration?

Question 31easymulti select
Read the full NAT/PAT explanation →

Which TWO module source types are supported by Terraform natively?

Question 32mediummultiple choice
Read the full Interact with Terraform modules explanation →

Given the plan output, how is the module 'instances' configured in the root module?

Exhibit

Refer to the exhibit.

```
Terraform will perform the following actions:

  # module.instances["web"].aws_instance.this will be created
  + resource "aws_instance" "this" {
      + ami                          = "ami-123456"
      + instance_type                = "t2.micro"
      + subnet_id                    = (known after apply)
      ...
    }

  # module.instances["app"].aws_instance.this will be created
  + resource "aws_instance" "this" {
      + ami                          = "ami-789012"
      + instance_type                = "t2.small"
      + subnet_id                    = (known after apply)
      ...
    }

Plan: 2 to add, 0 to change, 0 to destroy.
```
Question 33hardmultiple choice
Read the full Interact with Terraform modules explanation →

In the configuration, what is the likely result of the resource block 'aws_flow_log'?

Exhibit

Refer to the exhibit.

```
module "networks" {
  source = "./modules/network"
  for_each = {
    dev  = "10.0.1.0/24"
    prod = "10.0.2.0/24"
  }
  cidr_block = each.value
  name       = each.key
}

resource "aws_flow_log" "example" {
  for_each = module.networks
  vpc_id   = each.value.vpc_id
  ...
}
```
Question 34easymultiple choice
Read the full Interact with Terraform modules explanation →

Based on the error, what is the most likely reason the 'acl' argument is not expected?

Exhibit

Refer to the exhibit.

```
module "bucket" {
  source = "terraform-aws-modules/s3-bucket/aws"
  bucket = "my-company-logs"
  acl    = "log-delivery-write"
}
```

Error during terraform plan:
```
Error: Unsupported argument
  on main.tf line 4, in module "bucket":
   4:   acl    = "log-delivery-write"
An argument named "acl" is not expected here.
```
Question 35easymultiple choice
Read the full NAT/PAT explanation →

A team wants to use a networking module from the public Terraform Registry. They need to ensure they always get the latest patch version within the 1.2.x series. Which version constraint should they use in the module block?

Question 36mediummultiple choice
Read the full Interact with Terraform modules explanation →

A developer creates a module in a subdirectory of their Terraform configuration and wants to reference it from the root module. The directory structure is: /terraform-project/modules/networking. Which source argument should they use in the module block?

Question 37hardmultiple choice
Read the full Interact with Terraform modules explanation →

An organization stores their Terraform modules in a private Git repository. They need to reference a module that resides in a subdirectory called 'modules/rds' within the repository 'infra-modules' on the main branch. Which source argument should be used?

Question 38easymultiple choice
Read the full Interact with Terraform modules explanation →

After applying a module that creates a VPC, a user wants to use the VPC ID in another resource within the root configuration. How should they reference the output from the module?

Question 39mediummultiple choice
Read the full Interact with Terraform modules explanation →

A team is using a module from the Terraform Registry. When they run 'terraform init', they receive an error stating that the module source cannot be downloaded. The module source is correct. What is the most likely cause?

Question 40hardmultiple choice
Read the full Interact with Terraform modules explanation →

A module defines an input variable with 'sensitive = true'. The root module tries to use that variable in an output block. What happens when running 'terraform apply'?

Question 41easymultiple choice
Read the full Interact with Terraform modules explanation →

A developer wants to create multiple instances of a module that provisions a single EC2 instance. They want to create 3 EC2 instances. Which approach is most efficient and concise?

Question 42mediummultiple choice
Read the full Interact with Terraform modules explanation →

A module outputs a map of security group IDs keyed by name. In the root module, a resource needs to reference the security group ID for the name 'web-sg'. How should the root configuration access this value?

Question 43hardmultiple choice
Read the full Interact with Terraform modules explanation →

A team renamed a module from 'module.network' to 'module.vpc' in their configuration. They run 'terraform plan' and see that Terraform wants to destroy the old network resources and create new ones. They want to preserve the existing resources without downtime. What should they do?

Question 44easymulti select
Read the full Interact with Terraform modules explanation →

Which TWO are benefits of using Terraform modules?

Question 45mediummulti select
Read the full Interact with Terraform modules explanation →

Which TWO module source types support version constraints in Terraform?

Question 46hardmulti select
Read the full Interact with Terraform modules explanation →

Which THREE files are considered part of the standard module structure?

Question 47mediummultiple choice
Review the full subnetting walkthrough →

After running `terraform plan`, the user receives an error: `Error: Missing required variable`. The variable 'vpc_cidr' is provided. What is the most likely cause?

Exhibit

Refer to the exhibit.
```hcl
module "networking" {
  source = "./modules/networking"
  vpc_cidr = "10.0.0.0/16"
}
```
The module in `./modules/networking` has `variables.tf`:
```hcl
variable "vpc_cidr" {
  description = "CIDR block for the VPC"
  type = string
}
variable "environment" {
  description = "Environment name"
  type = string
}
```
Question 48hardmultiple choice
Read the full Interact with Terraform modules explanation →

What is the correct way to resolve this provider version conflict?

Exhibit

Refer to the exhibit.
```
$ terraform init
Initializing modules...
Downloading hashicorp/consul/aws 0.7.2 from registry.terraform.io...
- consul in .terraform/modules/consul

Initializing the backend...

Initializing provider plugins...
- Finding hashicorp/aws versions matching ">= 3.0"...
- Installing hashicorp/aws v3.74.0...
- Installed hashicorp/aws v3.74.0

Error: Unsupported terraform provider version

  on .terraform/modules/consul/main.tf line 1, in terraform:
   1: terraform {
   2:   required_providers {
   3:     aws = {
   4:       source  = "hashicorp/aws"
   5:       version = "~> 2.70"
   6:     }
   7:   }
   8: }

The root module requires hashicorp/aws >= 3.0, but the module requires ~> 2.70.
```
Question 49easymultiple choice
Read the full Interact with Terraform modules explanation →

Which version of the module was downloaded and why?

Exhibit

Refer to the exhibit.
```hcl
module "myapp" {
  source  = "terraform-aws-modules/vpc/aws"
  version = "~> 3.0"
  name = "my-vpc"
  cidr = "10.0.0.0/16"
  azs  = ["us-east-1a", "us-east-1b"]
  private_subnets = ["10.0.1.0/24", "10.0.2.0/24"]
  public_subnets  = ["10.0.101.0/24", "10.0.102.0/24"]
}
```
After running `terraform init`, the console shows it downloaded version 3.19.0 of the module. Why did it download that version?
Question 50easymultiple choice
Read the full NAT/PAT explanation →

A team is using a module from the Terraform Registry and wants to ensure they always get the latest patch version of the 3.2.x series. Which version constraint should they use?

Question 51hardmultiple choice
Read the full Interact with Terraform modules explanation →

You have two modules that create resources in different providers. Module A creates a VPC in AWS, Module B creates a Kubernetes cluster that requires the VPC ID. You want to ensure Module B runs after Module A but avoid hardcoding the VPC ID. Which approach is most appropriate?

Question 52easymultiple choice
Read the full Interact with Terraform modules explanation →

Which of the following files is NOT required in a Terraform module?

Question 53mediummultiple choice
Read the full Interact with Terraform modules explanation →

A developer creates a module in a subdirectory called 'networking' relative to the root module. How should the module source be specified in the root module?

Question 54mediummultiple choice
Read the full Interact with Terraform modules explanation →

You have a list of VPC configurations and want to create multiple VPCs using a single module block with for_each. Which statement is true?

Question 55hardmultiple choice
Read the full Interact with Terraform modules explanation →

Which module source type does NOT support version constraints?

Question 56easymulti select
Read the full Interact with Terraform modules explanation →

Which TWO of the following are valid ways to reference a module from the Terraform Registry?

Question 57mediummulti select
Read the full Interact with Terraform modules explanation →

You are developing a module. Which TWO actions are recommended best practices?

Question 58hardmulti select
Read the full Interact with Terraform modules explanation →

Which THREE statements about module configuration are correct?

Question 59easymultiple choice
Read the full Interact with Terraform modules explanation →

A company uses a Terraform module from the registry for AWS VPC (source = "terraform-aws-modules/vpc/aws", version = "3.0.0"). They updated the module version to "3.1.0" and ran terraform plan. To their surprise, the plan shows that all VPC resources will be replaced (destroyed and recreated) instead of updated in place. They did not change any input variables. The module's release notes mention only bug fixes and minor improvements. What is most likely causing the full resource replacement?

Question 60mediummultiple choice
Read the full Interact with Terraform modules explanation →

A team has a root module that calls a local module using count to conditionally create an AWS RDS instance based on a boolean variable `rds_enabled`. The root module sets `rds_enabled` to the value of a data source that checks if a tag exists on an S3 bucket. The relevant code is: `count = var.rds_enabled ? 1 : 0`. When they run terraform plan, they receive the error: "Error: Invalid count argument: The count value is not yet known". The S3 bucket already exists. What is the underlying issue?

Question 61hardmultiple choice
Read the full Interact with Terraform modules explanation →

A large organization uses Terraform to manage infrastructure across multiple AWS accounts. They have a shared module for VPC stored in a private Git repository (git::https://github.com/org/terraform-aws-vpc.git?ref=v1.0.0). After updating the module source to ref=v1.2.0, they run terraform init and then terraform plan. The plan still shows the old module's resources and behavior. They confirm the new tag exists and the module code has changed. The root module source line is correct. What is the most likely cause?

Question 62hardmultiple choice
Read the full NAT/PAT explanation →

Your team is developing a custom module for creating EC2 instances with attached EBS volumes. The module variables are: instance_type (default "t2.micro"), ami (required), volume_size (default 8), volume_type (default "gp2"). Another team uses this module to create a web server. In their root module, they call the module without any explicit instance_type override, but they do set other variables. After applying, the web server is created with instance_type "t2.nano" instead of the expected "t2.micro". They confirm that the module still has the default "t2.micro". What is the most likely explanation?

Question 63easymulti select
Read the full Interact with Terraform modules explanation →

Which TWO statements about Terraform modules are correct?

Question 64mediummultiple choice
Read the full Interact with Terraform modules explanation →

What is the most likely cause of this error?

Exhibit

Refer to the exhibit.

```hcl	erraform {
  required_version = ">= 1.0"
}

module "network" {
  source = "./modules/networking"
  vpc_id = "vpc-12345"
}
```

Output from `terraform plan`:
```
Error: Module not found

The module at "./modules/networking" could not be found.
```
Question 65hardmultiple choice
Read the full Interact with Terraform modules explanation →

A DevOps team manages Terraform configurations for a multi-environment infrastructure (dev, staging, prod). They maintain a central repository of reusable modules stored in a Git repository. Developers often update modules in the master branch to add features or fix bugs. Recently, after a developer updated the 'vpc' module in the master branch, the staging environment's infrastructure was destroyed and recreated during a terraform apply, causing an outage. The team needs to prevent such unintended changes across environments. They currently reference modules using the source argument with a git URL pointing to the master branch: source = "git::https://github.com/org/terraform-modules//vpc?ref=master". The team is looking for a solution that allows controlled updates and ensures each environment uses a fixed version of a module until explicitly upgraded.

Practice tests

Scored 10-question sessions with instant feedback and explanations.

TF-003 Practice Test 1 — 10 Questions→TF-003 Practice Test 2 — 10 Questions→TF-003 Practice Test 3 — 10 Questions→TF-003 Practice Test 4 — 10 Questions→TF-003 Practice Test 5 — 10 Questions→TF-003 Practice Exam 1 — 20 Questions→TF-003 Practice Exam 2 — 20 Questions→TF-003 Practice Exam 3 — 20 Questions→TF-003 Practice Exam 4 — 20 Questions→Free TF-003 Practice Test 1 — 30 Questions→Free TF-003 Practice Test 2 — 30 Questions→Free TF-003 Practice Test 3 — 30 Questions→TF-003 Practice Questions 1 — 50 Questions→TF-003 Practice Questions 2 — 50 Questions→TF-003 Exam Simulation 1 — 100 Questions→

Practice by domain

Each domain maps to a weighted exam section. Focus on the domain where you are weakest.

Understand IaC conceptsUnderstand Terraform basicsUnderstand Terraform's purposeUse Terraform outside the core workflowInteract with Terraform modulesUse the core Terraform workflowImplement and maintain stateRead, generate and modify configuration

Practice by scenario

Filter questions by type — troubleshooting, exhibit, drag-and-drop, PBQ, ACLs, OSPF, and more.

Browse scenarios→

Continue studying

All Interact with Terraform modules setsAll Interact with Terraform modules questionsTF-003 Practice Hub