How to use where clause in Knex
Create refunds with Stripe
Load HTML with Cheerio
How to send POST request with Axios
Find intersection of array in Lodash
Powered by Official white Bloop logo with a period

Terms / Privacy / Search / Support

  • const myTopic = new sns.Topic(this, 'MyTopic');
    
    myTopic.addSubscription(new subscriptions.UrlSubscription('https://foobar.com/'));
    
    Docs
    0
  • const myTopic = new sns.Topic(this, 'MyTopic');
    myTopic.addSubscription(new subscriptions.EmailSubscription('foo@bar.com'));
    
    Docs
    0
  • import * as lambda from '@aws-cdk/aws-lambda';
    
    const myTopic = new sns.Topic(this, 'myTopic');
    declare const myFunction: lambda.Function;
    myTopic.addSubscription(new subscriptions.LambdaSubscription(myFunction));
    
    Docs
    0
  • const myTopic = new sns.Topic(this, 'Topic');
    
    myTopic.addSubscription(new subscriptions.SmsSubscription('+15551231234'));
    
    Docs
    0
  • const myTopic = new sns.Topic(this, 'Topic');
    const emailAddress = new CfnParameter(this, 'email-param');
    
    myTopic.addSubscription(new subscriptions.EmailSubscription(emailAddress.valueAsString));
    
    Docs
    0
  • import * as lambda from '@aws-cdk/aws-lambda';
    
    const myTopic = new sns.Topic(this, 'MyTopic');
    declare const fn: lambda.Function;
    
    // Lambda should receive only message matching the following conditions on attributes:
    // color: 'red' or 'orange' or begins with 'bl'
    // size: anything but 'small' or 'medium'
    // price: between 100 and 200 or greater than 300
    // store: attribute must be present
    myTopic.addSubscription(new subscriptions.LambdaSubscription(fn, {
      filterPolicy: {
        color: sns.SubscriptionFilter.stringFilter({
          allowlist: ['red', 'orange'],
          matchPrefixes: ['bl'],
        }),
        size: sns.SubscriptionFilter.stringFilter({
          denylist: ['small', 'medium'],
        }),
        price: sns.SubscriptionFilter.numericFilter({
          between: { start: 100, stop: 200 },
          greaterThan: 300,
        }),
        store: sns.SubscriptionFilter.existsFilter(),
      },
    }));
    
    Docs
    0
  • import { DeliveryStream } from '@aws-cdk/aws-kinesisfirehose';
    
    const topic = new sns.Topic(this, 'Topic');
    declare const stream: DeliveryStream;
    
    new sns.Subscription(this, 'Subscription', {
      topic,
      endpoint: stream.deliveryStreamArn,
      protocol: sns.SubscriptionProtocol.FIREHOSE,
      subscriptionRoleArn: "SAMPLE_ARN", //role with permissions to send messages to a firehose delivery stream
    });
    
    Docs
    0
  • const topic = new sns.Topic(this, 'Topic');
    const dlQueue = new sqs.Queue(this, 'DeadLetterQueue', {
      queueName: 'MySubscription_DLQ',
      retentionPeriod: Duration.days(14),
    });
    
    new sns.Subscription(this, 'Subscription', {
      endpoint: 'endpoint',
      protocol: sns.SubscriptionProtocol.LAMBDA,
      topic,
      deadLetterQueue: dlQueue,
    });
    
    Docs
    0
  • // The code below shows an example of how to instantiate this type.
    // The values are placeholders you should change.
    import * as sns from '@aws-cdk/aws-sns';
    
    declare const deliveryPolicy: any;
    declare const filterPolicy: any;
    declare const redrivePolicy: any;
    
    const cfnSubscription = new sns.CfnSubscription(this, 'MyCfnSubscription', {
      protocol: 'protocol',
      topicArn: 'topicArn',
    
      // the properties below are optional
      deliveryPolicy: deliveryPolicy,
      endpoint: 'endpoint',
      filterPolicy: filterPolicy,
      rawMessageDelivery: false,
      redrivePolicy: redrivePolicy,
      region: 'region',
      subscriptionRoleArn: 'subscriptionRoleArn',
    });
    
    Docs
    0
  • import * as lambda from '@aws-cdk/aws-lambda';
    
    const myTopic = new sns.Topic(this, 'MyTopic');
    declare const fn: lambda.Function;
    
    // Lambda should receive only message matching the following conditions on attributes:
    // color: 'red' or 'orange' or begins with 'bl'
    // size: anything but 'small' or 'medium'
    // price: between 100 and 200 or greater than 300
    // store: attribute must be present
    myTopic.addSubscription(new subscriptions.LambdaSubscription(fn, {
      filterPolicy: {
        color: sns.SubscriptionFilter.stringFilter({
          allowlist: ['red', 'orange'],
          matchPrefixes: ['bl'],
        }),
        size: sns.SubscriptionFilter.stringFilter({
          denylist: ['small', 'medium'],
        }),
        price: sns.SubscriptionFilter.numericFilter({
          between: { start: 100, stop: 200 },
          greaterThan: 300,
        }),
        store: sns.SubscriptionFilter.existsFilter(),
      },
    }));
    
    Docs
    0
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples