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

chore(core): enable deletion of more than 10 ssm parameters at a time #27391

Merged
merged 3 commits into from
Oct 4, 2023
Merged

chore(core): enable deletion of more than 10 ssm parameters at a time #27391

merged 3 commits into from
Oct 4, 2023

Conversation

twoquarterrican
Copy link
Contributor

@twoquarterrican twoquarterrican commented Oct 3, 2023

Cross-region-ssm-writer-handler fails when trying to delete more than 10 ssm parameters

This feature is used when exporting resources from a stack in one region to a stack in another region.
It uses the crossRegionReferences: true flag in the stack.

The reason for this change is the following error I received on a stack update (slightly modified to hide some names)

❌ Deployment failed: Error: The stack named NomCoreStack failed to deploy: UPDATE_ROLLBACK_FAILED (The following resource(s) failed to update: [ExportsWriteruseast2828FA26B86FBEFA7]. ): Received response status [FAILED] from custom resource. Message returned: ValidationException: 1 validation error detected: Value '[/cdk/exports/NomServicesStack/NomCoreStackxohpRefUserPoolIdentityPoolA58D72D6C9223D28, /cdk/exports/NomIntegrationTestsStack/NomCoreStackxohpRefUserPoolUserPoolClient40176907C34D1493, /cdk/exports/NomLeafStack/NomCoreStackxohpRefUserPoolIdentityPoolA58D72D6C9223D28, /cdk/exports/NomLeafStack/NomCoreStackxohpFnGetAttUserPool6D0DFADBArnD191ECDE, /cdk/exports/NomCoreStack/NomCoreStackxohpRefUserPoolUserPoolClient40176907C34D1493, /cdk/exports/NomIntegrationTestsStack/NomCoreStackxohpFnGetAttUserPool6D0DFADBArnD191ECDE, /cdk/exports/NomIntegrationTestsStack/NomCoreStackxohpRefUserPoolIdentityPoolA58D72D6C9223D28, /cdk/exports/NomServicesStack/NomCoreStackxohpFnGetAttUserPool6D0DFADBArnD191ECDE, /cdk/exports/NomLeafStack/NomCoreStackxohpRefUserPoolUserPoolClient40176907C34D1493, /cdk/exports/NomServicesStack/NomCoreStackxohpRefUserPoolUserPoolClient40176907C34D1493, /cdk/exports/NomLeafStack/NomCoreStackxohpRefUserPoolUserPoolDomain9F01E991C941B942]' at 'names' failed to satisfy constraint: Member must have length less than or equal to 10

Design for the fix is simple: Break the list of names to delete into chunks of at most 10. Invoke delete as many times as needed to delete all. Throttling is not handled here. This may come into play when there are 50 or more parameters to delete, which may not be a concern worth addressing at this point.

Closes No issue created for this


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

@aws-cdk-automation aws-cdk-automation requested a review from a team October 3, 2023 14:46
@github-actions github-actions bot added beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2 labels Oct 3, 2023
@twoquarterrican twoquarterrican changed the title Cross region writer delete 10 names at a time fix(core): Cross region writer delete 10 names at a time Oct 3, 2023
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.

@twoquarterrican twoquarterrican changed the title fix(core): Cross region writer delete 10 names at a time fix(core): Cross region export provider ssm writer handler: delete 10 ssm parameters at a time Oct 3, 2023
@twoquarterrican
Copy link
Contributor Author

twoquarterrican commented Oct 3, 2023

Clarification Request

My change fixes some issues only seen during a stack update or delete operation. I cannot tell how to integration test these operations. Currently the pull request linter is asking me to make a change to the integration test file. I cannot see any meaningful change I can make to test the behavior that I modified. I have already updated the resulting snapshot, so all that remains is to either integration test an update or delete operation, or accept the pull request with the unit tests as sufficient verification of the update / delete operation enhancements

@aws-cdk-automation aws-cdk-automation added pr/reviewer-clarification-requested The contributor has requested clarification on feedback, a failing build, or a failing PR Linter run pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. labels Oct 3, 2023
@TheRealAmazonKendra
Copy link
Contributor

As an initial comment, please note that the title of a fix should specify the error being addressed. These titles are used in the changelog so please keep them brief and clear.

@TheRealAmazonKendra TheRealAmazonKendra added the pr-linter/exempt-integ-test The PR linter will not require integ test changes label Oct 4, 2023
@aws-cdk-automation aws-cdk-automation dismissed their stale review October 4, 2023 19:41

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

@TheRealAmazonKendra TheRealAmazonKendra changed the title fix(core): Cross region export provider ssm writer handler: delete 10 ssm parameters at a time chore(core): enable deletion of more than 10 ssm parameters at a time Oct 4, 2023
@TheRealAmazonKendra
Copy link
Contributor

I also think this is probably more of a chore than a fix because the API call is behaving as intended but we can improve the experience here by taking your change. So, I've updated the title to be a chore and to add a little clarity.

Copy link
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
Contributor

mergify bot commented Oct 4, 2023

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 aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Oct 4, 2023
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 36b8284
  • 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 08f8cd3 into aws:main Oct 4, 2023
12 checks passed
@mergify
Copy link
Contributor

mergify bot commented Oct 4, 2023

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).

@twoquarterrican twoquarterrican deleted the cross-region-ssm-delete-10 branch October 4, 2023 22:07
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/reviewer-clarification-requested The contributor has requested clarification on feedback, a failing build, or a failing PR Linter run pr-linter/exempt-integ-test The PR linter will not require integ test changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants