Skip to content

Session 4 - 21 Modules #132

Answered by chgasparoto
everton17 asked this question in Q&A
Dec 20, 2022 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

@everton17 as propriedades tem outro nome quando vc utiliza o novo aws_s3_bucket_website_configuration. Vc precisa setar o dynamic nas novas propriedades, por exemplo:

resource "aws_s3_bucket_website_configuration" "website" {
  bucket = aws_s3_bucket.website.bucket

  dynamic "index_document" {
    for_each = length(keys(var.website)) == 0 ? [] : [var.website]
    content {
      suffix = "index.html"
    }
  }

  error_document {
    key = "error.html"
  }
}

Recentemente eu gravei um vídeo de como utilizar a nova forma para criar um bucket com o terraform, dá uma olhada lá.
https://youtu.be/iSIuCOVje_k
https://github.com/chgasparoto/youtube-cleber-gasparoto/blob/main/0008-terraform-new-…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by everton17
Comment options

You must be logged in to vote
1 reply
@chgasparoto
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants