-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
51 lines (42 loc) · 1.19 KB
/
variables.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
variable "account_id" {
type = "string"
description = "AWS account ID"
}
variable "additional_tags" {
type = "map"
default = {}
description = "A map of additional tags"
}
variable "prefix_tag_key" {
type = "string"
default = "environment"
description = "the prefix tag key defaults to 'environment'"
}
variable "prefix" {
type = "string"
description = "a string that provides a differentiation an environment"
}
variable "namespace_tag_key" {
type = "string"
default = "namespace"
description = "tag key for the namespace variables"
}
variable "namespace" {
type = "string"
description = "a name that provides a logical grouping of resources"
}
variable "cidr_restrictions" {
type = "list"
default = ["0.0.0.0/0"]
description = "a list of CIDRs that a user can execute this policy from"
}
locals {
prefix = "${lower(var.prefix)}"
namespace = "${lower(var.namespace)}"
policy_path = "/${local.prefix}/${local.namespace}/"
required_tags = "${map(
var.prefix_tag_key, local.prefix,
var.namespace_tag_key, local.namespace
)}"
tags = "${merge(var.additional_tags, local.required_tags)}"
}