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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Variables ====================================================================

# Account ID -------------------------------------------------------------------

variable "account_id" {
  description = "ID of the target member account to set contacts on. Uses current account if omitted."
  type        = string
  default     = null
}

# Primary Contact --------------------------------------------------------------
#
# Notes:
#  - Used by AWS for legal, tax, and account ownership communications
#  - phone must include country code (e.g. '+12065551234')
#  - country_code must be a valid ISO 3166-1 alpha-2 code (e.g. 'US', 'GB')
#
# Example:
#   primary_contact = {
#     full_name       = "Platform Team"
#     company_name    = "Example Corp"
#     phone           = "+12065551234"
#     address_line_1  = "123 Any Street"
#     city            = "Seattle"
#     state_or_region = "WA"
#     postal_code     = "98101"
#     country_code    = "US"
#   }
#
variable "primary_contact" {
  description = "Primary account contact used by AWS for legal, tax, and account ownership purposes."
  type = object({
    full_name          = string
    company_name       = optional(string)
    phone              = string
    website_url        = optional(string)
    address_line_1     = string
    address_line_2     = optional(string)
    city               = string
    state_or_region    = optional(string)
    district_or_county = optional(string)
    postal_code        = string
    country_code       = string
  })
  default = null
}

# Alternate Contacts -----------------------------------------------------------
#
# Notes:
#  - Valid keys are 'billing', 'security', 'operations' (case-insensitive)
#  - billing receives billing alerts, invoices, and payment notifications
#  - security receives security findings, abuse notifications, and vulnerability reports
#  - operations receives service notifications, maintenance windows, and operational issues
#  - phone must include country code (e.g. '+12065551234')
#
# Example:
#   alternate_contacts = {
#     billing = {
#       name  = "Finance Team"
#       title = "Finance Manager"
#       email = "[email protected]"
#       phone = "+12065551234"
#     }
#     security = {
#       name  = "Security Team"
#       title = "Security Engineer"
#       email = "[email protected]"
#       phone = "+12065551234"
#     }
#     operations = {
#       name  = "Platform Team"
#       title = "Platform Engineer"
#       email = "[email protected]"
#       phone = "+12065551234"
#     }
#   }
#
variable "alternate_contacts" {
  description = "Alternate contacts for billing, security, and operations notifications."
  type = map(object({
    name  = string
    title = string
    email = string
    phone = string
  }))
  default = {}

  validation {
    condition     = alltrue([for k in keys(var.alternate_contacts) : contains(["billing", "security", "operations"], lower(k))])
    error_message = "Valid keys for alternate_contacts are 'billing', 'security', and 'operations'."
  }
}