Skip to content

Commit

Permalink
Merge branch 'main' into add_codeartifact_endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Aug 1, 2022
2 parents ada23fc + de7d825 commit 96c510f
Show file tree
Hide file tree
Showing 11 changed files with 240 additions and 17 deletions.
17 changes: 0 additions & 17 deletions .github/semantic.yml

This file was deleted.

1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-events/lib/archive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,6 @@ export class Archive extends Resource {

this.archiveArn = archive.attrArn;
this.archiveName = archive.attrArchiveName;
this.node.defaultChild = archive;
}
}
2 changes: 2 additions & 0 deletions packages/@aws-cdk/aws-events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@
"@aws-cdk/assertions": "0.0.0",
"@aws-cdk/cdk-build-tools": "0.0.0",
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/integ-tests": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.5.2",
"jest": "^27.5.1"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": "20.0.0",
"files": {
"c328ab321c3d5fd5f5a82abed4520136f53bd07785ecd2a382c66fc17090bb0d": {
"source": {
"path": "IntegStack.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "c328ab321c3d5fd5f5a82abed4520136f53bd07785ecd2a382c66fc17090bb0d.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
}
},
"dockerImages": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"Resources": {
"EventBridgeF6D0CF9D": {
"Type": "AWS::Events::EventBus",
"Properties": {
"Name": "IntegStackEventBridgeF828A2C9"
}
},
"MyCustomArchive": {
"Type": "AWS::Events::Archive",
"Properties": {
"SourceArn": {
"Fn::GetAtt": [
"EventBridgeF6D0CF9D",
"Arn"
]
},
"EventPattern": {
"account": [
{
"Ref": "AWS::AccountId"
}
]
},
"RetentionDays": 0
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":"20.0.0"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"version": "20.0.0",
"testCases": {
"integ.archive": {
"stacks": [
"IntegStack"
],
"diffAssets": false,
"stackUpdateWorkflow": true
}
},
"synthContext": {},
"enableLookups": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"version": "20.0.0",
"artifacts": {
"Tree": {
"type": "cdk:tree",
"properties": {
"file": "tree.json"
}
},
"IntegStack": {
"type": "aws:cloudformation:stack",
"environment": "aws://unknown-account/unknown-region",
"properties": {
"templateFile": "IntegStack.template.json",
"validateOnSynth": false
},
"metadata": {
"/IntegStack/EventBridge/Resource": [
{
"type": "aws:cdk:logicalId",
"data": "EventBridgeF6D0CF9D"
}
],
"/IntegStack/Archive/Archive": [
{
"type": "aws:cdk:logicalId",
"data": "MyCustomArchive"
}
],
"Archive4DBC1EC9": [
{
"type": "aws:cdk:logicalId",
"data": "Archive4DBC1EC9",
"trace": [
"!!DESTRUCTIVE_CHANGES: WILL_DESTROY"
]
}
]
},
"displayName": "IntegStack"
}
}
}
92 changes: 92 additions & 0 deletions packages/@aws-cdk/aws-events/test/archive.integ.snapshot/tree.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
"version": "tree-0.1",
"tree": {
"id": "App",
"path": "",
"children": {
"Tree": {
"id": "Tree",
"path": "Tree",
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.1.58"
}
},
"IntegStack": {
"id": "IntegStack",
"path": "IntegStack",
"children": {
"EventBridge": {
"id": "EventBridge",
"path": "IntegStack/EventBridge",
"children": {
"Resource": {
"id": "Resource",
"path": "IntegStack/EventBridge/Resource",
"attributes": {
"aws:cdk:cloudformation:type": "AWS::Events::EventBus",
"aws:cdk:cloudformation:props": {
"name": "IntegStackEventBridgeF828A2C9"
}
},
"constructInfo": {
"fqn": "@aws-cdk/aws-events.CfnEventBus",
"version": "0.0.0"
}
}
},
"constructInfo": {
"fqn": "@aws-cdk/aws-events.EventBus",
"version": "0.0.0"
}
},
"Archive": {
"id": "Archive",
"path": "IntegStack/Archive",
"children": {
"Archive": {
"id": "Archive",
"path": "IntegStack/Archive/Archive",
"attributes": {
"aws:cdk:cloudformation:type": "AWS::Events::Archive",
"aws:cdk:cloudformation:props": {
"sourceArn": {
"Fn::GetAtt": [
"EventBridgeF6D0CF9D",
"Arn"
]
},
"eventPattern": {
"account": [
{
"Ref": "AWS::AccountId"
}
]
},
"retentionDays": 0
}
},
"constructInfo": {
"fqn": "@aws-cdk/aws-events.CfnArchive",
"version": "0.0.0"
}
}
},
"constructInfo": {
"fqn": "@aws-cdk/aws-events.Archive",
"version": "0.0.0"
}
}
},
"constructInfo": {
"fqn": "@aws-cdk/core.Stack",
"version": "0.0.0"
}
}
},
"constructInfo": {
"fqn": "@aws-cdk/core.App",
"version": "0.0.0"
}
}
}
16 changes: 16 additions & 0 deletions packages/@aws-cdk/aws-events/test/archive.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,20 @@ describe('archive', () => {
},
});
});

test('should have defined defaultChild', () => {
const stack = new Stack();

const eventBus = new EventBus(stack, 'Bus');

const archive = new Archive(stack, 'Archive', {
sourceEventBus: eventBus,
eventPattern: {
account: [stack.account],
},
retention: Duration.days(10),
});

expect(archive.node.defaultChild).toBe(archive.node.findChild('Archive'));
});
});
23 changes: 23 additions & 0 deletions packages/@aws-cdk/aws-events/test/integ.archive.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { App, Stack } from '@aws-cdk/core';
import { IntegTest } from '@aws-cdk/integ-tests';
import { Archive, CfnArchive, EventBus } from '../lib';

const app = new App();

const stack = new Stack(app, 'IntegStack');

const eventBus = new EventBus(stack, 'EventBridge');

const archive = new Archive(stack, 'Archive', {
sourceEventBus: eventBus,
eventPattern: {
account: [stack.account],
},
});
(archive.node.defaultChild as CfnArchive).overrideLogicalId('MyCustomArchive');

new IntegTest(app, 'ArchiveTest', {
testCases: [stack],
});

app.synth();

0 comments on commit 96c510f

Please sign in to comment.