Courseiva
Interact with Terraform moduleseasyMultiple ChoiceObjective-mapped

TF-004 Interact with Terraform modules Practice Question

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.
```

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

⚠ Common exam trap

This question tests the distinction between 'unexpected argument' errors (caused by undeclared variables in the module) and 'missing required argument' errors (caused by omitting a declared variable without a default), leading candidates to confuse the two and select an option that addresses a missing argument rather than an unrecognized one.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

The module version currently installed does not have an 'acl' variable.

The error indicates that the 'acl' argument is not recognized by the Terraform module. This typically occurs when the installed module version does not expose an 'acl' variable in its schema. Terraform validates arguments against the module's declared variables; if 'acl' is absent from the module's variables.tf, Terraform will reject it as an unexpected argument.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • The module version currently installed does not have an 'acl' variable.

    Why this is correct

    The error message "not expected here" for an argument within a module block directly indicates that the module's defined interface, specifically its `variables.tf` file, does not declare an input variable named 'acl'. This situation commonly arises when a module has been updated, and the 'acl' variable was either removed, renamed, or never existed in the specific version of the module currently being used. Terraform strictly validates all provided arguments against the module's explicit variable definitions.

  • The argument name is misspelled; it should be 'acl_control'.

    Why it's wrong here

    While a misspelling could indeed lead to an "unexpected argument" error, the phrasing "not expected here" for a module input variable typically implies that the module's `variables.tf` simply lacks any definition for an argument with that exact name. If 'acl_control' were the correct name and 'acl' was a typo, the error would still be about 'acl' being unexpected. However, the most direct interpretation of the error is that the module's schema for the installed version does not include an 'acl' variable at all, rather than just a mistyped version of an existing one.

  • The module requires the 'acl' to be set inside a separate block.

    Why it's wrong here

    If the module required 'acl' to be set within a separate, nested block, the error message would likely be different, possibly indicating a missing required block or an invalid argument *within* a block. An "unexpected argument" at the module's top level clearly states that 'acl' is not a valid direct input variable for the module as defined in its `variables.tf`. Terraform does not implicitly expect arguments to be moved into nested blocks; module inputs are explicitly declared as top-level variables or within specific block types.

  • The 'bucket' argument is missing; 'acl' must follow it.

    Why it's wrong here

    Terraform's configuration language is declarative, meaning the order of arguments within a resource or module block is generally inconsequential. Terraform parses all arguments provided and validates them against the defined schema, regardless of their position. The error message explicitly targets 'acl' as "not expected here," indicating an issue with the argument's existence or validity itself, not its placement relative to a 'bucket' argument or any other argument's presence.

Visual reference

Source Router + ACL permit 10.0.0.0/8 deny any Server 10.0.0.5 ✓ 192.168.1.1 ✗ dropped ACLs evaluate top-down; first match wins — implicit deny all at end

About these practice questions

Courseiva writes every TF-004 question from scratch — 428 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This TF-004 practice question is part of Courseiva's free HashiCorp certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the TF-004 exam.