Added for_each loops to make looping over maps easier
This commit is contained in:
parent
54fc2fb693
commit
056ea07811
7
main.tf
7
main.tf
@ -1,9 +1,10 @@
|
|||||||
module "datadog_integration" {
|
module "datadog_integration" {
|
||||||
source = "cloudposse/datadog-integration/aws"
|
source = "cloudposse/datadog-integration/aws"
|
||||||
version = "0.11.0"
|
version = "0.11.0"
|
||||||
namespace = "plaap"
|
for_each = var.aws_accounts
|
||||||
stage = "test"
|
namespace = "${each.value.namespace}"
|
||||||
name = "datadog-integration"
|
stage = "${each.value.environment}"
|
||||||
|
name = "datadog-integration-${each.value.prefix_slug}-${each.value.team}-${each.value.environment}"
|
||||||
integrations = [ "all" ]
|
integrations = [ "all" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
34
variables.tf
34
variables.tf
@ -24,10 +24,34 @@ variable "aws_profile" {
|
|||||||
description = "Which AWS account is this for"
|
description = "Which AWS account is this for"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "prefix_slug" {
|
variable "aws_accounts" {
|
||||||
type = string
|
description = "Map of AWS accounts to configuration."
|
||||||
|
type = map
|
||||||
|
default = {
|
||||||
|
vnn-bingel-prd = {
|
||||||
|
aws_account_id = "",
|
||||||
|
namespace = "datadog",
|
||||||
|
environment = "prd",
|
||||||
|
prefix_slug = "vnn",
|
||||||
|
region = "eu-west-1",
|
||||||
|
team = "bingel"
|
||||||
|
},
|
||||||
|
vnn-dbw-prd = {
|
||||||
|
aws_account_id = "",
|
||||||
|
namespace = "datadog",
|
||||||
|
environment = "prd",
|
||||||
|
prefix_slug = "vnn",
|
||||||
|
region = "eu-west-1",
|
||||||
|
team = "dbw"
|
||||||
|
}
|
||||||
|
mbg-sesame-prd = {
|
||||||
|
aws_account_id = "",
|
||||||
|
namespace = "datadog",
|
||||||
|
environment = "prd",
|
||||||
|
prefix_slug = "mbg",
|
||||||
|
region = "eu-west-1",
|
||||||
|
team = "sesame"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "team" {
|
|
||||||
type = string
|
|
||||||
}
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user