Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(events-targets): update lambda annotation test #19527

Merged
merged 3 commits into from
Mar 23, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions packages/@aws-cdk/aws-events-targets/test/lambda/lambda.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Template } from '@aws-cdk/assertions';
import { Annotations, Template, Match } from '@aws-cdk/assertions';
import * as events from '@aws-cdk/aws-events';
import * as lambda from '@aws-cdk/aws-lambda';
import * as sqs from '@aws-cdk/aws-sqs';
Expand Down Expand Up @@ -321,8 +321,13 @@ test('must display a warning when using a Dead Letter Queue from another account

Template.fromStack(stack1).resourceCountIs('AWS::SQS::QueuePolicy', 0);

let rule = stack1.node.children.find(child => child instanceof events.Rule);
expect(rule?.node.metadataEntry[0].data).toMatch(/Cannot add a resource policy to your dead letter queue associated with rule .* because the queue is in a different account\. You must add the resource policy manually to the dead letter queue in account 222222222222\./);
Annotations.fromStack(stack1).hasWarning('/Stack1/Rule', Match.objectLike({
'Fn::Join': Match.arrayWith([
Match.arrayWith([
'Cannot add a resource policy to your dead letter queue associated with rule ',
]),
]),
}));
});


Expand Down