AppStagingSynthesizer: BucketDeployment fails copy
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Describe the bug
When using `BucketDeployment` for deploying a local folder along with `AppStagingSynthesizer` (@aws-cdk/app-staging-synthesizer-alpha), it fails.
BucketDeployment is used as
```
new BucketDeployment(this, 'Content', {
sources: [Source.asset(path.join(__dirname, 'content'))],
destinationBucket: contentBucket,
vpc: customVpc,
vpcSubnets: {
subnets: customVpc.connectivitySubnets,
},
});
```
The custom ressource within BucketDeployment returns
```
Received response status [FAILED] from custom resource. Message returned: Command '['/opt/awscli/aws', 's3', 'cp', 's3://${CORRECT_BUCKET_ADDRESS}/deploy-time/9ece006bc2680af0997c046110f690bd28ba8f97707060b46e3b7eaeeaa74a12.zip', '/tmp/tmplfzrh7br/f5e46c0a-4142-4006-80d4-53555676295f']' returned non-zero exit status 1. (RequestId: 879bce4c-63f9-4cc6-8da2-ebe1ad652d39)
```
The same error occurs when separating the asset (like https://docs.aws.amazon.com/cdk/api/v2/docs/app-staging-synthesizer-alpha-readme.html#deploy-time-s3-assets).
Running `aws s3 cp s3://${CORRECT_BUCKET_ADDRESS}/deploy-time/9ece006bc2680af0997c046110f690bd28ba8f97707060b46e3b7eaeeaa74a12.zip ./` locally copies the data as expected.
### Expected Behavior
It should work as without `AppStagingSynthesizer`.
### Reproduction Steps
Create a deployment that uses `BucketDeployment` together with `AppStagingSynthesizer`.
### CDK CLI Version
2.90.0 (build 8c535e4)
### Node.js Version
v18.16.0
### OS
OS X 13.5
### Language
Typescript
Contributor guide
Research direction
Start with the BucketDeployment custom resource and its interaction with AppStagingSynthesizer, using the provided deployment and separated-asset examples as reproduction cases. Compare the failing deploy-time `aws s3 cp` invocation with the locally successful command; done means BucketDeployment can copy the asset when AppStagingSynthesizer is enabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100