diff --git a/rds-postgres/variables.tf b/rds-postgres/variables.tf index d7c1cde..3240eb8 100644 --- a/rds-postgres/variables.tf +++ b/rds-postgres/variables.tf @@ -1,23 +1,56 @@ +#--- +# change between different modules as needed +#--- +variable "name" { + description = "Security Group Name" + type = string + default = "rds-postgres" +} + +variable "description" { + description = "Security Group Description" + type = string + default = "RDS Postgres Security Group" +} + +variable "short_description" { + description = "Security Group Short Description" + type = string + default = "Postgres" +} + +variable "enable_self" { + description = "Enable|Disable self full access" + type = bool + default = false +} + +variable "use_vpc_cidr" { + description = "Enable|Disable use of VPC CIDR block in the ingress_networks" + type = bool + default = false +} + +#--- +# others with defaults +#--- variable "vpc_id" { description = "VPC ID Number" type = string } +data "aws_vpc" "selected" { + id = "${var.vpc_id}" +} + variable "vpc_full_name" { description = "VPC Name" type = string default = "" } -variable "name" { - description = "Security group Name" - type = string - # default = "m-rds-postgres" - default = "m-postgres-db" -} - -variable "networks" { - description = "List of ingress networks (applies to all ports)" +variable "ingress_networks" { + description = "List of ingress networks for external access (not all ports)" type = list(string) default = ["0.0.0.0/0"] } @@ -28,6 +61,18 @@ variable "egress_networks" { default = ["0.0.0.0/0"] } +variable "ingress_security_groups" { + description = "List of ingress security groups for all ports" + type = list(string) + default = [] +} + +variable "egress_security_groups" { + description = "List of egress security groups (all ports)" + type = list(string) + default = [] +} + variable "tags" { description = "Extra security group tags" type = map