Skip to content

Add Aurora Postgres slow query example #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 15, 2024
Merged
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 1.0.9 (TBD)

### Features
- Aurora PostgreSQL CloudWatch with slow query auditing example

## 1.0.8 (2024-10-15)

### Features
Expand Down
1 change: 1 addition & 0 deletions examples/onboard-aws-rds-aurora-postgresql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ No requirements.
|------|--------|---------|
| <a name="module_aurora-postgresql-1"></a> [aurora-postgresql-1](#module\_aurora-postgresql-1) | ../../modules/onboard-aws-rds-aurora-postgresql | n/a |
| <a name="module_aurora-postgresql-2"></a> [aurora-postgresql-2](#module\_aurora-postgresql-2) | ../../modules/onboard-aws-rds-aurora-postgresql | n/a |
| <a name="module_aurora-postgresql-3"></a> [aurora-postgresql-3](#module\_aurora-postgresql-3) | ../../modules/onboard-aws-rds-aurora-postgresql | n/a |
| <a name="module_aws-default-account-asset"></a> [aws-default-account-asset](#module\_aws-default-account-asset) | imperva/agentless-onboarding/dsfhub//modules/dsfhub-aws-cloud-account | n/a |

## Resources
Expand Down
60 changes: 60 additions & 0 deletions examples/onboard-aws-rds-aurora-postgresql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,63 @@ module "aurora-postgresql-2" {
instance_identifier = "tf-aurora-postgresql-instance"
instance_publicly_accessible = true
}

################################################################################
# Amazon Aurora PostgreSQL 16.1 with Slow Query
################################################################################
module "aurora-postgresql-3" {
source = "../../modules/onboard-aws-rds-aurora-postgresql"

aws_aurora_postgresql_cluster_admin_email = local.admin_email
aws_aurora_postgresql_cluster_gateway_id = local.gateway_id
aws_aurora_postgresql_cluster_parent_asset_id = module.aws-default-account-asset.this.asset_id
aws_aurora_postgresql_cluster_region = local.aws_region

aws_log_group_admin_email = local.admin_email
aws_log_group_audit_pull_enabled = true
aws_log_group_gateway_id = local.gateway_id
aws_log_group_region = local.aws_region

cluster_db_subnet_group_name = local.subnet_group_name
cluster_engine_version = "16.1"
cluster_identifier = "tf-aurora-postgresql-cluster"
cluster_master_password = local.master_password
cluster_master_username = local.master_user
cluster_parameter_group_name = "tf-aurora-postgresql-instance-pg"
cluster_parameter_group_parameters = [
{
name = "log_connections"
value = 1
},
{
name = "log_disconnections"
value = 1
},
{
name = "log_error_verbosity"
value = "verbose"
},
{
name = "pgaudit.log"
value = "all"
},
{
name = "pgaudit.role"
value = "rds_pgaudit"
},
{
name = "shared_preload_libraries"
value = "pgaudit,pg_stat_statements"
apply_method = "pending-reboot"
},
{
name = "log_min_duration_statement"
value = 10000
}
]
cluster_vpc_security_group_ids = local.vpc_security_groups

instance_apply_immediately = local.apply_immediately
instance_identifier = "tf-aurora-postgresql-instance"
instance_publicly_accessible = true
}