Skip to content

feat(rds): add copyTagsToSnapshot to the construct props for ServerlessCluster and ServerlessClusterFromSnapshot#21056

Merged
mergify[bot] merged 5 commits intoaws:mainfrom
SydneyUni-Jim:issue-20968
Jul 30, 2022
Merged

feat(rds): add copyTagsToSnapshot to the construct props for ServerlessCluster and ServerlessClusterFromSnapshot#21056
mergify[bot] merged 5 commits intoaws:mainfrom
SydneyUni-Jim:issue-20968

Conversation

@SydneyUni-Jim
Copy link
Copy Markdown
Contributor

@SydneyUni-Jim SydneyUni-Jim commented Jul 8, 2022

In f7c6289 copyTagsToSnapshot was added to DatabaseCluster and in 40a6ceb it was added to DatabaseClusterFromSnapshot as well.

This does the same for ServerlessCluster and ServerlessClusterFromSnapshot.

The implementation and tests parallels the changes mentioned above.

fixes #20968

Behaviour change

In parallel to copyTagsToSnapshot on DatabaseCluster and DatabaseClusterFromSnapshot, the default for copyTagsToSnapshot on ServerlessCluster and ServerlessClusterFromSnapshot is true.

Before this change, ServerlessCluster and ServerlessClusterFromSnapshot did not emit the CopyTagsToSnapshot property in the CloudFormation template. That resulted in the CopyTagsToSnapshot property being false.

My rationale for this behaviour change is to minimise the differences between DatabaseCluster[FromSnapshot] and ServerlessCluster[FromSnapshot], which are both realised as the same L1 construct.

Changing the CopyTagsToSnapshot property on an existing serverless RDS cluster introduces no interruption. Ref: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbcluster.html#cfn-rds-dbcluster-copytagstosnapshot


All Submissions:

New Features

  • Have you added the new feature to an integration test?
    • 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

@gitpod-io
Copy link
Copy Markdown

gitpod-io bot commented Jul 8, 2022

@aws-cdk-automation aws-cdk-automation requested a review from a team July 8, 2022 11:27
@github-actions github-actions bot added bug This issue is a bug. effort/small Small work item – less than a day of effort p2 labels Jul 8, 2022
@SydneyUni-Jim
Copy link
Copy Markdown
Contributor Author

I haven't been able to run the integration tests. I'm confronted with an error, even with a clean pull from the repo.

Verifying integration test snapshots...

Error: ENOENT: no such file or directory, open '…/aws-cdk/packages/aws-cdk/lib/init-templates/v1/info.json'
  ERROR      integ.serverless-cluster 1.051s
      Command exited with status 1
Error: ENOENT: no such file or directory, open '…/aws-cdk/packages/aws-cdk/lib/init-templates/v1/info.json'
  ERROR      integ.serverless-cluster-no-vpc 1.056s
      Command exited with status 1

Copy link
Copy Markdown
Contributor

@comcalvi comcalvi left a comment

Choose a reason for hiding this comment

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

Please add this new prop to an integ test (preferably an existing one) in this PR. Other than that, this looks pretty good.

There have been some recent changes to the init templates in cdk, can you make sure you're using the latest from main before you run the integ tests?

Via inheritance, this adds copyTagsToSnapshot to both ServerlessClusterProps and ServerlessClusterFromSnapshotProps.

This parallels copyTagsToSnapshot on DatabaseClusterBaseProps.

The default of true also parallels copyTagsToSnapshot on DatabaseClusterBaseProps.
@SydneyUni-Jim
Copy link
Copy Markdown
Contributor Author

Hi @comcalvi. I've updated the existing integ test snapshots to reflect the new default. I've also added setting a non-default to the existing integ tests.

Copy link
Copy Markdown
Contributor

@TheRealAmazonKendra TheRealAmazonKendra left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution!

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Jul 29, 2022

Thank you for contributing! Your pull request will be updated from main 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
Copy Markdown
Collaborator

AWS CodeBuild CI Report

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

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

@mergify mergify bot merged commit 47333a1 into aws:main Jul 30, 2022
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Jul 30, 2022

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

mergify bot pushed a commit that referenced this pull request Jul 30, 2022
…s not provided and it is a token (#21191)

This property is for use when the identityProvider is a Token. By default identityProvider is used as the key in the role mapping
hash, but Cloudformation only allows concrete strings to be used as hash keys.

In particular this feature is a requirement to allow a previously defined CDK UserPool to be used as an identityProvider.

closes #19222

Please note that the integ test results will need updating. I attempted to run the tests, and received the error

```
Error: ENOENT: no such file or directory, open '/home/sam/aws-cdk/packages/aws-cdk/lib/init-templates/v1/info.json'
  ERROR      integ.identitypool 0.535s
      Command exited with status 1
```

I've used `npm` to update to the latest CDK CLI. I appear to not be the only person facing this issue; see #21056 (comment)

----

### 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

* [x] 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*
@SydneyUni-Jim SydneyUni-Jim deleted the issue-20968 branch July 30, 2022 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug This issue is a bug. effort/small Small work item – less than a day of effort p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(rds): ServerlessClusterProps is missing copyTagsToSnapshot

4 participants