File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
packages/@aws-cdk/aws-events Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ export class EventRule extends EventRuleRef {
7474 super ( parent , name ) ;
7575
7676 const resource = new cloudformation . RuleResource ( this , 'Resource' , {
77+ ruleName : props . ruleName ,
7778 description : props . description ,
7879 state : props . enabled == null ? 'ENABLED' : ( props . enabled ? 'ENABLED' : 'DISABLED' ) ,
7980 scheduleExpression : new Token ( ( ) => this . scheduleExpression ) ,
Original file line number Diff line number Diff line change 1- import { expect } from '@aws-cdk/assert' ;
1+ import { expect , haveResource } from '@aws-cdk/assert' ;
22import iam = require( '@aws-cdk/aws-iam' ) ;
33import cdk = require( '@aws-cdk/cdk' ) ;
44import { resolve } from '@aws-cdk/cdk' ;
@@ -30,6 +30,24 @@ export = {
3030 test . done ( ) ;
3131 } ,
3232
33+ 'rule with physical name' ( test : Test ) {
34+ // GIVEN
35+ const stack = new cdk . Stack ( ) ;
36+
37+ // WHEN
38+ new EventRule ( stack , 'MyRule' , {
39+ ruleName : 'PhysicalName' ,
40+ scheduleExpression : 'rate(10 minutes)'
41+ } ) ;
42+
43+ // THEN
44+ expect ( stack ) . to ( haveResource ( 'AWS::Events::Rule' , {
45+ Name : 'PhysicalName'
46+ } ) ) ;
47+
48+ test . done ( ) ;
49+ } ,
50+
3351 'eventPattern is rendered properly' ( test : Test ) {
3452 const stack = new cdk . Stack ( ) ;
3553
You can’t perform that action at this time.
0 commit comments