110 lines
3.5 KiB
Terraform
110 lines
3.5 KiB
Terraform
variable "region" {
|
|
description = "Primary AWS region for regional resources."
|
|
type = string
|
|
}
|
|
|
|
variable "name_prefix" {
|
|
description = "Prefix available to callers that create an isolated test copy."
|
|
type = string
|
|
}
|
|
|
|
variable "account_id" {
|
|
description = "AWS account ID used to construct existing policies and ARNs."
|
|
type = string
|
|
}
|
|
|
|
variable "protect_from_destroy" {
|
|
description = "Protect stateful resources from destroy. prod は true 固定。既存 workspace で true→false に反転しない。"
|
|
type = bool
|
|
default = true
|
|
}
|
|
|
|
variable "force_destroy_unprotected_buckets" {
|
|
description = "Allow Terraform to delete objects while destroying unprotected test buckets. Protected production buckets always keep force_destroy=false."
|
|
type = bool
|
|
default = false
|
|
}
|
|
|
|
variable "bucket_names" {
|
|
description = "Optional existing bucket names. Omitted values are derived from name_prefix for isolated tests."
|
|
type = object({
|
|
cloudtrail = optional(string)
|
|
flowlogs = optional(string)
|
|
})
|
|
default = {}
|
|
}
|
|
|
|
variable "access_log_bucket_name" {
|
|
description = "Optional S3 server access log destination bucket name. Omitted values are derived from name_prefix for isolated tests."
|
|
type = string
|
|
default = null
|
|
}
|
|
|
|
variable "access_log_bucket_namespace" {
|
|
description = "Namespace for the S3 server access log destination bucket. Isolated tests use the global namespace by default; production can opt in to account-regional."
|
|
type = string
|
|
default = "global"
|
|
|
|
validation {
|
|
condition = contains(["account-regional", "global"], var.access_log_bucket_namespace)
|
|
error_message = "access_log_bucket_namespace must be account-regional or global."
|
|
}
|
|
}
|
|
|
|
variable "trail_name" {
|
|
description = "CloudTrail trail name."
|
|
type = string
|
|
}
|
|
|
|
variable "cloudtrail_is_multi_region" {
|
|
description = "Whether CloudTrail records events from all AWS Regions. Production keeps this true; isolated regional tests set it false."
|
|
type = bool
|
|
default = true
|
|
}
|
|
|
|
variable "cloudtrail_cloudwatch_logs" {
|
|
description = "CloudWatch Logs delivery settings for the CloudTrail trail. Omitted names are derived from name_prefix for isolated tests."
|
|
type = object({
|
|
log_group_name = optional(string)
|
|
retention_in_days = optional(number, 30)
|
|
role_name = optional(string)
|
|
policy_name = optional(string)
|
|
})
|
|
default = {}
|
|
}
|
|
|
|
variable "kms_alias_name" {
|
|
description = "Alias of the customer managed Vault key."
|
|
type = string
|
|
}
|
|
|
|
variable "kms_deletion_window_in_days" {
|
|
description = "Waiting period before permanent KMS key deletion. Isolated tests use the minimum seven days."
|
|
type = number
|
|
default = 30
|
|
|
|
validation {
|
|
condition = var.kms_deletion_window_in_days >= 7 && var.kms_deletion_window_in_days <= 30
|
|
error_message = "kms_deletion_window_in_days must be between 7 and 30."
|
|
}
|
|
}
|
|
|
|
variable "log_groups" {
|
|
description = "CloudWatch log groups and their retention in days. Null means never expire."
|
|
type = map(object({
|
|
name = string
|
|
retention_in_days = optional(number)
|
|
tags = optional(map(string), {})
|
|
}))
|
|
}
|
|
|
|
variable "billing_alarm_name" {
|
|
description = "CloudWatch billing alarm name in us-east-1."
|
|
type = string
|
|
}
|
|
|
|
variable "billing_alarm_action_arns" {
|
|
description = "Existing notification target ARNs for the billing alarm. The targets themselves are not managed by this module."
|
|
type = list(string)
|
|
}
|