AWS Amazon RDS Cluster Parameter Group
This page shows how to write Terraform and CloudFormation for Amazon RDS Cluster Parameter Group and write them securely.
aws_rds_cluster_parameter_group (Terraform)
The Cluster Parameter Group in Amazon RDS can be configured in Terraform with the resource name aws_rds_cluster_parameter_group
. The following sections describe 5 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_rds_cluster_parameter_group" "aurora_cluster_postgres_parameter_group" {
count = var.db_cluster_parameter_group_name == "" && var.engine == "aurora-postgresql" ? 1 : 0
name = "aurora-postgres10-cluster-parameter-group"
family = "aurora-postgresql10"
description = "aurora-postgres10-cluster-parameter-group"
}
resource "aws_rds_cluster_parameter_group" "pass" {
name = "rds-cluster-pg-pass"
family = "aurora-postgresql11"
description = "RDS default cluster parameter group"
parameter {
resource "aws_rds_cluster_parameter_group" "pass" {
name = "rds-cluster-pg-pass"
family = "aurora-postgresql11"
description = "RDS default cluster parameter group"
parameter {
resource "aws_rds_cluster_parameter_group" "this_no_prefix" {
count = var.use_name_prefix ? 0 : 1
name = var.name
description = var.description
family = var.family
resource "aws_rds_cluster_parameter_group" "slowquery_source_dbcluster_aurora_postgresql" {
name = "slowquery-source-dbcluster-aurora-postgresql"
description = "slowquery-source-dbcluster-aurora-postgresql"
family = "aurora-postgresql10"
parameter {
Parameters
-
arn
optional computed - string -
description
optional - string -
family
required - string -
id
optional computed - string -
name
optional computed - string -
name_prefix
optional computed - string -
tags
optional - map from string to string -
parameter
set block-
apply_method
optional - string -
name
required - string -
value
required - string
-
Explanation in Terraform Registry
Provides an RDS DB cluster parameter group resource. Documentation of the available parameters for various Aurora engines can be found at:
Tips: Best Practices for The Other AWS Amazon RDS Resources
In addition to the aws_db_instance, AWS Amazon RDS has the other resources that should be configured for security reasons. Please check some examples of those resources and precautions.
aws_db_instance
Ensure backup retension of your RDS instance is specified
It's better to set it explicitly to reduce the risk of availability issues.
aws_rds_cluster
Ensure backup retension of your RDS cluster is specified
It's better to set it explicitly to reduce the risk of availability issues.
aws_rds_cluster_instance
Ensure your RDS cluster instance blocks unwanted access
It's better to limit accessibily to the minimum that is required for the application to work.
AWS::RDS::DBClusterParameterGroup (CloudFormation)
The DBClusterParameterGroup in RDS can be configured in CloudFormation with the resource name AWS::RDS::DBClusterParameterGroup
. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
Type: AWS::RDS::DBClusterParameterGroup
Properties:
Description: Parameter group for the Serverless Aurora RDS DB.
Family: aurora5.6
Parameters:
Type: AWS::RDS::DBClusterParameterGroup
Properties:
Description: Parameter group for the Serverless Aurora RDS DB.
Family: aurora5.6
Parameters:
Type: AWS::RDS::DBClusterParameterGroup
Properties:
Description: Parameter group for the Serverless Aurora RDS DB.
Family: aurora5.6
Parameters:
Type: AWS::RDS::DBClusterParameterGroup
Properties:
Description: Parameter group for the Serverless Aurora RDS DB.
Family: aurora5.6
Parameters:
Type: AWS::RDS::DBClusterParameterGroup
Properties:
Description: Parameter group for the Serverless Aurora RDS DB.
Family: aurora-postgresql11
Parameters:
"Type" : "AWS::RDS::DBClusterParameterGroup",
"Properties" : {
"Parameters" : {
"aurora_load_from_s3_role" : { "Fn::GetAtt" : [ "IAMRoleAurora", "Arn" ] }
},
"Family" : "aurora5.6",
"Type" : "AWS::RDS::DBClusterParameterGroup",
"Properties" : {
"Description" : "{{settings["description"]}}",
"Family" : "{{settings["family"]}}",
"Parameters" : {
{% for k, v in settings["parameters"].iteritems() %}
"Type": "AWS::RDS::DBClusterParameterGroup"
},
"RDSDBInstance1": {
"Properties": {
"PubliclyAccessible": "true",
"AvailabilityZone": "eu-west-1b",
"Type": "AWS::RDS::DBClusterParameterGroup"
},
"RDSDBInstance1": {
"Type": "AWS::RDS::DBInstance",
"Properties": {
"PubliclyAccessible": "true",
"ResourceType": "AWS::RDS::DBClusterParameterGroup",
"ResourceStatus": "UPDATE_COMPLETE"
},
{
"PhysicalResourceId": "auroraClusterRole",
"ResourceType": "AWS::IAM::Role",
Parameters
-
Description
required - String -
Family
required - String -
Parameters
required - Json -
Tags
optional - List of Tag
Explanation in CloudFormation Registry
The
AWS::RDS::DBClusterParameterGroup
resource creates a new Amazon RDS DB cluster parameter group.For information about configuring parameters for Amazon Aurora DB instances, see Working with DB parameter groups and DB cluster parameter groups in the Amazon Aurora User Guide.
Note If you apply a parameter group to a DB cluster, then its DB instances might need to reboot. This can result in an outage while the DB instances are rebooting. If you apply a change to parameter group associated with a stopped DB cluster, then the update stack waits until the DB cluster is started.
Frequently asked questions
What is AWS Amazon RDS Cluster Parameter Group?
AWS Amazon RDS Cluster Parameter Group is a resource for Amazon RDS of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS Amazon RDS Cluster Parameter Group?
For Terraform, the QuiNovas/terraform-aws-aurora-serverless, bridgecrewio/checkov and bridgecrewio/checkov source code examples are useful. See the Terraform Example section for further details.
For CloudFormation, the sathishrajendran565/Arizon-CRM, Teslenk0/lambda-examples and 124um/serverless source code examples are useful. See the CloudFormation Example section for further details.