Skip to content

(s3-deployment): times out with large files #34002

Closed
@relm923

Description

@relm923

Describe the bug

Potentially caused by #33698

Starting with 2.185.0 s3-deployments have begun timing out resulting in UPDATE_FAILED stack updates. There is nothing obvious in the CustomResource CloudWatch logs

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

2.184.1

Expected Behavior

S3 deployment succeeds with small and large files

Current Behavior

S3 deployment hangs on large files

Reproduction Steps

Create s3 deployment with 10mb file and deploy. CustomResource will hang causing CloudFormation stack to timeout and rollback

Possible Solution

Theory: attempting to read each file into memory is causing the CustomResource/Lambda to hang when the file is too large.

Pre 2.185.0 files were read line by line. In 2.185.0 each file is read into memory to determine if it contains valid JSON

Assuming reading large files is the root cause:

  • Skip replace_markers entirely if no markers passed
  • Only attempt to parse files with .json extension

Additional Information/Context

No response

CDK CLI Version

2.1006.0

Framework Version

No response

Node.js Version

22.14.0

OS

MacOS

Language

TypeScript

Language Version

No response

Other information

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions