Skip to content

Commit 30f1ae4

Browse files
authored
2 parents 077d77d + 1686170 commit 30f1ae4

File tree

24 files changed

+1021
-418
lines changed

24 files changed

+1021
-418
lines changed

CHANGELOG.v2.alpha.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [2.55.1-alpha.0](https://github.com/aws/aws-cdk/compare/v2.55.0-alpha.0...v2.55.1-alpha.0) (2022-12-16)
6+
57
## [2.55.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.54.0-alpha.0...v2.55.0-alpha.0) (2022-12-14)
68

79

CHANGELOG.v2.md

+7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [2.55.1](https://github.com/aws/aws-cdk/compare/v2.55.0...v2.55.1) (2022-12-16)
6+
7+
8+
### Bug Fixes
9+
10+
* **s3-deployment:** source markers missing when there are multiple sources ([0bb0181](https://github.com/aws/aws-cdk/commit/0bb01815b2fa7708ded6a72e220916e2388993cf)), closes [#23321](https://github.com/aws/aws-cdk/issues/23321) [40aws-cdk/aws-s3-deployment/lib/lambda/index.py#L64](https://github.com/40aws-cdk/aws-s3-deployment/lib/lambda/index.py/issues/L64) [40aws-cdk/aws-s3-deployment/lib/lambda/index.py#L137](https://github.com/40aws-cdk/aws-s3-deployment/lib/lambda/index.py/issues/L137)
11+
512
## [2.55.0](https://github.com/aws/aws-cdk/compare/v2.54.0...v2.55.0) (2022-12-14)
613

714

packages/@aws-cdk/aws-s3-deployment/lib/bucket-deployment.ts

+4
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,10 @@ export class BucketDeployment extends Construct {
369369
return this.sources.reduce((acc, source) => {
370370
if (source.markers) {
371371
acc.push(source.markers);
372+
// if there are more than 1 source, then all sources
373+
// require markers (custom resource will throw an error otherwise)
374+
} else if (this.sources.length > 1) {
375+
acc.push({});
372376
}
373377
return acc;
374378
}, [] as Array<Record<string, any>>);

packages/@aws-cdk/aws-s3-deployment/test/bucket-deployment.test.ts

+20
Original file line numberDiff line numberDiff line change
@@ -1384,6 +1384,26 @@ test('can add sources with addSource', () => {
13841384
});
13851385
});
13861386

1387+
test('if any source has markers then all sources have markers', () => {
1388+
const app = new cdk.App();
1389+
const stack = new cdk.Stack(app, 'Test');
1390+
const bucket = new s3.Bucket(stack, 'Bucket');
1391+
const deployment = new s3deploy.BucketDeployment(stack, 'Deploy', {
1392+
sources: [s3deploy.Source.data('my/path.txt', 'helloWorld')],
1393+
destinationBucket: bucket,
1394+
});
1395+
deployment.addSource(s3deploy.Source.asset(path.join(__dirname, 'my-website')));
1396+
1397+
const result = app.synth();
1398+
const content = readDataFile(result, 'my/path.txt');
1399+
expect(content).toStrictEqual('helloWorld');
1400+
Template.fromStack(stack).hasResourceProperties('Custom::CDKBucketDeployment', {
1401+
SourceMarkers: [
1402+
{},
1403+
{},
1404+
],
1405+
});
1406+
});
13871407

13881408
function readDataFile(casm: cxapi.CloudAssembly, relativePath: string): string {
13891409
const assetDirs = readdirSync(casm.directory).filter(f => f.startsWith('asset.'));
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,6 @@ def aws_command(*args):
236236
def cfn_send(event, context, responseStatus, responseData={}, physicalResourceId=None, noEcho=False, reason=None):
237237

238238
responseUrl = event['ResponseURL']
239-
logger.info(responseUrl)
240239

241240
responseBody = {}
242241
responseBody['Status'] = responseStatus
@@ -306,4 +305,4 @@ def replace_markers(filename, markers):
306305

307306
# # delete the original file and rename the new one to the original
308307
os.remove(filename)
309-
os.rename(outfile, filename)
308+
os.rename(outfile, filename)

packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/asset.33e2651435a0d472a75c1e033c9832b21321d9e56711926b04c5705e5f63874c/__entrypoint__.js

+144
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/asset.60767da3831353fede3cfe92efef10580a600592dec8ccbb06c051e95b9c1b26/__entrypoint__.js

-118
This file was deleted.

packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/asset.60767da3831353fede3cfe92efef10580a600592dec8ccbb06c051e95b9c1b26/index.d.ts

-1
This file was deleted.

packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.js.snapshot/asset.60767da3831353fede3cfe92efef10580a600592dec8ccbb06c051e95b9c1b26/index.ts

-82
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
helloworld
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<h1>Hello, S3 bucket deployments!</h1>
2+
<img src="rabir2v.gif">

0 commit comments

Comments
 (0)