AWS Amazon RDS Parameter Group
This page shows how to write Terraform and CloudFormation for Amazon RDS Parameter Group and write them securely.
aws_db_parameter_group (Terraform)
The Parameter Group in Amazon RDS can be configured in Terraform with the resource name aws_db_parameter_group
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
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 parameter group resource .Documentation of the available parameters for various RDS engines can be found at:
- Aurora MySQL Parameters
- Aurora PostgreSQL Parameters
- MariaDB Parameters
- Oracle Parameters
- PostgreSQL Parameters > > Hands-on: For an example of the
aws_db_parameter_group
in use, follow the Manage AWS RDS Instances tutorial on HashiCorp Learn.
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::DBParameterGroup (CloudFormation)
The DBParameterGroup in RDS can be configured in CloudFormation with the resource name AWS::RDS::DBParameterGroup
. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
Type: AWS::RDS::DBParameterGroup
Properties:
Description: Parameter group for the Serverless Aurora RDS DB.
Family: aurora5.6
Parameters:
sql_mode: IGNORE_SPACE
Type: AWS::RDS::DBParameterGroup
Properties:
Description: Parameter group for the Serverless Aurora RDS DB.
Family: aurora5.6
Parameters:
sql_mode: IGNORE_SPACE
Type: AWS::RDS::DBParameterGroup
Properties:
Description: Parameter group for the Serverless Aurora RDS DB.
Family: aurora5.6
Parameters:
sql_mode: IGNORE_SPACE
Type: AWS::RDS::DBParameterGroup
Properties:
Description: Parameter group for the Serverless Aurora RDS DB.
Family: aurora5.6
Parameters:
sql_mode: IGNORE_SPACE
Type: AWS::RDS::DBParameterGroup
Properties:
Description: Parameter group for the Serverless Aurora RDS DB.
Family: aurora5.6
Parameters:
sql_mode: IGNORE_SPACE
"Type": "AWS::RDS::DBParameterGroup",
"Properties" : {
"Family" : "MySQL5.5",
"Description" : "CloudFormation Sample Database Parameter Group",
"Parameters" : {
"autocommit" : "1" ,
"Type" : "AWS::RDS::DBParameterGroup",
"Properties" : {
"Description" : "{{settings["description"]}}",
"Family" : "{{settings["family"]}}",
"Parameters" : {
{% for k, v in settings["parameters"].iteritems() %}
"Type": "AWS::RDS::DBParameterGroup",
"Properties": {
"Family": "MySQL5.5",
"Description": "CloudFormation Sample Database Parameter Group",
"Parameters": {
"general_log": "1",
"ResourceType": "AWS::RDS::DBParameterGroup",
"ResourceStatus": "UPDATE_COMPLETE"
},
{
"PhysicalResourceId": "auroraSubnetGroup",
"ResourceType": "AWS::RDS::DBSubnetGroup",
"Type": "AWS::RDS::DBParameterGroup"
}
}
}
Parameters
-
Description
required - String -
Family
required - String -
Parameters
optional - Map -
Tags
optional - List of Tag
Explanation in CloudFormation Registry
The
AWS::RDS::DBParameterGroup
resource creates a custom parameter group for an RDS database family.This type can be declared in a template and referenced in the
DBParameterGroupName
property of an[AWS::RDS::DBInstance](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html)
resource.For information about configuring parameters for Amazon RDS DB instances, see Working with DB parameter groups in the Amazon RDS User Guide.
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 Applying a parameter group to a DB instance may require the DB instance to reboot, resulting in a database outage for the duration of the reboot.
Frequently asked questions
What is AWS Amazon RDS Parameter Group?
AWS Amazon RDS 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 Parameter Group?
For CloudFormation, the gilyas/serverless-examples, Teslenk0/lambda-examples and mfolivas/aws-node-graphql-and-rds source code examples are useful. See the CloudFormation Example section for further details.