Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit c0909681 authored by Christophe Chaudier's avatar Christophe Chaudier :rocket:
Browse files

:alembic: (terraform) for_each with modules

parent e09a4146
No related branches found
No related tags found
No related merge requests found
# Terraform
.terraform/
terraform.tfstate.d/
vaultclear/
*.tfstate
*.tfstate.backup
secrets.tfvars
secrets.*.tfvars
env.vault
_tf_files
terraform 0.13.0
main.tf 0 → 100644
variable files {
description = "Map of files to create."
type = map
default = {
first = {
content = "my first content\n",
file_permission = "0666"
},
file2 = {
content = "# my title\n",
file_permission = "0750"
}
}
}
module "files" {
source = "./modules/files"
for_each = var.files
filename = each.key
content = each.value.content
file_permission = each.value.file_permission
}
resource "local_file" "tf_files" {
filename = "_tf_files/${var.filename}"
content = var.content
file_permission = var.file_permission
}
variable "filename" { default = "dummy_file.txt" }
variable "content" { default = "dummy" }
variable "file_permission" { default = "0666" }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment