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

feat(s3-deployment): added property outputObjectKeys for BucketDeployment #30944

Closed
wants to merge 17 commits into from

Conversation

mrlikl
Copy link
Contributor

@mrlikl mrlikl commented Jul 24, 2024

Issue # (if applicable)

Closes #28579

Reason for this change

The CR lambda is essentially sending back the same data in the response which is hitting the limit for close to 50 object uploads.

Particularly this is being a limitation when using servicecatalog.ProductStack, if there are local assets beyond a particular number, the Custom::CDKBucketDeployment would fail with the error Response object is too long which is a hard limit of 4096 bytes.

Description of changes

  1. Added a new property to control the custom resource sending large data and hitting the 4096 bytes limit even though the deployment operation is successful.
  2. The property outputObjectKeys has been set to false by default for the service catalog product so that the error does not occur.

Description of how you validated changes

Validated using a sample stack with the property set and confirmed the behavior. Also, the existing deployments would be unaffected.

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 bug This issue is a bug. effort/medium Medium work item – several days of effort p1 labels Jul 24, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team July 24, 2024 22:07
@github-actions github-actions bot added the repeat-contributor [Pilot] contributed between 3-5 PRs to the CDK label Jul 24, 2024
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.

@mrlikl mrlikl changed the title (aws-s3-deployment): add a new property outputObjectKeys to control the custom resource from sending large data back bug(aws-s3-deployment): add a new property outputObjectKeys to control the custom resource from sending large data back Jul 24, 2024
@mrlikl mrlikl changed the title bug(aws-s3-deployment): add a new property outputObjectKeys to control the custom resource from sending large data back bug(s3-deployment): add a new property outputObjectKeys to control the custom resource from sending large data back Jul 24, 2024
@mrlikl mrlikl changed the title bug(s3-deployment): add a new property outputObjectKeys to control the custom resource from sending large data back bug(s3-deployment): added property outputObjectKeys for BucketDeployment Jul 24, 2024
@mrlikl mrlikl changed the title bug(s3-deployment): added property outputObjectKeys for BucketDeployment feat(s3-deployment): added property outputObjectKeys for BucketDeployment Jul 24, 2024
@mrlikl mrlikl changed the title feat(s3-deployment): added property outputObjectKeys for BucketDeployment fix(s3-deployment): added property outputObjectKeys for BucketDeployment Jul 24, 2024
@aws-cdk-automation aws-cdk-automation dismissed their stale review July 24, 2024 23:42

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

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jul 25, 2024
Copy link
Member

@Leo10Gama Leo10Gama left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Just a few comments and concerns to be addressed.

@@ -135,7 +136,7 @@ def cfn_error(message=None):
cfn_send(event, context, CFN_SUCCESS, physicalResourceId=physical_id, responseData={
# Passing through the ARN sequences dependencees on the deployment
'DestinationBucketArn': props.get('DestinationBucketArn'),
'SourceObjectKeys': props.get('SourceObjectKeys'),
**({'SourceObjectKeys': props.get('SourceObjectKeys')} if output_object_keys else {})
Copy link
Member

Choose a reason for hiding this comment

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

I'm not too familiar on what the ** operator does in this context?

Copy link
Contributor

Choose a reason for hiding this comment

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

This operator is to merge the content of that dictionary with the parent dictionary

@@ -104,6 +104,7 @@ export class ProductStackSynthesizer extends cdk.StackSynthesizer {
serverSideEncryption: this.serverSideEncryption,
serverSideEncryptionAwsKmsKeyId: this.serverSideEncryptionAwsKmsKeyId,
memoryLimit: this.memoryLimit,
outputObjectKeys: false,
Copy link
Member

Choose a reason for hiding this comment

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

Is setting this behaviour to false for this one module the right call? If old users have existing setups that rely on this property being true and the object keys being sent, then this acts as a breaking change for them. We can default this to true to preserve existing behaviour, and if people are running into this issue, they can set this attribute themselves.

Copy link
Contributor

Choose a reason for hiding this comment

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

ProductStackSynthesizer construct is a private construct that is not available for the customers, and also the bucketDeployment is also is not accessible by the customers, so I think it is Ok to set this property to false.

Comment on lines +109 to +114
new s3deploy.BucketDeployment(this, 'DeployMe6', {
sources: [s3deploy.Source.asset(path.join(__dirname, 'my-website-second'))],
destinationBucket: bucket6,
retainOnDelete: false, // default is true, which will block the integration test cleanup
outputObjectKeys: false,
});
Copy link
Member

Choose a reason for hiding this comment

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

Can we confirm that this test fails with outputObjectKeys = true? That is, will this BucketDeployment make a response object that exceeds the 4K character count, but deploys successfully when we do not include the object keys in the output?

Copy link
Contributor

Choose a reason for hiding this comment

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

I added a new integration Test case that test the large number of assets that should fail if the new property is not there

@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jul 29, 2024
@mrlikl mrlikl requested a review from Leo10Gama July 30, 2024 13:10
@aws-cdk-automation
Copy link
Collaborator

This PR has been in the CHANGES REQUESTED state for 3 weeks, and looks abandoned. To keep this PR from being closed, please continue work on it. If not, it will automatically be closed in a week.

@aws-cdk-automation
Copy link
Collaborator

This PR has been deemed to be abandoned, and will be automatically closed. Please create a new PR for these changes if you think this decision has been made in error.

@aws-cdk-automation aws-cdk-automation added the closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. label Aug 27, 2024
Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 27, 2024
@moelasmar moelasmar reopened this Sep 14, 2024
@mergify mergify bot dismissed Leo10Gama’s stale review September 14, 2024 11:41

Pull request has been modified.

@aws aws unlocked this conversation Sep 14, 2024
@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Sep 15, 2024
@moelasmar moelasmar changed the title fix(s3-deployment): added property outputObjectKeys for BucketDeployment feat(s3-deployment): added property outputObjectKeys for BucketDeployment Sep 15, 2024
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.

@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Sep 15, 2024
@aws-cdk-automation aws-cdk-automation dismissed their stale review September 15, 2024 02:47

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

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Sep 15, 2024
@moelasmar
Copy link
Contributor

I am not able to push large files to this PR, I copied this PR to a new one #31452 ... I will close this one in favor of the new one

@moelasmar moelasmar closed this Sep 16, 2024
Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 16, 2024
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 0c9a5b7
  • Result: FAILED
  • Build Logs (available for 30 days)

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/medium Medium work item – several days of effort p1 pr/needs-maintainer-review This PR needs a review from a Core Team Member repeat-contributor [Pilot] contributed between 3-5 PRs to the CDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(aws-s3-deployment): Fails to deploy when a large number of object keys are present
4 participants