Skip to content

tfstack/terraform-aws-aurora-postgresql

Repository files navigation

terraform-aws-aurora-postgresql

Terraform module for deploying Aurora PostgreSQL cluster

Requirements

Name Version
terraform >= 1.0
aws >= 5.0
random >= 3.0

Providers

Name Version
aws 6.10.0
random 3.7.2

Modules

No modules.

Resources

Name Type
aws_db_subnet_group.this resource
aws_iam_role.monitoring resource
aws_iam_role_policy_attachment.monitoring resource
aws_kms_key.this resource
aws_rds_cluster.this resource
aws_rds_cluster_instance.this resource
aws_rds_cluster_parameter_group.this resource
random_password.master resource
aws_iam_policy_document.monitoring_assume data source

Inputs

Name Description Type Default Required
auto_minor_version_upgrade Whether to enable auto minor version upgrade bool true no
backup_retention_period Number of days to retain backups number 7 no
cluster_name Name of the Aurora PostgreSQL cluster string n/a yes
cluster_parameter_group_parameters Map of cluster parameter group parameters map(string) {} no
copy_tags_to_snapshot Whether to copy tags to snapshots bool true no
create_db_cluster_parameter_group Whether to create a DB cluster parameter group bool false no
create_monitoring_role Whether to create a monitoring IAM role bool true no
create_random_password Whether to create a random password for the master user bool false no
database_name Name of the database to create when the cluster is created string "postgres" no
db_cluster_parameter_group_name Name of the DB cluster parameter group to use string "" no
deletion_protection Whether to enable deletion protection for the cluster bool false no
enabled_cloudwatch_logs_exports List of log types to export to CloudWatch list(string) [] no
engine_version Aurora PostgreSQL engine version string "15.4" no
final_snapshot_identifier Name of the final snapshot when destroying the cluster string "" no
instance_class Instance class for Aurora instances string "db.r6g.large" no
instance_count Number of Aurora instances in the cluster number 2 no
kms_key_arn ARN of the KMS key to use for encryption. If not provided and storage_encrypted is true, a new KMS key will be created string "" no
master_password Master password for the database string "" no
master_username Master username for the database string "postgres" no
monitoring_enabled Whether to enable enhanced monitoring bool false no
monitoring_interval The interval, in seconds, between points when Enhanced Monitoring metrics are collected number 60 no
monitoring_role_arn ARN of the IAM role for enhanced monitoring string "" no
parameter_group_family Family of the DB cluster parameter group string "aurora-postgresql15" no
performance_insights_enabled Whether to enable Performance Insights bool false no
performance_insights_retention_period Amount of time in days to retain Performance Insights data number 7 no
preferred_backup_window Preferred backup window in UTC string "03:00-04:00" no
preferred_maintenance_window Preferred maintenance window in UTC string "sun:04:00-sun:05:00" no
publicly_accessible Whether the instances are publicly accessible bool false no
skip_final_snapshot Whether to skip final snapshot when destroying the cluster bool false no
snapshot_identifier Identifier of the snapshot to restore from string "" no
storage_encrypted Whether to enable storage encryption bool true no
subnet_ids List of subnet IDs for the DB subnet group list(string) n/a yes
tags Additional tags for the resources map(string) {} no
vpc_security_group_ids List of VPC security group IDs to associate with the cluster list(string) [] no

Outputs

Name Description
cluster_arn The ARN of the Aurora PostgreSQL cluster
cluster_endpoint The cluster endpoint
cluster_id The ID of the Aurora PostgreSQL cluster
cluster_port The port on which the DB accepts connections
cluster_reader_endpoint The cluster reader endpoint
database_name The name of the database
instance_endpoints List of Aurora instance endpoints
instance_ids List of Aurora instance IDs
kms_key_arn The ARN of the KMS key used for encryption
master_password The master password (only if create_random_password is true)
master_username The master username for the database
monitoring_role_arn The ARN of the IAM role used for enhanced monitoring
parameter_group_name The name of the DB cluster parameter group
subnet_group_arn The ARN of the DB subnet group
subnet_group_name The name of the DB subnet group

About

Terraform module for deploying Aurora PostgreSQL cluster

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages