Skip to content

DefaultStackSynthesizer: Using a StackSynthesizer and Sharing Assets will only Publish One Asset and Not the Other #25927

@ObOne5524

Description

@ObOne5524

Describe the bug

If a Synthesizer is used and the an Asset is shared between two Stacks on the same App, one of the Stacks will have a published asset to reference while the other Stack will not.

Expected Behavior

If a Synthesizer is used and the prefixes are different, the Assets should be able accessible to both Stacks.

Current Behavior

One Stack will be able to access the asset, while the other will return a Resource handler returned message: "Error occurred while GetObject. S3 Error Code: NoSuchKey. S3 Error Message: The specified key does not exist. due to a missing asset.

Reproduction Steps

  1. Define a bin or app.py file that creates two stacks
  2. Define a DefaultStackSynthesizer
  3. Define a Lambda Function resource with a logRetention prop

Possible Solution

Since this is unique to version 2.8X.X, the Asset removal might need to be reviewed

Additional Information/Context

No response

CDK CLI Version

2.81.0

Framework Version

No response

Node.js Version

18.16.0

OS

macOS 12.6.6

Language

Typescript, Python, .NET, Java, Go

Language Version

5.0.4

Other information

No response

Metadata

Metadata

Assignees

Labels

@aws-cdk/assetsRelated to the @aws-cdk/assets packagebugThis issue is a bug.effort/mediumMedium work item – several days of effortp1

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions