title: Terraform error setting S3 bucket tags: InvalidTag: The TagValue you have provided is invalid status code: 400
body: <p>I have managed to make my Terraform loop through all of my buckets creating an IAMs user and a bucket</p>
  
  <pre><code>resource "aws_s3_bucket" "aws_s3_buckets" {
    count         = "${length(var.s3_bucket_name)}"
    bucket        = "${var.s3_bucket_name[count.index]}"
    acl           = "private"
  
    tags = {
      Name        = "${var.s3_bucket_name[count.index]}"
      Environment = "live"
      policy = &lt;&lt;POLICY
  {
      "Id": "Policy1574607242703",
      "Version": "2012-10-17",
      "Statement": [
        {
          "Sid": "Stmt1574607238413",
          "Action": [
            "s3:PutObject"
          ],
          "Effect": "Allow",
          "Resource": {
            "arn:aws:s3:::"."${var.s3_bucket_name[count.index]}"."/*"}
          },
          "Principal": {
          "AWS": [
          "${var.s3_bucket_name[count.index]}"}
          ]}                
        }
      ]
    }
  POLICY
  }
  }
  </code></pre>
  
  <p>I'm getting error setting <strong>S3 bucket tags: InvalidTag: The TagValue you have provided is invalid status code: 400</strong> is there a way to create policies like this?  Or have I done something incorrect in my code?</p>