-
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
(aws-docdb): Incorrect enum in sample snippet #20747
Comments
This is a known bug with our non - typescript languages. Enums that have multiple of the same value will be dropped to only include one. In this case, you've found that MEMORY5 is the same! So you'll have to stick with that one until we get this bug fixed. We should update this example to use the enum that actually compiles to our other languages |
ah thanks for the confirmation @peterwoodworth , good to know and much appreciated!! feel free to close this ticket when appropriate. |
Hey @josephedward ! Our documentation is autogenerated from our TypeScript library - so you will only have to change the examples found in CDK TS code library. In this case, I can see three examples which use |
Thanks @peterwoodworth, created a PR here #20906 - is there a way to run that transpiler locally to see it in action? Just curious 🤔 |
…ng used (#20906) Due to a bug in jsii, only the first instance of enums that have duplicate values appear in non-TS languages. This means that non-TS examples that use the enums that do not appear fail to build. This PR changes the enums used to fix the failing examples. fixes #20747 ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
…ng used (aws#20906) Due to a bug in jsii, only the first instance of enums that have duplicate values appear in non-TS languages. This means that non-TS examples that use the enums that do not appear fail to build. This PR changes the enums used to fix the failing examples. fixes aws#20747 ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Describe the issue
The API documentation for aws_docdb.DatabaseCluster, for CDKv1 and CDKv2 shares the following sample code:
Deploying returns the following error, for both CDKv1 and v2:
However, the following code works just fine:
And synthesizes the following template:
One will notice the InstanceClass gets resolved to a R5 Large anyway. In accordance with the enum value.
While I am not quite sure why the R5 enum fails to work, despite it existing, the point is that to avoid such confusion for others, should we perhaps edit the documentation to reflect the MEMORY5 enum rather?
Links
https://docs.aws.amazon.com/cdk/api/v1/python/aws_cdk.aws_docdb/DatabaseCluster.html
https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk.aws_docdb/DatabaseCluster.html
The text was updated successfully, but these errors were encountered: