HC-vault-personal/variables.tf

156 lines
4.9 KiB
Terraform
Raw Normal View History

2024-03-01 02:33:04 +00:00
# === General ===
variable "resource_name_prefix" {
type = string
description = "Resource name prefix used for tagging and naming AWS resources"
2024-03-01 21:57:59 +00:00
default = "vault"
2024-03-01 02:33:04 +00:00
}
variable "vault_version" {
type = string
description = "Vault version"
default = "1.15.5"
}
variable "aws_region" {
type = string
description = "AWS region where Vault will be deployed"
default = "eu-north-1"
}
variable "aws_profile" {
type = string
description = "The AWS Profile to use for this project."
default = "tf_dev"
}
2024-03-01 21:57:59 +00:00
variable "key_name" {
type = string
default = "Vault"
description = "(Optional) key pair to use for SSH access to instance"
}
variable "common_tags" {
type = map(string)
description = "(Optional) Map of common tags for all taggable AWS resources."
default = {
"project" = "vault"
}
}
2024-03-01 02:33:04 +00:00
# === config ===
variable "instance_type" {
type = string
description = "The instance type to use for Vault nodes"
default = "t3.micro"
}
2024-03-01 21:57:59 +00:00
variable "additional_lb_target_groups" {
type = list(string)
description = "(Optional) List of load balancer target groups to associate with the Vault cluster. These target groups are _in addition_ to the LB target group this module provisions by default."
default = []
}
2024-03-01 02:33:04 +00:00
variable "lb_type" {
2024-03-01 21:57:59 +00:00
description = "The type of load balancer to provision; network or application."
2024-03-01 02:33:04 +00:00
type = string
2024-03-01 21:57:59 +00:00
default = "application"
validation {
condition = contains(["application", "network"], var.lb_type)
error_message = "The variable lb_type must be one of: application, network."
}
2024-03-01 02:33:04 +00:00
}
variable "node_count" {
type = number
2024-03-01 21:57:59 +00:00
description = "**Required** Number of Vault nodes to deploy in ASG"
2024-03-01 02:33:04 +00:00
default = 2
}
2024-03-01 21:57:59 +00:00
# === user supplied variables ===
2024-03-01 02:33:04 +00:00
2024-03-01 21:57:59 +00:00
variable "user_supplied_ami_id" {
2024-03-01 02:33:04 +00:00
type = string
2024-03-01 21:57:59 +00:00
description = "**Required** User-provided AMI ID to use with Vault instances. If you provide this value, please ensure it will work with the default userdata script (assumes latest version of Ubuntu LTS). Otherwise, please provide your own userdata script using the user_supplied_userdata_path variable."
default = "ami-0506d6d51f1916a96"
2024-03-01 02:33:04 +00:00
}
2024-03-01 21:57:59 +00:00
variable "user_supplied_iam_role_name" {
2024-03-01 02:33:04 +00:00
type = string
2024-03-01 21:57:59 +00:00
description = "**Required** User-provided IAM role name. This will be used for the instance profile provided to the AWS launch configuration. The minimum permissions must match the defaults generated by the IAM submodule for cloud auto-join and auto-unseal."
default = null
2024-03-01 02:33:04 +00:00
}
2024-03-01 21:57:59 +00:00
variable "user_supplied_kms_key_arn" {
type = string
description = "**Required** User-provided KMS key ARN. Providing this will disable the KMS submodule from generating a KMS key used for Vault auto-unseal"
default = null
2024-03-01 02:33:04 +00:00
}
2024-03-01 21:57:59 +00:00
variable "user_supplied_userdata_path" {
type = string
description = "**Required** File path to custom userdata script being supplied by the user"
default = "./temp/userdata.sh"
2024-03-01 02:33:04 +00:00
}
# === VPC ===
variable "allowed_inbound_cidrs_lb" {
type = list(string)
2024-03-01 21:57:59 +00:00
description = "**Required** CIDR blocks to allow inbound traffic to the load balancer"
2024-03-01 02:33:04 +00:00
default = ["0.0.0.0/0"]
}
variable "allowed_inbound_cidrs_ssh" {
type = list(string)
2024-03-01 21:57:59 +00:00
description = "**Required** CIDR blocks to allow inbound SSH traffic to the Vault instances"
2024-03-01 02:33:04 +00:00
default = ["0.0.0.0/0"]
}
2024-03-01 21:57:59 +00:00
# === Certs ===
variable "ssl_policy" {
2024-03-01 02:33:04 +00:00
type = string
2024-03-01 21:57:59 +00:00
description = "**Required** The SSL policy to use for the load balancer"
default = "ELBSecurityPolicy-TLS-1-2-2017-01"
2024-03-01 02:33:04 +00:00
}
2024-03-01 21:57:59 +00:00
variable "lb_health_check_path" {
type = string
description = "The endpoint to check for Vault's health status."
default = "/v1/sys/health?activecode=200&standbycode=200&sealedcode=200&uninitcode=200"
2024-03-01 02:33:04 +00:00
}
2024-03-01 21:57:59 +00:00
variable "kms_key_deletion_window" {
type = number
default = 7
description = "**Required**Duration in days after which the key is deleted after destruction of the resource (must be between 7 and 30 days)."
}
2024-03-01 02:33:04 +00:00
2024-03-01 21:57:59 +00:00
# === Supplied by ./modules/vpc-secrets ===
2024-03-01 02:33:04 +00:00
2024-03-01 21:57:59 +00:00
variable "secrets_manager_arn" {
2024-03-01 02:33:04 +00:00
type = string
2024-03-01 21:57:59 +00:00
description = "**Supplied by module/vpc-secrets** **Required** Secrets manager ARN where TLS cert info is stored"
2024-03-01 02:33:04 +00:00
}
2024-03-01 21:57:59 +00:00
variable "leader_tls_servername" {
2024-03-01 02:33:04 +00:00
type = string
2024-03-01 21:57:59 +00:00
description = "**Supplied by module/vpc-secrets** **Required** One of the shared DNS SAN used to create the certs use for mTLS"
2024-03-01 02:33:04 +00:00
}
2024-03-01 21:57:59 +00:00
variable "lb_certificate_arn" {
2024-03-01 02:33:04 +00:00
type = string
2024-03-01 21:57:59 +00:00
description = "**Supplied by module/vpc-secrets** **Required** ARN of TLS certificate imported into ACM for use with LB listener"
2024-03-01 02:33:04 +00:00
}
2024-03-01 21:57:59 +00:00
variable "vpc_id" {
2024-03-01 02:33:04 +00:00
type = string
2024-03-01 21:57:59 +00:00
description = "**Supplied by module/vpc-secrets** **Required** VPC ID where Vault will be deployed"
}
variable "private_subnet_ids" {
type = list(string)
description = "**Supplied by module/vpc-secrets** **Required** Subnet IDs to deploy Vault into"
2024-03-01 02:33:04 +00:00
}