Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(rds): deploy fails with "SubnetGroup not found" #13986

Merged
merged 4 commits into from
Apr 9, 2021

Conversation

skinny85
Copy link
Contributor

@skinny85 skinny85 commented Apr 5, 2021

As it turns out, RDS stores the name of the SubnetGroup in lowercase on the server-side.
The problem is that we weren't changing the case in CloudFormation,
and thus expressions like { Ref: SubnetGroup } were using the wrong casing,
resulting in the RDS service failing with a 404 error when providing a name for the SubnetGroup.

Fixes #13976


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

As it turns out, RDS stores the name of the SubnetGroup in lowercase on the server-side.
The problem is that we weren't changing the case in CloudFormation,
and thus expressions like `{ Ref: SubnetGroup }` were using the wrong casing,
resulting in the RDS service failing with a 404 error when providing a name for the SubnetGroup.

Fixes aws#13976
@skinny85 skinny85 requested a review from njlynch April 5, 2021 21:24
@skinny85 skinny85 self-assigned this Apr 5, 2021
@gitpod-io
Copy link

gitpod-io bot commented Apr 5, 2021

@github-actions github-actions bot added the @aws-cdk/aws-rds Related to Amazon Relational Database label Apr 5, 2021
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Apr 5, 2021
// names are actually stored by RDS changed to lowercase on the server side,
// and not lowercasing them in CloudFormation means things like { Ref }
// do not work correctly
dbSubnetGroupName: props.subnetGroupName?.toLowerCase(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably needs a Token check first.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Added.

@skinny85 skinny85 requested a review from njlynch April 8, 2021 21:14
@skinny85
Copy link
Contributor Author

skinny85 commented Apr 8, 2021

Thanks for the review @njlynch - I've addressed your comment, would appreciate another look!

@mergify
Copy link
Contributor

mergify bot commented Apr 9, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: 275dec1
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
Copy link
Contributor

mergify bot commented Apr 9, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit ad326da into aws:master Apr 9, 2021
@skinny85 skinny85 deleted the fix/rds-subnet-group-name-lowercase branch April 9, 2021 18:32
hollanddd pushed a commit to hollanddd/aws-cdk that referenced this pull request Aug 26, 2021
As it turns out, RDS stores the name of the SubnetGroup in lowercase on the server-side.
The problem is that we weren't changing the case in CloudFormation,
and thus expressions like `{ Ref: SubnetGroup }` were using the wrong casing,
resulting in the RDS service failing with a 404 error when providing a name for the SubnetGroup.

Fixes aws#13976

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-rds Related to Amazon Relational Database contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(ServerlessCluster): cdk deploy failure with custom subnetgroup reference
3 participants