From f0d2f8b5d693120f8d8e15ffb068649717d5f492 Mon Sep 17 00:00:00 2001 From: aknysh Date: Fri, 6 Oct 2023 09:58:23 -0400 Subject: [PATCH] Add `parameter_group_name_prefix_enabled` variable --- examples/complete/fixtures.us-east-2.tfvars | 9 +++---- examples/complete/main.tf | 16 ++++++++----- examples/complete/variables.tf | 3 ++- examples/postgres/fixtures.us-east-2.tfvars | 17 ++++++------- .../fixtures.us-east-2.tfvars | 11 ++++++--- examples/serverlessv2_postgres/main.tf | 9 ++++--- examples/serverlessv2_postgres/variables.tf | 24 ++++++++++++++++++- 7 files changed, 61 insertions(+), 28 deletions(-) diff --git a/examples/complete/fixtures.us-east-2.tfvars b/examples/complete/fixtures.us-east-2.tfvars index 08348df8..7c8f899a 100644 --- a/examples/complete/fixtures.us-east-2.tfvars +++ b/examples/complete/fixtures.us-east-2.tfvars @@ -8,20 +8,21 @@ stage = "test" name = "rds-cluster" +# https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Concepts.DBInstanceClass.html#Concepts.DBInstanceClass.SupportAurora instance_type = "db.t3.medium" cluster_family = "aurora-mysql8.0" +engine = "aurora-mysql" + +engine_mode = "provisioned" + cluster_size = 1 deletion_protection = false autoscaling_enabled = false -engine = "aurora-mysql" - -engine_mode = "provisioned" - db_name = "test_db" admin_user = "admin" diff --git a/examples/complete/main.tf b/examples/complete/main.tf index fc18db93..ed0fd482 100644 --- a/examples/complete/main.tf +++ b/examples/complete/main.tf @@ -3,22 +3,26 @@ provider "aws" { } module "vpc" { - source = "cloudposse/vpc/aws" - version = "2.1.0" + source = "cloudposse/vpc/aws" + version = "2.1.0" + ipv4_primary_cidr_block = "172.16.0.0/16" - context = module.this.context + + context = module.this.context } module "subnets" { - source = "cloudposse/dynamic-subnets/aws" - version = "2.4.1" + source = "cloudposse/dynamic-subnets/aws" + version = "2.4.1" + availability_zones = var.availability_zones vpc_id = module.vpc.vpc_id igw_id = [module.vpc.igw_id] ipv4_cidr_block = [module.vpc.vpc_cidr_block] nat_gateway_enabled = false nat_instance_enabled = false - context = module.this.context + + context = module.this.context } module "rds_cluster" { diff --git a/examples/complete/variables.tf b/examples/complete/variables.tf index 4b7af783..158278e3 100644 --- a/examples/complete/variables.tf +++ b/examples/complete/variables.tf @@ -4,7 +4,8 @@ variable "region" { } variable "availability_zones" { - type = list(string) + type = list(string) + description = "Availability zones" } variable "instance_type" { diff --git a/examples/postgres/fixtures.us-east-2.tfvars b/examples/postgres/fixtures.us-east-2.tfvars index e105d59a..86451ce1 100644 --- a/examples/postgres/fixtures.us-east-2.tfvars +++ b/examples/postgres/fixtures.us-east-2.tfvars @@ -8,21 +8,22 @@ stage = "test" name = "rds-cluster" -instance_type = "db.m5d.large" +# https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Concepts.DBInstanceClass.html#Concepts.DBInstanceClass.SupportAurora +instance_type = "db.t3.large" -cluster_family = "postgres14" +cluster_family = "aurora-postgresql15" -cluster_size = 1 +engine_version = "15.3" -deletion_protection = false +engine = "aurora-postgresql" -autoscaling_enabled = false +engine_mode = "provisioned" -engine = "postgres" +cluster_size = 1 -engine_mode = "provisioned" +deletion_protection = false -engine_version = "14.7" +autoscaling_enabled = false db_name = "test_db" diff --git a/examples/serverlessv2_postgres/fixtures.us-east-2.tfvars b/examples/serverlessv2_postgres/fixtures.us-east-2.tfvars index 11f2c100..e73cc950 100644 --- a/examples/serverlessv2_postgres/fixtures.us-east-2.tfvars +++ b/examples/serverlessv2_postgres/fixtures.us-east-2.tfvars @@ -1,5 +1,3 @@ -enabled = true - region = "us-east-2" availability_zones = ["us-east-2a", "us-east-2b"] @@ -10,13 +8,20 @@ stage = "test" name = "rds-cluster" +engine = "aurora-postgresql" + +cluster_family = "aurora-postgresql13" + +engine_version = "13.6" + +instance_type = "db.serverless" + cluster_size = 1 deletion_protection = false autoscaling_enabled = false - db_name = "test_db" admin_user = "postgres" diff --git a/examples/serverlessv2_postgres/main.tf b/examples/serverlessv2_postgres/main.tf index 80b5452c..651d37b6 100644 --- a/examples/serverlessv2_postgres/main.tf +++ b/examples/serverlessv2_postgres/main.tf @@ -28,14 +28,14 @@ module "subnets" { module "rds_cluster_aurora_serverlessv2_postgres_13" { source = "../../" - engine = "aurora-postgresql" - cluster_family = "aurora-postgresql13" - engine_version = "13.6" + instance_type = var.instance_type + engine = var.engine + cluster_family = var.cluster_family + engine_version = var.engine_version cluster_size = var.cluster_size admin_user = var.admin_user admin_password = var.admin_password db_name = var.db_name - instance_type = "db.serverless" vpc_id = module.vpc.vpc_id subnets = module.subnets.private_subnet_ids security_groups = [module.vpc.vpc_default_security_group_id] @@ -45,6 +45,5 @@ module "rds_cluster_aurora_serverlessv2_postgres_13" { min_capacity = var.min_capacity } - context = module.this.context } diff --git a/examples/serverlessv2_postgres/variables.tf b/examples/serverlessv2_postgres/variables.tf index dee7277f..de8c50c7 100644 --- a/examples/serverlessv2_postgres/variables.tf +++ b/examples/serverlessv2_postgres/variables.tf @@ -4,7 +4,29 @@ variable "region" { } variable "availability_zones" { - type = list(string) + type = list(string) + description = "Availability zones" +} + +variable "cluster_family" { + type = string + description = "The family of the DB cluster parameter group" +} + +variable "engine" { + type = string + description = "The name of the database engine to be used for this DB cluster. Valid values: `aurora`, `aurora-mysql`, `aurora-postgresql`" +} + +variable "engine_version" { + type = string + default = "" + description = "The version of the database engine to use. See `aws rds describe-db-engine-versions` " +} + +variable "instance_type" { + type = string + description = "Instance type to use" } variable "cluster_size" {