Skip to content

Commit

Permalink
Merge pull request #1 from RohitSquareops/main
Browse files Browse the repository at this point in the history
updated module structure and tested
  • Loading branch information
sunil-kumar-squareops authored May 18, 2023
2 parents 8ec7bae + d8ac251 commit c32bda2
Show file tree
Hide file tree
Showing 9 changed files with 142 additions and 179 deletions.
2 changes: 1 addition & 1 deletion IAM.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,4 @@ The Policy required is:


```
<!-- END OF PRE-COMMIT-PIKE DOCS HOOK -->
<!-- END OF PRE-COMMIT-PIKE DOCS HOOK -->
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2023 SquareOps Technologies Pvt. Ltd.
Copyright 2023 SquareOps Technologies Pvt. Ltd.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -198,4 +198,4 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
170 changes: 64 additions & 106 deletions README.md

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions examples/aurora/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ No providers.

| Name | Source | Version |
|------|--------|---------|
| <a name="module_aurora"></a> [aurora](#module\_aurora) | ../../ | n/a |
| <a name="module_aurora"></a> [aurora](#module\_aurora) | git@github.com:sq-ia/terraform-aws-rds-aurora.git | n/a |

## Resources

Expand All @@ -28,9 +28,9 @@ No inputs.

| Name | Description |
|------|-------------|
| <a name="output_aurora_cluster_endpoint"></a> [aurora\_cluster\_endpoint](#output\_aurora\_cluster\_endpoint) | The cluster endpoint |
| <a name="output_aurora_cluster_master_password"></a> [aurora\_cluster\_master\_password](#output\_aurora\_cluster\_master\_password) | The master password |
| <a name="output_aurora_cluster_master_username"></a> [aurora\_cluster\_master\_username](#output\_aurora\_cluster\_master\_username) | The master username |
| <a name="output_aurora_cluster_reader_endpoint"></a> [aurora\_cluster\_reader\_endpoint](#output\_aurora\_cluster\_reader\_endpoint) | The cluster reader endpoint |
| <a name="output_aurora_security_group_id"></a> [aurora\_security\_group\_id](#output\_aurora\_security\_group\_id) | The security group ID of the cluster |
| <a name="output_aurora_cluster_endpoint"></a> [aurora\_cluster\_endpoint](#output\_aurora\_cluster\_endpoint) | The endpoint URL of the Aurora cluster |
| <a name="output_aurora_cluster_master_password"></a> [aurora\_cluster\_master\_password](#output\_aurora\_cluster\_master\_password) | The master password for the Aurora cluster |
| <a name="output_aurora_cluster_master_username"></a> [aurora\_cluster\_master\_username](#output\_aurora\_cluster\_master\_username) | The master username for the Aurora cluster |
| <a name="output_aurora_cluster_reader_endpoint"></a> [aurora\_cluster\_reader\_endpoint](#output\_aurora\_cluster\_reader\_endpoint) | The reader endpoint URL of the Aurora cluster |
| <a name="output_aurora_security_group_id"></a> [aurora\_security\_group\_id](#output\_aurora\_security\_group\_id) | The security group ID associated with the Aurora cluster |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
43 changes: 24 additions & 19 deletions examples/aurora/main.tf
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
}

10 changes: 5 additions & 5 deletions examples/aurora/outputs.tf
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
}
2 changes: 1 addition & 1 deletion examples/aurora/provider.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
provider "aws" {
region = local.region
}
}
10 changes: 5 additions & 5 deletions outputs.tf
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
}
Loading

0 comments on commit c32bda2

Please sign in to comment.