# Terraform input variable and nested maps

**URL:** <https://discuss.hashicorp.com/t/terraform-input-variable-and-nested-maps/15557>\
**Category:** Terraform\
**Created:** [October 13, 2020, 9:16pm UTC](https://discuss.hashicorp.com/t/terraform-input-variable-and-nested-maps/15557 "2020-10-13T21:16:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nitheesh86](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/nitheesh86/32/12798_2.png) [@nitheesh86](https://discuss.hashicorp.com/u/nitheesh86)\
**Post date:** [October 13, 2020, 9:16pm UTC](https://discuss.hashicorp.com/t/terraform-input-variable-and-nested-maps/15557/1 "2020-10-13T21:16:55Z")

</div>

```
    variable "website" {
  description = "Map containing static web-site hosting or redirect configuration."
  default = {
    index_document = "index.html"
    error_document = "error.html"
    routing_rules = <<EOF
    [{
        "Condition": {
            "KeyPrefixEquals": "img/"
        },
        "Redirect": {
            "ReplaceKeyPrefixWith": "images/"
        }
    }]
    EOF
    redirect_all_requests_to = {
      HostName = "www.example.com"
      Protocol = "http"
    }
  }
}

```

Getting this error

Error: Incorrect attribute value type

on .terraform/modules/s3/main.tf line 23, in resource “aws\_s3\_bucket” “a”:  
23: redirect\_all\_requests\_to = lookup(website.value, “redirect\_all\_requests\_to”, null)

Inappropriate value for attribute “redirect\_all\_requests\_to”: string required.

i am using this module

> <https://github.com/terraform-aws-modules/terraform-aws-s3-bucket/blob/master/main.tf>
