class ParameterGroup (construct)
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.RDS.ParameterGroup |
Java | software.amazon.awscdk.services.rds.ParameterGroup |
Python | aws_cdk.aws_rds.ParameterGroup |
TypeScript (source) | @aws-cdk/aws-rds » ParameterGroup |
Implements
IConstruct
, IConstruct
, IDependable
, IResource
, IParameter
A parameter group.
Represents both a cluster parameter group, and an instance parameter group.
Example
declare const vpc: ec2.Vpc;
const cluster = new rds.ServerlessCluster(this, 'AnotherCluster', {
engine: rds.DatabaseClusterEngine.AURORA_POSTGRESQL,
parameterGroup: rds.ParameterGroup.fromParameterGroupName(this, 'ParameterGroup', 'default.aurora-postgresql10'),
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)
}
});
Initializer
new ParameterGroup(scope: Construct, id: string, props: ParameterGroupProps)
Parameters
- scope
Construct
- id
string
- props
Parameter
Group Props
Construct Props
Name | Type | Description |
---|---|---|
engine | IEngine | The database engine for this parameter group. |
description? | string | Description for this parameter group. |
parameters? | { [string]: string } | The parameters in this parameter group. |
engine
Type:
IEngine
The database engine for this parameter group.
description?
Type:
string
(optional, default: a CDK generated description)
Description for this parameter group.
parameters?
Type:
{ [string]: string }
(optional, default: None)
The parameters in this parameter group.
Properties
Name | Type | Description |
---|---|---|
env | Resource | The environment this resource belongs to. |
node | Construct | The construct tree node associated with this construct. |
stack | Stack | The stack in which this resource is defined. |
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
node
Type:
Construct
The construct tree node associated with this construct.
stack
Type:
Stack
The stack in which this resource is defined.
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. |
static from | Imports a parameter group. |
Parameter(key, value)
addpublic 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.
RemovalPolicy(policy)
applypublic applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
Removal
Policy
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
).
ToCluster(_options)
bindpublic bindToCluster(_options: ParameterGroupClusterBindOptions): ParameterGroupClusterConfig
Parameters
- _options
Parameter
Group Cluster Bind Options
Returns
Method called when this Parameter Group is used when defining a database cluster.
ToInstance(_options)
bindpublic bindToInstance(_options: ParameterGroupInstanceBindOptions): ParameterGroupInstanceConfig
Parameters
- _options
Parameter
Group Instance Bind Options
Returns
Method called when this Parameter Group is used when defining a database instance.
String()
topublic toString(): string
Returns
string
Returns a string representation of this construct.
ParameterGroupName(scope, id, parameterGroupName)
static frompublic static fromParameterGroupName(scope: Construct, id: string, parameterGroupName: string): IParameterGroup
Parameters
- scope
Construct
- id
string
- parameterGroupName
string
Returns
Imports a parameter group.