@ -66,7 +66,7 @@ This special behavior can be useful for modules that accept optional input
variables whose default value is `null` to represent the absence of any value. This allows the module to adapt the variable value for Terraform language features designed to work with collections. For example:
```
variable "website" {
variable "website_setting " {
type = object({
index_document = string
error_document = string
@ -78,7 +78,7 @@ resource "aws_s3_bucket" "example" {
# ...
dynamic "website" {
for_each = var.website[*]
for_each = var.website_setting [*]
content {
index_document = website.value.index_document
error_document = website.value.error_document
@ -89,7 +89,7 @@ resource "aws_s3_bucket" "example" {
The above example uses a [`dynamic` block](/language/expressions/dynamic-blocks), which
generates zero or more nested blocks based on a collection value. The input
variable `var.website` is defined as a single object that might be null,
variable `var.website_setting ` is defined as a single object that might be null,
so the `dynamic` block's `for_each` expression uses `[*]` to ensure that
there will be one block if the module caller sets the website argument, or
zero blocks if the caller leaves it set to null.