Skip to content

Commit 3570b17

Browse files
authored
chore(iot-actions): clarify the test difference (#17451)
This PR refactor the test that I committed earlier, and is based on the following comment. - #17307 (comment) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent af61b7f commit 3570b17

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed

Diff for: packages/@aws-cdk/aws-iot-actions/test/cloudwatch-logs/cloudwatch-logs-action.test.ts

+2-22
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Template } from '@aws-cdk/assertions';
1+
import { Template, Match } from '@aws-cdk/assertions';
22
import * as iam from '@aws-cdk/aws-iam';
33
import * as iot from '@aws-cdk/aws-iot';
44
import * as logs from '@aws-cdk/aws-logs';
@@ -95,32 +95,12 @@ test('can set role', () => {
9595
Template.fromStack(stack).hasResourceProperties('AWS::IoT::TopicRule', {
9696
TopicRulePayload: {
9797
Actions: [
98-
{
99-
CloudwatchLogs: {
100-
LogGroupName: 'my-log-group',
101-
RoleArn: 'arn:aws:iam::123456789012:role/ForTest',
102-
},
103-
},
98+
Match.objectLike({ CloudwatchLogs: { RoleArn: 'arn:aws:iam::123456789012:role/ForTest' } }),
10499
],
105100
},
106101
});
107102

108103
Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', {
109-
PolicyDocument: {
110-
Statement: [
111-
{
112-
Action: ['logs:CreateLogStream', 'logs:PutLogEvents'],
113-
Effect: 'Allow',
114-
Resource: 'arn:aws:logs:us-east-1:123456789012:log-group:my-log-group:*',
115-
},
116-
{
117-
Action: 'logs:DescribeLogStreams',
118-
Effect: 'Allow',
119-
Resource: 'arn:aws:logs:us-east-1:123456789012:log-group:my-log-group:*',
120-
},
121-
],
122-
Version: '2012-10-17',
123-
},
124104
PolicyName: 'MyRolePolicy64AB00A5',
125105
Roles: ['ForTest'],
126106
});

0 commit comments

Comments
 (0)