-
Notifications
You must be signed in to change notification settings - Fork 4k
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): fail with a descriptive error if Cluster's instance count is a deploy-time value #13765
Conversation
@skinny85 Please review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution @BLasan!
You're missing an unit test for the fix though 🙂.
@@ -651,6 +651,9 @@ interface InstanceConfig { | |||
*/ | |||
function createInstances(cluster: DatabaseClusterNew, props: DatabaseClusterBaseProps, subnetGroup: ISubnetGroup): InstanceConfig { | |||
const instanceCount = props.instances != null ? props.instances : 2; | |||
if (Token.isUnresolved(instanceCount)) { | |||
throw new Error('Instance count is not a token'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error message needs to be better here. Maybe something like:
throw new Error('Instance count is not a token'); | |
throw new Error('The number of instances an RDS Cluster consists of cannot be provided as a deploy-time only value!'); |
@skinny85 Made the requested changes. Please review |
… a deploy-time value fixes aws#13558
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good @BLasan , thanks for the contribution!
@skinny85 Build fails |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This time should do it 😉
thanks :) |
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 CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
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). |
Added a condition to check whether the
instanceCount
is a token or not. If it's not a token then an exception will be thrown.Fixes #13558
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license