Skip to content

aws_rds: unable to use per-instance parameters #27035

@jessecollier

Description

@jessecollier

Describe the bug

When trying to use the parameters property during ClusterInstance.provisioned, it will try to create a ParameterGroup for you using the id InstanceParameterGroup.

If you try to have multiple instances (ie multiple readers) in a DatabaseCluster, this will throw error:

Error: There is already a Construct with name 'InstanceParameterGroup' in DatabaseCluster [Database]

Here's the specific line of code:
https://github.com/aws/aws-cdk/blob/v2.94.0/packages/aws-cdk-lib/aws-rds/lib/aurora-cluster-instance.ts#L457-L464

Expected Behavior

I should be able to provide a simple parameters object and a parameter group to be created for each unique instance.

Current Behavior

Throws an error

Reproduction Steps

Create a DatabaseCluster with multiple readers with the parameters: {} property set:

ClusterInstance.provisioned(`Instance${id}`, {
         parameters: {}
    });

Possible Solution

The ParameterGroup scope is the cluster, either the scope should be specific to the ClusterInstance, or the ParameterGroup should have a unique ID.

Additional Information/Context

No response

CDK CLI Version

2.94.0

Framework Version

No response

Node.js Version

18

OS

mac osx latest

Language

Typescript

Language Version

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-rdsRelated to Amazon Relational DatabasebugThis issue is a bug.effort/smallSmall work item – less than a day of effortp1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions