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" {
|
||||
source = "cloudposse/datadog-integration/aws"
|
||||
version = "0.11.0"
|
||||
namespace = "plaap"
|
||||
stage = "test"
|
||||
name = "datadog-integration"
|
||||
for_each = var.aws_accounts
|
||||
namespace = "${each.value.namespace}"
|
||||
stage = "${each.value.environment}"
|
||||
name = "datadog-integration-${each.value.prefix_slug}-${each.value.team}-${each.value.environment}"
|
||||
integrations = [ "all" ]
|
||||
}
|
||||
|
||||
|
||||
34
variables.tf
34
variables.tf
@ -24,10 +24,34 @@ variable "aws_profile" {
|
||||
description = "Which AWS account is this for"
|
||||
}
|
||||
|
||||
variable "prefix_slug" {
|
||||
type = string
|
||||
variable "aws_accounts" {
|
||||
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