How to use the @aws-cdk/aws-sns.Topic function in @aws-cdk/aws-sns

To help you get started, we’ve selected a few @aws-cdk/aws-sns examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws / aws-cdk / packages / aws-cdk / integ-tests / app / app.js View on Github external
constructor(parent, id, providingStack) {
    super(parent, id);


    new sns.Topic(this, 'BogusTopic');  // Some filler
    new cdk.Output(this, 'IConsumedSomething', { value: providingStack.stackName });
  }
}
github aws / aws-cdk / packages / aws-cdk / integ-tests / app / app.js View on Github external
constructor(parent, id) {
    super(parent, id);

    new sns.Topic(this, 'BogusTopic'); // Some filler
  }
}
github deepalert / deepalert / lib / deepalert-stack.ts View on Github external
? iam.Role.fromRoleArn(this, "SfnRole", props.sfnRoleARN, {
          mutable: false,
        })
      : undefined;

    this.cacheTable = new dynamodb.Table(this, "cacheTable", {
      billingMode: dynamodb.BillingMode.PAY_PER_REQUEST,
      partitionKey: { name: "pk", type: dynamodb.AttributeType.STRING },
      sortKey: { name: "sk", type: dynamodb.AttributeType.STRING },
      timeToLiveAttribute: "expires_at",
    });

    // ----------------------------------------------------------------
    // Messaging Channels
    this.alertTopic = new sns.Topic(this, "alertTopic");
    this.taskTopic = new sns.Topic(this, "taskTopic");
    this.contentTopic = new sns.Topic(this, "contentTopic");
    this.attributeTopic = new sns.Topic(this, "attributeTopic");
    this.reportTopic = new sns.Topic(this, "reportTopic");

    const alertQueueTimeout = cdk.Duration.seconds(30);
    this.alertQueue = new sqs.Queue(this, "alertQueue", {
      visibilityTimeout: alertQueueTimeout,
    });
    this.alertTopic.addSubscription(new SqsSubscription(this.alertQueue));

    const contentQueueTimeout = cdk.Duration.seconds(30);
    this.contentQueue = new sqs.Queue(this, "contentQueue", {
      visibilityTimeout: contentQueueTimeout,
    });

    const attributeQueueTimeout = cdk.Duration.seconds(30);
github deepalert / deepalert / lib / deepalert-stack.ts View on Github external
})
      : undefined;

    this.cacheTable = new dynamodb.Table(this, "cacheTable", {
      billingMode: dynamodb.BillingMode.PAY_PER_REQUEST,
      partitionKey: { name: "pk", type: dynamodb.AttributeType.STRING },
      sortKey: { name: "sk", type: dynamodb.AttributeType.STRING },
      timeToLiveAttribute: "expires_at",
    });

    // ----------------------------------------------------------------
    // Messaging Channels
    this.alertTopic = new sns.Topic(this, "alertTopic");
    this.taskTopic = new sns.Topic(this, "taskTopic");
    this.contentTopic = new sns.Topic(this, "contentTopic");
    this.attributeTopic = new sns.Topic(this, "attributeTopic");
    this.reportTopic = new sns.Topic(this, "reportTopic");

    const alertQueueTimeout = cdk.Duration.seconds(30);
    this.alertQueue = new sqs.Queue(this, "alertQueue", {
      visibilityTimeout: alertQueueTimeout,
    });
    this.alertTopic.addSubscription(new SqsSubscription(this.alertQueue));

    const contentQueueTimeout = cdk.Duration.seconds(30);
    this.contentQueue = new sqs.Queue(this, "contentQueue", {
      visibilityTimeout: contentQueueTimeout,
    });

    const attributeQueueTimeout = cdk.Duration.seconds(30);
    this.attributeQueue = new sqs.Queue(this, "attributeQueue", {
      visibilityTimeout: attributeQueueTimeout,
github deepalert / deepalert / lib / deepalert-stack.ts View on Github external
const sfnRole = props.sfnRoleARN
      ? iam.Role.fromRoleArn(this, "SfnRole", props.sfnRoleARN, {
          mutable: false,
        })
      : undefined;

    this.cacheTable = new dynamodb.Table(this, "cacheTable", {
      billingMode: dynamodb.BillingMode.PAY_PER_REQUEST,
      partitionKey: { name: "pk", type: dynamodb.AttributeType.STRING },
      sortKey: { name: "sk", type: dynamodb.AttributeType.STRING },
      timeToLiveAttribute: "expires_at",
    });

    // ----------------------------------------------------------------
    // Messaging Channels
    this.alertTopic = new sns.Topic(this, "alertTopic");
    this.taskTopic = new sns.Topic(this, "taskTopic");
    this.contentTopic = new sns.Topic(this, "contentTopic");
    this.attributeTopic = new sns.Topic(this, "attributeTopic");
    this.reportTopic = new sns.Topic(this, "reportTopic");

    const alertQueueTimeout = cdk.Duration.seconds(30);
    this.alertQueue = new sqs.Queue(this, "alertQueue", {
      visibilityTimeout: alertQueueTimeout,
    });
    this.alertTopic.addSubscription(new SqsSubscription(this.alertQueue));

    const contentQueueTimeout = cdk.Duration.seconds(30);
    this.contentQueue = new sqs.Queue(this, "contentQueue", {
      visibilityTimeout: contentQueueTimeout,
    });
github aws-samples / aws-cdk-changelogs-demo / changelogs-md.js View on Github external
const apiBucket = new s3.Bucket(this, 'api-bucket', {
      publicReadAccess: true,
      websiteIndexDocument: 'index.json'
    });

    // An S3 bucket which holds the static content
    const staticBucket = new s3.Bucket(this, 'static-bucket', {
      publicReadAccess: true,
      websiteIndexDocument: 'index.html'
    });

    // Create an ECS cluster
    const cluster = new ecs.Cluster(this, 'Cluster', { vpc });

    // An SNS topic to which we can publish to trigger the crawl of a changelog
    const toCrawlTopic = new sns.Topic(this, 'to-crawl', {
      displayName: 'Changelog to crawl'
    });

    const redisCluster = new redis.Cluster(this, 'redis', { vpc });

    this.vpc = vpc;
    this.changelogsTable = changelogsTable;
    this.feedsTable = feedsTable;
    this.searchIndexTable = searchIndexTable;
    this.webBucket = webBucket;
    this.apiBucket = apiBucket;
    this.staticBucket = staticBucket;
    this.toCrawlTopic = toCrawlTopic;
    this.cluster = cluster;
    this.redis = redisCluster;
  }
github aws / aws-cdk / packages / aws-cdk / integ-tests / app / app.js View on Github external
constructor(parent, id) {
    super(parent, id);
    new sns.Topic(this, 'topic1');
    new sns.Topic(this, 'topic2');
  }
}
github aws / aws-cdk / packages / aws-cdk / integ-tests / app / app.js View on Github external
constructor(parent, id) {
    super(parent, id);
    new sns.Topic(this, 'topic');

    new cdk.AvailabilityZoneProvider(this).availabilityZones;
    new cdk.SSMParameterProvider(this, { parameterName: '/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2' }).parameterValue('');
  }
}
github cloudcomponents / cdk-components / packages / cdk-codepipeline-slack / src / slack-approval-action.ts View on Github external
};

        const approvalRequester = new Function(
            scope,
            'SlackApprovalRequesterFunction',
            {
                runtime: Runtime.NODEJS_10_X,
                handler: 'lib/approval-requester.handler',
                code: Code.asset(
                    path.join(__dirname, '..', 'lambda', 'bundle.zip'),
                ),
                environment,
            },
        );

        const topic = new Topic(scope, 'SlackApprovalTopic');
        topic.grantPublish(options.role);
        topic.addSubscription(new LambdaSubscription(approvalRequester));

        const approvalHandler = new Function(
            scope,
            'SlackApprovalHandlerFunction',
            {
                runtime: Runtime.NODEJS_10_X,
                handler: 'lib/approval-handler.handler',
                code: Code.fromAsset(
                    path.join(__dirname, '..', 'lambda', 'bundle.zip'),
                ),
                environment,
            },
        );
github aws / aws-cdk / packages / @aws-cdk / aws-autoscaling-hooktargets / lib / lambda-hook.ts View on Github external
public bind(scope: Construct, lifecycleHook: autoscaling.ILifecycleHook): autoscaling.LifecycleHookTargetConfig {
    const topic = new sns.Topic(scope, 'Topic');
    topic.addSubscription(new subs.LambdaSubscription(this.fn));
    return new TopicHook(topic).bind(scope, lifecycleHook);
  }
}

@aws-cdk/aws-sns

The CDK Construct Library for AWS::SNS

Apache-2.0
Latest version published 1 year ago

Package Health Score

70 / 100
Full package analysis