File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
packages/aws-cdk-lib/aws-sns/test Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -259,6 +259,29 @@ describe('Subscription', () => {
259259 } ) ;
260260 } ) ;
261261
262+ test . each ( [ true , false ] ) ( 'with %s existsFilter' , ( existsValue : boolean ) => {
263+ // GIVEN
264+ const stack = new cdk . Stack ( ) ;
265+ const topic = new sns . Topic ( stack , 'Topic' ) ;
266+
267+ // WHEN
268+ new sns . Subscription ( stack , 'Subscription' , {
269+ endpoint : 'endpoint' ,
270+ filterPolicy : {
271+ size : sns . SubscriptionFilter . existsFilter ( existsValue ) ,
272+ } ,
273+ protocol : sns . SubscriptionProtocol . LAMBDA ,
274+ topic,
275+ } ) ;
276+
277+ // THEN
278+ Template . fromStack ( stack ) . hasResourceProperties ( 'AWS::SNS::Subscription' , {
279+ FilterPolicy : {
280+ size : [ { exists : existsValue } ] ,
281+ } ,
282+ } ) ;
283+ } ) ;
284+
262285 test ( 'with delivery policy' , ( ) => {
263286 // GIVEN
264287 const stack = new cdk . Stack ( ) ;
You can’t perform that action at this time.
0 commit comments