########## MAIN VARIABLES ########## variable "aws_region" { description = "Set AWS region" type = string default = "eu-west-1" } variable "prefix" { description = "Set prefix for environment (EXAMPLE:test/dev/prod)" type = string default = "test" } variable "def_tags" { description = "Tags related to all AWS resources created" type = map(string) default = { "Environment" = "Test" } } ######### ALB VARIABLES ######### variable "alb_name" { description = "The name of the Application load balancer" type = string default = "fargate-alb" } # variable "acm_cert_arn" { # description = "The ACM certificate arn to be used with the ALB" # type = string # } ######### ECS VARIABLES ######### variable "efs_name" { description = "The name of the EFS" type = string default = "efs" } variable "ecs_cluster_name" { description = "The name of the ecs_cluster" type = string default = "ecs-cluster-fargate" } variable "container_insights" { description = "Value for container insights, accepts enabled or disabled" type = string default = "enabled" } variable "ecs_fargate_name" { description = "The name of ecs_fargate" type = string default = "ecs-fargate" } variable "tg_name" { description = "Name of the target group" type = string default = "ecs-fargate-tg" } variable "logs_retention_days" { description = "Number of days that logs will be kept. Accepted values: (1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, 2192, 2557, 2922, 3288, 3653)" type = number default = 14 } variable "task_definition_cpu" { description = "The CPU value of the task. Accepted values: 256 (.25 vCPU),512 (.5 vCPU),1024 (1 vCPU), 2048 (2 vCPU), 4096 (4 vCPU),8192 (8 vCPU)" type = number default = 256 } variable "task_definition_memory" { description = "The memory value of the task. Values depend on task_definition_cpu values. Accepted values can be found at https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html" type = number default = 512 } variable "task_container_port" { description = "The port number on the container that is bound to the user-specified or automatically assigned host port" type = number default = 80 } variable "task_desired_count" { description = "The number of instances of the task definitions to place and keep running" type = number default = 1 } ########## KMS VARIABLES ########## variable "create_kms_module" { description = "Should it create the KMS module or not" type = bool default = true } variable "k_usage" { description = "Specifies the intended use of the key. Valid values: `ENCRYPT_DECRYPT` or `SIGN_VERIFY`. Defaults to `ENCRYPT_DECRYPT`" type = string default = "ENCRYPT_DECRYPT" } variable "days_of_deletion" { description = "Waiting period, after which the AWS KMS key is deleted. Valid values are days(number) between: `7` and `30` days inclusive" type = number default = 30 } variable "enabled_rotation" { description = "Enables key rotation. Default is `true`" type = bool default = true } variable "key_enabled" { description = "Specifies whether the key is enabled. Defaults to `true`" type = bool default = true } variable "key_specs" { description = "Specifies whether the key contains a symmetric key or an asymmetric key pair and the encryption algorithms or signing algorithms that the key supports. Valid values: `SYMMETRIC_DEFAULT`, `RSA_2048`, `RSA_3072`, `RSA_4096`, `HMAC_256`, `ECC_NIST_P256`, `ECC_NIST_P384`, `ECC_NIST_P521`, or `ECC_SECG_P256K1`. Defaults to `SYMMETRIC_DEFAULT`" type = string default = "SYMMETRIC_DEFAULT" } variable "k_owners" { description = "List of IAM ARNs, which have kms:* permissions" type = list(string) default = [] } variable "key_admins" { description = "List of IAM ARNs, which have `kms:Create*`, `kms:Describe*`, `kms:Enable`, `kms:List*`, `kms:Put*`, `kms:Update*`, `kms:Revoke*`, `kms:Disable*`, `kms:Get*`, `kms:Delete*`, `kms:TagResource`, `kms:UntagResource`, `kms:ScheduleKeyDeletion`, `kms:CancelKeyDeletion` permissions" type = list(string) default = [] } variable "k_users" { description = "A list of IAM ARNs, which have `kms:Encrypt`, `kms:Decrypt`, `kms:ReEncrypt*`, `kms:GenerateDataKey*`, `kms:DescribeKey` permissions" type = list(string) default = [] } variable "key_service_principals" { description = "A list of AWS service principals (https://gist.github.com/shortjared/4c1e3fe52bdfa47522cfe5b41e5d6f22)" type = list(string) default = ["sns.amazonaws.com", "events.amazonaws.com"] } variable "k_service_users" { description = "A list of IAM ARNs, which have `kms:CreateGrant, `kms:ListGrants`, `kms:RevokeGrant` permissions" type = list(string) default = [] } variable "alias" { description = "List of key aliases" type = list(string) default = ["terraform-key1"] } variable "tags" { description = "Map of strings/tags to add to the key resource" type = map(string) default = { Created = "True" } } ########## EVENTBRIDGE VARIABLES ########## variable "create_eventbridge_module" { description = "Should it create the EventBridge module or not" type = bool default = true } variable "event_role_enabled" { description = "Controls whether IAM roles should be created" type = bool default = false } variable "event_bus_enabled" { description = "Controls whether EventBridge Bus resource should be created. When, `false`, the default bus will be used for the rules" type = bool default = false } variable "event_rule_description" { description = "Description for the event rule" type = string default = "Detects KMS Deletion and Key disabled state" } variable "event_sources" { description = "List of evvent sources for the Event Rule, services, etc." type = list(string) default = ["kms.amazonaws.com"] } variable "event_name" { description = "List of events to detect" type = list(string) default = ["DisableKey", "ScheduleKeyDeletion"] } variable "target_name" { description = "Name of the Target rule of the event" type = string default = "SNS target" } ########## SNS VARIABLES ########## variable "create_sns_module" { description = "Should it create the SNS module or not" type = bool default = true } variable "name_of_topic" { description = "The name of the SNS topic to create" type = string default = "sns-topic" } variable "encryption_key" { description = "Defines the key to encrypt the SNS topic" type = string default = null } variable "principles_for_policy_1" { description = "Principals for Policy 1" type = list(string) default = ["events.amazonaws.com", "s3.amazonaws.com", "rds.amazonaws.com", "budgets.amazonaws.com"] } variable "principles_for_policy_2" { description = "Principals for Policy 2" type = list(string) default = ["cloudwatch.amazonaws.com", "elasticache.amazonaws.com", "elasticbeanstalk.amazonaws.com", "autoscaling.amazonaws.com"] } variable "principles_for_policy_3" { description = "Principals for Policy 3" type = list(string) default = ["ses.amazonaws.com", "events.amazonaws.com"] } ########## VPC VARIABLES ########## variable "create_vpc_module" { description = "Should it create the VPC module or not" type = bool default = true } variable "vpc_name" { description = "Name of the VPC" type = string default = "VPC" } variable "cidr" { description = "CIDR of the VPC" type = string default = "10.0.0.0/16" } variable "azs" { description = "A list of availability zones names or ids in the region" type = list(string) default = ["eu-west-1a", "eu-west-1b", "eu-west-1c",] } variable "private_subnets" { description = " A list of private subnets inside the VPC" type = list(string) default = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"] } variable "public_subnets" { description = " A list of public subnets inside the VPC" type = list(string) default = ["10.0.11.0/24", "10.0.12.0/24", "10.0.13.0/24"] } variable "database_subnets" { description = " A list of private subnets inside the VPC" type = list(string) default = ["10.0.21.0/24", "10.0.22.0/24", "10.0.23.0/24"] } variable "enable_nat_gateway" { description = "Should be true if you want to provision NAT Gateways for each of your private networks" type = bool default = true } variable "create_database_subnet_group" { description = "Controls if database subnet group should be created (n.b. database_subnets must also be set)" type = bool default = true } variable "private_acl_dedicated" { description = "Whether to use dedicated network ACL (not default) and custom rules for private subnets" type = bool default = true } variable "public_acl_dedicated" { description = "Whether to use dedicated network ACL (not default) and custom rules for public subnets" type = bool default = true } variable "pub_inbound_acl" { description = "Public subnets inbound network ACLs" type = list(map(string)) default = [ { rule_number = 100 rule_action = "allow" from_port = 0 to_port = 0 protocol = "-1" cidr_block = "0.0.0.0/0" }, ] } variable "pub_outbound_acl" { description = "Public subnets outbound network ACLs" type = list(map(string)) default = [ { rule_number = 100 rule_action = "allow" from_port = 0 to_port = 0 protocol = "-1" cidr_block = "0.0.0.0/0" }, ] } variable "private_inbound_acl" { description = "Private subnets inbound network ACLs" type = list(map(string)) default = [ { rule_number = 100 rule_action = "allow" from_port = 0 to_port = 0 protocol = "-1" cidr_block = "0.0.0.0/0" }, ] } variable "private_outbound_acl" { description = "Private subnets outbound network ACLs" type = list(map(string)) default = [ { rule_number = 100 rule_action = "allow" from_port = 0 to_port = 0 protocol = "-1" cidr_block = "0.0.0.0/0" }, ] } variable "vpc_tags" { description = "Map of strings/tags to add to the VPCresource" type = map(string) default = { Created = "True" } } ########## ECR VARIABLES ########## variable "create_ecr_module" { description = "Should it create the ECR module or not" type = bool default = true } variable "is_image_mutable" { description = "The tag mutability setting for the repo. Values or " type = string default = "MUTABLE" } variable "ecr_encryption" { description = "The encryption type for the repository. Must be one of: `KMS` or `AES256`. Defaults to `AES256`" type = string default = "KMS" } variable "repository_kms_key" { description = "The ARN of the KMS key to use when encryption_type is `KMS`. If not specified, uses the default AWS managed key for ECR" type = string default = null } variable "repo_name" { description = "Name of the repo to be created" type = string default = "ecr-repo" } variable "ecr_tags" { description = "Tags to set on the ecr repo" type = map(string) default = { Creation = "True" } } variable "scan_enabled" { description = "Whether images are scanned after being pushed to the repo" type = bool default = true } variable "delete_enabled" { description = "Whether the repository can be forcefully removed while having images stored inside" type = bool default = true } variable "ecr_policy" { description = "ECR Lifecycle Policy (json string) to manage the image lifecycles in the ECR repo" type = string default = <