Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 26 additions & 16 deletions examples/PostgreSQL/main.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
locals {
name = "pgsql-new"
environment = "test"
region = "us-east-1"
label_order = ["name", "environment"]
}

####----------------------------------------------------------------------------------
## Provider block added, Use the Amazon Web Services (AWS) provider to interact with the many resources supported by AWS.
####----------------------------------------------------------------------------------
provider "aws" {
region = "ap-south-1"
region = local.region
}

####----------------------------------------------------------------------------------
Expand All @@ -12,9 +19,9 @@ module "vpc" {
source = "clouddrove/vpc/aws"
version = "2.0.0"

name = "vpc"
environment = "test"
label_order = ["environment", "name"]
name = "${local.name}-vpc"
environment = local.environment
label_order = local.label_order

cidr_block = "10.0.0.0/16"
}
Expand All @@ -26,13 +33,13 @@ module "private_subnets" {
source = "clouddrove/subnet/aws"
version = "2.0.1"

name = "subnets"
environment = "test"
label_order = ["name", "environment"]
name = "${local.name}-subnets"
environment = local.environment
label_order = local.label_order

nat_gateway_enabled = true

availability_zones = ["ap-south-1a", "ap-south-1b"]
availability_zones = ["${local.region}a", "${local.region}b"]
vpc_id = module.vpc.vpc_id
type = "public-private"
igw_id = module.vpc.igw_id
Expand All @@ -46,17 +53,17 @@ module "private_subnets" {
module "postgresql" {
source = "../../"

name = "postgresql"
environment = "test"
label_order = ["environment", "name"]
name = local.name
environment = local.environment
label_order = local.label_order

engine = "postgres"
engine_version = "14.6"
engine_version = "17.6"
instance_class = "db.t3.medium"
allocated_storage = 50
engine_name = "postgres"
storage_encrypted = true
family = "postgres14"
family = "postgres17"
# DB Details
db_name = "test"
username = "dbname"
Expand All @@ -75,19 +82,22 @@ module "postgresql" {
allowed_ports = [5432]

# disable backups to create DB faster
backup_retention_period = 0
backup_retention_period = 7

enabled_cloudwatch_logs_exports = ["postgresql", "upgrade"]

# disable creation of Read Replica
enabled_read_replica = false

# DB subnet group
subnet_ids = module.private_subnets.public_subnet_id
publicly_accessible = true

# DB option group
major_engine_version = "14"
major_engine_version = "17"

# Database Deletion Protection
deletion_protection = true
deletion_protection = false

###ssm parameter
ssm_parameter_endpoint_enabled = true
Expand Down
38 changes: 24 additions & 14 deletions examples/complete-mysql/main.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
locals {
name = "mysql"
environment = "test"
region = "us-east-1"
label_order = ["name", "environment"]
}

####----------------------------------------------------------------------------------
## Provider block added, Use the Amazon Web Services (AWS) provider to interact with the many resources supported by AWS.
####----------------------------------------------------------------------------------
provider "aws" {
region = "ap-south-1"
region = local.region
}

####----------------------------------------------------------------------------------
Expand All @@ -12,9 +19,9 @@ module "vpc" {
source = "clouddrove/vpc/aws"
version = "2.0.0"

name = "vpc"
environment = "test"
label_order = ["environment", "name"]
name = "${local.name}-vpc"
environment = local.environment
label_order = local.label_order
cidr_block = "10.0.0.0/16"
}

Expand All @@ -25,11 +32,11 @@ module "subnets" {
source = "clouddrove/subnet/aws"
version = "2.0.1"

name = "subnets"
environment = "test"
label_order = ["environment", "name"]
name = "${local.name}-subnets"
environment = local.environment
label_order = local.label_order

availability_zones = ["ap-south-1a", "ap-south-1b"]
availability_zones = ["${local.region}a", "${local.region}b"]
vpc_id = module.vpc.vpc_id
type = "public"
igw_id = module.vpc.igw_id
Expand All @@ -43,13 +50,13 @@ module "subnets" {
module "mysql" {
source = "../../"

name = "mysql"
environment = "test"
label_order = ["environment", "name"]
name = local.name
environment = local.environment
label_order = local.label_order

engine = "mysql"
engine_version = "8.0.28"
instance_class = "db.t2.small"
engine_version = "8.0.43"
instance_class = "db.t3.small"
allocated_storage = 5

####----------------------------------------------------------------------------------
Expand All @@ -74,6 +81,9 @@ module "mysql" {

enabled_cloudwatch_logs_exports = ["audit", "general"]

# disable creation of Read Replica
enabled_read_replica = true

# DB subnet group
subnet_ids = module.subnets.public_subnet_id
publicly_accessible = true
Expand All @@ -85,7 +95,7 @@ module "mysql" {
major_engine_version = "8.0"

# Database Deletion Protection
deletion_protection = true
deletion_protection = false

parameters = [
{
Expand Down
1 change: 0 additions & 1 deletion examples/replica-mysql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ module "mysql" {
snapshot_identifier = ""
kms_key_id = ""
enabled_read_replica = true
enabled_replica = true

# DB Details
db_name = "replica"
Expand Down
Loading