forked from aws/aws-cdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(events): archive construct does not have defaultChild set (aws#21345
) Fixes aws#21263 Adds id 'Default' to CfnArchive in Archive construct. ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information
1 parent
86e4330
commit 628c0a1
Showing
10 changed files
with
240 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
packages/@aws-cdk/aws-events/test/archive.integ.snapshot/IntegStack.assets.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": {} | ||
} |
29 changes: 29 additions & 0 deletions
29
packages/@aws-cdk/aws-events/test/archive.integ.snapshot/IntegStack.template.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
packages/@aws-cdk/aws-events/test/archive.integ.snapshot/cdk.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"version":"20.0.0"} |
14 changes: 14 additions & 0 deletions
14
packages/@aws-cdk/aws-events/test/archive.integ.snapshot/integ.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
43 changes: 43 additions & 0 deletions
43
packages/@aws-cdk/aws-events/test/archive.integ.snapshot/manifest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
92
packages/@aws-cdk/aws-events/test/archive.integ.snapshot/tree.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |