-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from RohitSquareops/main
updated module structure and tested
- Loading branch information
Showing
9 changed files
with
142 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,51 @@ | ||
locals { | ||
environment = "production" | ||
name = "skaf" | ||
region = "us-east-2" | ||
db_instance_class = "db.r5.large" | ||
db_engine_version = "13.7" | ||
environment = "production" | ||
name = "skaf" | ||
region = "us-east-2" | ||
port = 5432 / 3306 | ||
family = "aurora-postgresql15/aurora-mysql5.7" | ||
engine = "aurora-postgresql/aurora-mysql" | ||
vpc_id = "vpc-00ae5511ee10671c1" | ||
subnets = ["subnet-0d9a81939c6dd2a6e", "subnet-0fd26f0d73dc9e73d"] | ||
kms_key_arn = "arn:aws:kms:us-east-2:271251951598:key/73ff9e84-83e1-4097-b388-fe29623338a9" | ||
db_engine_version = "15.2/5.7" | ||
db_instance_class = "db.r5.large" | ||
allowed_security_groups = ["sg-0a680184e11eafd35"] | ||
} | ||
|
||
module "aurora" { | ||
source = "../../" | ||
source = "git@github.com:sq-ia/terraform-aws-rds-aurora.git" | ||
environment = local.environment | ||
port = local.port | ||
vpc_id = local.vpc_id | ||
family = local.family | ||
subnets = local.subnets | ||
engine = local.engine | ||
engine_version = local.db_engine_version | ||
rds_instance_name = local.name | ||
create_security_group = true | ||
allowed_cidr_blocks = [] | ||
allowed_security_groups = ["sg-xyzf8bdc01fd9skaf"] | ||
engine = "aurora-postgresql" | ||
engine_version = local.db_engine_version | ||
allowed_security_groups = local.allowed_security_groups | ||
instance_type = local.db_instance_class | ||
storage_encrypted = true | ||
kms_key_arn = "arn:aws:kms:us-east-2:222222222222:key/kms_key_arn" | ||
kms_key_arn = local.kms_key_arn | ||
publicly_accessible = false | ||
master_username = "devuser" | ||
database_name = "devdb" | ||
port = 3306 | ||
vpc_id = "vpc-xyz5ed733e273skaf" | ||
subnets = ["subnet-xyz546125e075skaf", "subnet-xyz8f0564e655skaf"] | ||
apply_immediately = true | ||
create_random_password = true | ||
skip_final_snapshot = true # Keeping final snapshot results in retention of DB options group and hence creates problems during destroy. So use this option wisely. | ||
final_snapshot_identifier_prefix = "prod-snapshot" | ||
snapshot_identifier = null | ||
preferred_maintenance_window = "Mon:00:00-Mon:03:00" | ||
preferred_backup_window = "03:00-06:00" | ||
preferred_maintenance_window = "Mon:00:00-Mon:03:00" | ||
final_snapshot_identifier_prefix = "prod-snapshot" | ||
backup_retention_period = 7 | ||
enable_ssl_connection = false | ||
family = "aurora-postgresql13/mysql5.7" | ||
autoscaling_enabled = true | ||
autoscaling_max = 4 | ||
autoscaling_min = 1 | ||
deletion_protection = false | ||
predefined_metric_type = "RDSReaderAverageDatabaseConnections" | ||
autoscaling_target_connections = 40 | ||
autoscaling_scale_in_cooldown = 60 | ||
autoscaling_scale_out_cooldown = 30 | ||
deletion_protection = false | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
output "aurora_cluster_endpoint" { | ||
description = "The cluster endpoint" | ||
description = "The endpoint URL of the Aurora cluster" | ||
value = module.aurora.rds_cluster_endpoint | ||
} | ||
|
||
output "aurora_cluster_reader_endpoint" { | ||
description = "The cluster reader endpoint" | ||
description = "The reader endpoint URL of the Aurora cluster" | ||
value = module.aurora.rds_cluster_reader_endpoint | ||
} | ||
|
||
output "aurora_cluster_master_password" { | ||
description = "The master password" | ||
description = "The master password for the Aurora cluster" | ||
value = module.aurora.rds_cluster_master_password | ||
} | ||
|
||
output "aurora_cluster_master_username" { | ||
description = "The master username" | ||
description = "The master username for the Aurora cluster" | ||
value = module.aurora.rds_cluster_master_username | ||
} | ||
|
||
output "aurora_security_group_id" { | ||
description = "The security group ID of the cluster" | ||
description = "The security group ID associated with the Aurora cluster" | ||
value = module.aurora.security_group_id | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
provider "aws" { | ||
region = local.region | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
output "rds_cluster_endpoint" { | ||
description = "The cluster endpoint" | ||
description = "The endpoint URL of the Aurora cluster" | ||
value = module.aurora.cluster_endpoint | ||
} | ||
|
||
output "rds_cluster_reader_endpoint" { | ||
description = "The cluster reader endpoint" | ||
description = "The reader endpoint URL of the Aurora cluster" | ||
value = module.aurora.cluster_reader_endpoint | ||
} | ||
|
||
output "rds_cluster_master_password" { | ||
description = "The master password" | ||
description = "The master password for the Aurora cluster" | ||
value = nonsensitive(module.aurora.cluster_master_password) | ||
} | ||
|
||
output "rds_cluster_master_username" { | ||
description = "The master username" | ||
description = "The master username for the Aurora cluster" | ||
value = nonsensitive(module.aurora.cluster_master_username) | ||
} | ||
|
||
output "security_group_id" { | ||
description = "The security group ID of the cluster" | ||
description = "The security group ID associated with the Aurora cluster" | ||
value = module.aurora.security_group_id | ||
} |
Oops, something went wrong.