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
# Variables ====================================================================

variable "tags" {
  description = "Tags applied to all resources in this module."
  type        = map(string)
  default     = {}
}

variable "share_invitations" {
  description = <<-EOT
    Map of RAM resource share invitations to accept.
    share_arn is required and must reference a share for which this
    account is the invited principal. The calling stack must pass in
    a provider authenticated as the receiving account for this invocation.
  EOT
  type = map(object({
    share_arn = string
  }))
  default = {}

  validation {
    condition = alltrue([
      for k, v in var.share_invitations : can(regex("^arn:aws:ram:", v.share_arn))
    ])
    error_message = "share_arn must be a valid RAM resource share ARN (arn:aws:ram:...)."
  }
}