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

docs(rds): clarify how to enable S3Import/S3Export in Readme.md #30459

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

duranbe
Copy link

@duranbe duranbe commented Jun 5, 2024

Reason for this change

Documentation does not state clearly that feature needs to be manually enabled when using Postgres

Example :
The following code will fail with the error message

const cluster = new rds.DatabaseCluster(this, 'Database', {
      engine: rds.DatabaseClusterEngine.auroraPostgres({version: AuroraPostgresEngineVersion.of('12.7','12')}),
      writer: rds.ClusterInstance.provisioned('writer', {
        instanceType: ec2.InstanceType.of(ec2.InstanceClass.R6G, ec2.InstanceSize.XLARGE4),
      }),
      serverlessV2MinCapacity: 6.5,
      serverlessV2MaxCapacity: 64,
      s3ImportRole: sampleRole
});

Will fail with this error message :Error: s3Import is not supported for Postgres version: 12.7. Use a version that supports the s3Import feature

But the thing is that 12.7 does support it ! The real problem here is that the feature needs to be enabled as such

const cluster = new rds.DatabaseCluster(this, 'Database', {
      engine: rds.DatabaseClusterEngine.auroraPostgres({version: AuroraPostgresEngineVersion.of('12.7','12', {s3Export: true, s3Import:true})}),
      writer: rds.ClusterInstance.provisioned('writer', {
        instanceType: ec2.InstanceType.of(ec2.InstanceClass.R6G, ec2.InstanceSize.XLARGE4),
      }),
      serverlessV2MinCapacity: 6.5,
      serverlessV2MaxCapacity: 64,
      s3ImportRole: sampleRole
});

Description of changes

Small update to Readme.md and inline TSdoc

Description of how you validated changes

None

Checklist


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

@github-actions github-actions bot added p2 beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK labels Jun 5, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team June 5, 2024 18:53
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@duranbe duranbe changed the title Update README.md of aws-cdk-lib/aws-rds with details to enable S3Impo… docs(rds): Clarify how to enable S3Import/S3Export in Readme.md Jun 5, 2024
@duranbe duranbe changed the title docs(rds): Clarify how to enable S3Import/S3Export in Readme.md docs(rds): clarify how to enable S3Import/S3Export in Readme.md Jun 5, 2024
@aws-cdk-automation aws-cdk-automation dismissed their stale review June 5, 2024 19:13

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jun 5, 2024
Copy link
Contributor

@aaythapa aaythapa left a comment

Choose a reason for hiding this comment

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

Hi, thanks for making this change! Is there any documentation that supports this claim? Just want to make sure before approving

@duranbe
Copy link
Author

duranbe commented Jun 10, 2024

Hello !
Sure I can, here is the AWS Doc for S3Import, that mentions this feature to choose from.

As well, here is the relevant code that checks if the S3Import/S3Export feature has been enabled, which by default is false

https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-rds/lib/cluster-engine.ts#L1061

Actually now that I think of it, the error message s3Import is not supported for Postgres version: ${this.engineVersion.fullVersion}. Use a version that supports the s3Import feature. is a bit misleading as the issue could also be not having enabled the feature when declaring the DatabaseClusterEngine

Copy link
Contributor

@scanlonp scanlonp left a comment

Choose a reason for hiding this comment

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

Hey @duranbe, quick note. Our doc generation has some odd behavior with respect to tags (@see, @default, etc.). Any text after a tag will be omitted. Only the last @see link will be used.

Take a look at s3ExportRole in our docs (link). You'll see that 'For PostgreSQL:' does not show up. Also the link is the PostgreSQL link (the last one).

While this problem is widespread in the file, you should be good only fixing the formatting for these two props. That should help your changes to actually show up!

@duranbe
Copy link
Author

duranbe commented Jun 15, 2024

Hey @scanlonp - thanks for the advice, indeed this is a odd behavior, I modified as I expect to render. Is there a way to build locally the doc ? I might have missed it in the contributing guide

@duranbe duranbe requested a review from evzzk July 3, 2024 08:25
@duranbe
Copy link
Author

duranbe commented Jul 8, 2024

I updated the PR with an example - it might also make sense to update the error message

@duranbe
Copy link
Author

duranbe commented Jul 10, 2024

Updated after comments 🙌

@duranbe
Copy link
Author

duranbe commented Jul 11, 2024

Good on my side 👍

scanlonp
scanlonp previously approved these changes Jul 17, 2024
Copy link
Contributor

@scanlonp scanlonp left a comment

Choose a reason for hiding this comment

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

Nice work @duranbe! It turned out to be a simple change, but I really like how clear the wording is.

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jul 17, 2024
@duranbe
Copy link
Author

duranbe commented Jul 17, 2024

the wording is all thanks to @evzzk !

@mergify mergify bot dismissed scanlonp’s stale review July 22, 2024 19:17

Pull request has been modified.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: c303657
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jul 22, 2024
@duranbe duranbe requested a review from scanlonp July 22, 2024 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2 pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants