question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[aws-rds] ParameterGroup is missing from CloudFormation template

See original GitHub issue

Since version 1.58.0 ParameterGroup resources are missing from the generated CloudFormation template.

Reproduction Steps

  • Create a new cdk app using version 1.51.0 and add the following code in the stack:
new ParameterGroup(this, "RDS-ParameterGroup", {
  family: "mysql:5.7",
});
  • Run the cdk synth command and verify that the AWS::RDS::DBParameterGroup resource exists in the generated CloudFormation template.
  • Now update cdk to version 1.58.0 and modify the ParameterGroup to:
new ParameterGroup(this, "RDS-ParameterGroup", {
  engine: DatabaseInstanceEngine.mysql({
    version: MysqlEngineVersion.VER_5_7,
  }),
});
  • Run the cdk synth command and view the generated CloudFormation template. The AWS::RDS::DBParameterGroup resource is missing.

What did you expect to happen?

The AWS::RDS::DBParameterGroup resource should exist in both versions of aws cdk.

What actually happened?

The AWS::RDS::DBParameterGroup resource exists in version 1.51.0 but not in 1.58.0.

Environment

  • CLI Version: 1.58.0
  • Framework Version: 1.58.0
  • Node.js Version: 14.5.0
  • OS: Windows 10
  • Language (Version): TypeScript (3.9.6)

This is 🐛 Bug Report

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
skinny85commented, Mar 1, 2022

@lossanarch if you want to shoot me a quick PR (doesn’t have to be super polished, just a draft with the rough proposal is fine), I’d be down to discuss the concrete steps to fix this 😉.

1reaction
skinny85commented, Aug 17, 2020

Hey @manospasj ,

yes, the issue is exactly what @Chriscbr said. Basically, the ParameterGroup class is used both for AWS::RDS::DBParameterGroup and AWS::RDS::DBClusterParameterGroup, and creates the correct underlying resource when it’s passed to Instance or Cluster, respectively.

Also, this line in the source code needs to be updated as it suggests that the ParameterGroup class can only create a AWS::RDS::DBParameterGroup resource. The AWS::RDS::DBClusterParameterGroup resource needs to be included.

Unfortunately, we can’t have multiple CloudFormation resource types there. But I’ll try to update the docs to make it sure it’s more clear.

(It also looks like right now, if you tried to call bindToInstance() and then bindToCluster() afterwards, it would just ignore the second call, and perhaps it should really throw an error - but that’s a separate issue.)

Nope, that is not the behavior currently. The second call, to bindToCluster(), will actually create the AWS::RDS::DBClusterParameterGroup. So you’ll have 2 groups, an AWS::RDS::DBParameterGroup and an AWS::RDS::DBClusterParameterGroup.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Working with parameter groups - AWS Documentation
An example is when you want to include most of an existing DB parameter group's custom parameters and values in a new DB...
Read more >
How do you associate a IAM Role with an Aurora Cluster ...
When I run aws rds describe-db-clusters I see an entry for "AssociatedRoles" that holds an array of objects with a Status and RoleArn....
Read more >
Why You Should Always Use a Custom DB Parameter Group ...
For AWS RDS instances, you manage your database engine configuration through the use of parameters in a DB parameter group. DB parameter groups...
Read more >
aws_db_parameter_group | Resources | hashicorp/aws
Browse aws documentation ... Provides an RDS DB parameter group resource. ... For an example of the aws_db_parameter_group in use, follow the Manage...
Read more >
aws rds cli -- need to search the db-parameter-group(s) for a ...
Example aws rds describe-db-parameters --db-parameter-group-name xxxx --query 'Parameters[].{ParameterName: ParameterName, ParameterValue: ParameterValue}' ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found