mirror of
https://github.com/farcasclaudiu/terraform-course.git
synced 2026-06-29 01:02:16 +03:00
for and foreach demo
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
|
||||
resource "aws_ebs_volume" "example" {
|
||||
availability_zone = "eu-west-1a"
|
||||
size = 8
|
||||
|
||||
tags = {for k, v in merge({ Name = "Myvolume" }, var.project_tags): k => lower(v)}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
provider "aws" {
|
||||
region = var.AWS_REGION
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
variable "AWS_REGION" {
|
||||
type = string
|
||||
default = "eu-west-1"
|
||||
}
|
||||
variable "project_tags" {
|
||||
type = map(string)
|
||||
default = {
|
||||
Component = "Frontend"
|
||||
Environment = "Production"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user