class ParameterGroup (construct)
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.RDS.ParameterGroup |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsrds#ParameterGroup |
Java | software.amazon.awscdk.services.rds.ParameterGroup |
Python | aws_cdk.aws_rds.ParameterGroup |
TypeScript (source) | aws-cdk-lib » aws_rds » ParameterGroup |
Implements
IConstruct, IDependable, IResource, IEnvironment, IParameter, IDBParameter, IDBCluster
A parameter group.
Represents both a cluster parameter group (AWS::RDS::DBClusterParameterGroup), and an instance parameter group (AWS::RDS::DBParameterGroup).
Example
declare const vpc: ec2.Vpc;
const cluster = new rds.ServerlessCluster(this, 'AnotherCluster', {
engine: rds.DatabaseClusterEngine.AURORA_POSTGRESQL,
copyTagsToSnapshot: true, // whether to save the cluster tags when creating the snapshot. Default is 'true'
parameterGroup: rds.ParameterGroup.fromParameterGroupName(this, 'ParameterGroup', 'default.aurora-postgresql11'),
vpc,
scaling: {
autoPause: Duration.minutes(10), // default is to pause after 5 minutes of idle time
minCapacity: rds.AuroraCapacityUnit.ACU_8, // default is 2 Aurora capacity units (ACUs)
maxCapacity: rds.AuroraCapacityUnit.ACU_32, // default is 16 Aurora capacity units (ACUs)
timeout: Duration.seconds(100), // default is 5 minutes
timeoutAction: rds.TimeoutAction.FORCE_APPLY_CAPACITY_CHANGE // default is ROLLBACK_CAPACITY_CHANGE
}
});
Initializer
new ParameterGroup(scope: Construct, id: string, props: ParameterGroupProps)
Parameters
- scope
Construct - id
string - props
ParameterGroup Props
Construct Props
| Name | Type | Description |
|---|---|---|
| engine | IEngine | The database engine for this parameter group. |
| description? | string | Description for this parameter group. |
| name? | string | The name of this parameter group. |
| parameters? | { [string]: string } | The parameters in this parameter group. |
| removal | Removal | The CloudFormation policy to apply when the instance is removed from the stack or replaced during an update. |
engine
Type:
IEngine
The database engine for this parameter group.
description?
Type:
string
(optional, default: a CDK generated description)
Description for this parameter group.
name?
Type:
string
(optional, default: CloudFormation-generated name)
The name of this parameter group.
parameters?
Type:
{ [string]: string }
(optional, default: None)
The parameters in this parameter group.
removalPolicy?
Type:
Removal
(optional, default: RemovalPolicy.DESTROY)
The CloudFormation policy to apply when the instance is removed from the stack or replaced during an update.
Properties
| Name | Type | Description |
|---|---|---|
| db | DBCluster | A reference to this parameter group as a DB cluster parameter group. |
| db | DBParameter | A reference to this parameter group as a DB parameter group. |
| env | Resource | The environment this resource belongs to. |
| node | Node | The tree node. |
| stack | Stack | The stack in which this resource is defined. |
| static PROPERTY_INJECTION_ID | string | Uniquely identifies this class. |
dbClusterParameterGroupRef
Type:
DBCluster
A reference to this parameter group as a DB cluster parameter group.
dbParameterGroupRef
Type:
DBParameter
A reference to this parameter group as a DB parameter group.
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed in a Stack (those created by
creating new class instances like new Role(), new Bucket(), etc.), this
is always the same as the environment of the stack they belong to.
For referenced resources (those obtained from referencing methods like
Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be
different than the stack they were imported into.
node
Type:
Node
The tree node.
stack
Type:
Stack
The stack in which this resource is defined.
static PROPERTY_INJECTION_ID
Type:
string
Uniquely identifies this class.
Methods
| Name | Description |
|---|---|
| add | Add a parameter to this parameter group. |
| apply | Apply the given removal policy to this resource. |
| bind | Method called when this Parameter Group is used when defining a database cluster. |
| bind | Method called when this Parameter Group is used when defining a database instance. |
| to | Returns a string representation of this construct. |
| with(...mixins) | Applies one or more mixins to this construct. |
| static for | Creates a standalone cluster parameter group. |
| static for | Creates a standalone instance parameter group. |
| static from | Imports a parameter group. |
addParameter(key, value)
public addParameter(key: string, value: string): boolean
Parameters
- key
string— The key of the parameter to be added. - value
string— The value of the parameter to be added.
Returns
boolean
Add a parameter to this parameter group.
applyRemovalPolicy(policy)
public applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
RemovalPolicy
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN).
bindToCluster(_options)
public bindToCluster(_options: ParameterGroupClusterBindOptions): ParameterGroupClusterConfig
Parameters
- _options
ParameterGroup Cluster Bind Options
Returns
Method called when this Parameter Group is used when defining a database cluster.
bindToInstance(_options)
public bindToInstance(_options: ParameterGroupInstanceBindOptions): ParameterGroupInstanceConfig
Parameters
- _options
ParameterGroup Instance Bind Options
Returns
Method called when this Parameter Group is used when defining a database instance.
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.
with(...mixins)
public with(...mixins: IMixin[]): IConstruct
Parameters
- mixins
IMixin
Returns
Applies one or more mixins to this construct.
Mixins are applied in order. The list of constructs is captured at the
start of the call, so constructs added by a mixin will not be visited.
Use multiple with() calls if subsequent mixins should apply to added
constructs.
static forCluster(scope, id, props)
public static forCluster(scope: Construct, id: string, props: ParameterGroupProps): IParameterGroup
Parameters
- scope
Construct - id
string - props
ParameterGroup Props
Returns
Creates a standalone cluster parameter group.
This method allows you to explicitly create a parameter group without binding it to a database cluster.
static forInstance(scope, id, props)
public static forInstance(scope: Construct, id: string, props: ParameterGroupProps): IParameterGroup
Parameters
- scope
Construct - id
string - props
ParameterGroup Props
Returns
Creates a standalone instance parameter group.
This method allows you to explicitly create a parameter group without binding it to a database instance.
static fromParameterGroupName(scope, id, parameterGroupName)
public static fromParameterGroupName(scope: Construct, id: string, parameterGroupName: string): IParameterGroup
Parameters
- scope
Construct - id
string - parameterGroupName
string
Returns
Imports a parameter group.

.NET
Go
Java
Python
TypeScript (