Loading...
locals
Terraform konfigürasyonlarında doğrudan bağımlılık olmasa bile bazı kaynakların daha önce silinmesi gerektiğine dair Terraform'a bir ipucu vermenin yararlı yolu.
https://raw.githubusercontent.com/antonbabenko/terraform-best-practices/master/snippets/locals.tf
var.website boş bir map değilse, zorunlu argüman index_document ayarlanmalıdır.
var.website
index_document
İsteğe bağlı argüman error_document göz ardı edilebilir
error_document
variable "website" { type = map(string) default = {} } resource "aws_s3_bucket" "this" { # omitted... dynamic "website" { for_each = length(keys(var.website)) == 0 ? [] : [var.website] content { index_document = website.value.index_document error_document = lookup(website.value, "error_document", null) } } }
website = { index_document = "index.html" }