-
Notifications
You must be signed in to change notification settings - Fork 34
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 #2 from catcharbind/main
Aurora Global Database Setup and other updates
- Loading branch information
Showing
9 changed files
with
623 additions
and
132 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,3 +34,5 @@ override.tf.json | |
terraform.rc | ||
|
||
.terraform.lock.hcl | ||
|
||
backend.hcl |
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 |
---|---|---|
|
@@ -4,34 +4,41 @@ Authors: David Wright ([email protected]) and Tony Vattahil ([email protected] | |
To deploy the Terraform Amazon Aurora module, do the following: | ||
|
||
1. Install Terraform. For instructions and a video tutorial, see [Install Terraform](https://learn.hashicorp.com/tutorials/terraform/install-cli). | ||
|
||
2. Sign up and log into Terraform Cloud. (There is a free tier available.) | ||
|
||
3. Configure Terraform Cloud API access. Run the following to generate a Terraform Cloud token from the command line interface: | ||
``` | ||
terraform login | ||
Export the TERRAFORM_CONFIG variable | ||
--For Mac/Linux | ||
export TERRAFORM_CONFIG="$HOME/.terraform.d/credentials.tfrc.json" | ||
--For Windows | ||
export TERRAFORM_CONFIG="$HOME/AppData/Roaming/terraform.d/credentials.tfrc.json" | ||
``` | ||
|
||
4. Configure the AWS Command Line Interface (AWS CLI). For more information, see [Configuring the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html). | ||
|
||
5. If you don't have git installed, [install git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git). | ||
|
||
6. Clone this **aws-ia/terraform-aws-rds-aurora** repository using the following command: | ||
|
||
`git clone https://github.com/aws-ia/terraform-aws-rds-aurora` | ||
`git clone https://github.com/aws-ia/terraform-aws-rds-aurora.git` | ||
|
||
7. Change directory to the root repository directory. | ||
|
||
`cd terraform-aws-rds-aurora/` | ||
|
||
8. Change to the deploy directory. | ||
|
||
- For a new virtual private cloud (VPC), use `cd setup_workspace`. | ||
- For an existing VPC, pass the VPC ID directly to the module. | ||
|
||
9. To perform operations locally, do the following: | ||
8. For setting up a new terraform workspace: | ||
|
||
- `cd setup_workspace` | ||
- `terraform init` | ||
- `terraform apply` | ||
|
||
9. To create new VPC and deploy Aurora module: | ||
- Change to the deploy directory. Run `cd ../deploy` | ||
- Initialize the deploy directory. Run `terraform init`. | ||
- Start a Terraform run using the configuration files in your deploy directory. Run `terraform apply` or `terraform apply -var-file="$HOME/.aws/terraform.tfvars"` (Note: The deployment is remotely run in Terraform Cloud) | ||
|
||
a. Initialize the deploy directory. Run `terraform init`. | ||
b. Start a Terraform run using the configuration files in your deploy directory. Run `terraform apply` or `terraform apply -var-file="$HOME/.aws/terraform.tfvars"`. | ||
|
||
10. Change to the deploy directory with `cd ../deploy`. | ||
11. Run `terraform init`. | ||
12. Run `terraform apply` or Run `terraform apply -var-file="$HOME/.aws/terraform.tfvars"`. `Terraform apply` is remotely run in Terraform Cloud. | ||
For existing VPCs, pass the list of private subnets (var.Private_subnet_ids_p & var.Private_subnet_ids_s) directly to the Aurora module. |
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 |
---|---|---|
@@ -0,0 +1,117 @@ | ||
locals { | ||
apg_cluster_pgroup_params = [{ | ||
name = "rds.force_autovacuum_logging_level" | ||
value = "warning" | ||
apply_method = "immediate" | ||
},{ | ||
name = "rds.force_admin_logging_level" | ||
value = "warning" | ||
apply_method = "immediate" | ||
},{ | ||
name = "rds.enable_plan_management" | ||
value = 1 | ||
apply_method = "pending-reboot" | ||
}] | ||
|
||
apg_db_pgroup_params = [{ | ||
name = "shared_preload_libraries" | ||
value = "auto_explain,pg_stat_statements,pg_hint_plan,pgaudit" | ||
apply_method = "pending-reboot" | ||
},{ | ||
name = "log_lock_waits" | ||
value = 1 | ||
apply_method = "immediate" | ||
},{ | ||
name = "log_statement" | ||
value = "ddl" | ||
apply_method = "immediate" | ||
},{ | ||
name = "log_temp_files" | ||
value = 4096 | ||
apply_method = "immediate" | ||
},{ | ||
name = "log_min_duration_statement" | ||
value = 5000 | ||
apply_method = "immediate" | ||
},{ | ||
name = "auto_explain.log_min_duration" | ||
value = 5000 | ||
apply_method = "immediate" | ||
},{ | ||
name = "auto_explain.log_verbose" | ||
value = 1 | ||
apply_method = "immediate" | ||
},{ | ||
name = "log_rotation_age" | ||
value = 1440 | ||
apply_method = "immediate" | ||
},{ | ||
name = "log_rotation_size" | ||
value = "102400" | ||
apply_method = "immediate" | ||
},{ | ||
name = "rds.log_retention_period" | ||
value = 10080 | ||
apply_method = "immediate" | ||
},{ | ||
name = "random_page_cost" | ||
value = 1 | ||
apply_method = "immediate" | ||
},{ | ||
name = "track_activity_query_size" | ||
value = 16384 | ||
apply_method = "pending-reboot" | ||
},{ | ||
name = "idle_in_transaction_session_timeout" | ||
value = 7200000 | ||
apply_method = "immediate" | ||
},{ | ||
name = "statement_timeout" | ||
value = 7200000 | ||
apply_method = "immediate" | ||
},{ | ||
name = "apg_plan_mgmt.capture_plan_baselines" | ||
value = "automatic" | ||
apply_method = "immediate" | ||
},{ | ||
name = "apg_plan_mgmt.use_plan_baselines" | ||
value = true | ||
apply_method = "immediate" | ||
},{ | ||
name = "apg_plan_mgmt.plan_retention_period" | ||
value = 90 | ||
apply_method = "pending-reboot" | ||
},{ | ||
name = "apg_plan_mgmt.unapproved_plan_execution_threshold" | ||
value = 100 | ||
apply_method = "immediate" | ||
}] | ||
|
||
mysql_cluster_pgroup_params = [{ | ||
name = "time_zone" | ||
value = "UTC" | ||
apply_method = "immediate" | ||
},{ | ||
name = "server_audit_logging" | ||
value = 1 | ||
apply_method = "immediate" | ||
},{ | ||
name = "server_audit_events" | ||
value = "QUERY_DCL,QUERY_DDL,CONNECT" | ||
apply_method = "immediate" | ||
}] | ||
|
||
mysql_db_pgroup_params = [{ | ||
name = "slow_query_log" | ||
value = 1 | ||
apply_method = "immediate" | ||
},{ | ||
name = "long_query_time" | ||
value = 10 | ||
apply_method = "immediate" | ||
},{ | ||
name = "innodb_print_all_deadlocks" | ||
value = 1 | ||
apply_method = "immediate" | ||
}] | ||
} |
Oops, something went wrong.