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

To help you get started, we’ve selected a few @aws-cdk/aws-sns-subscriptions 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 duo-labs / cloudtrail-partitioner / lib / cloudtrail_partitioner-stack.js View on Github external
logRetention: logs.RetentionDays.TWO_WEEKS,
      timeout: cdk.Duration.seconds(30),
      memorySize: 128,
      environment: {
        "ALARM_SNS": config['alarm_sns_arn']
      },
    });

    // Add priv to publish the events so the alarms can be forwarded
    alarm_forwarder.addToRolePolicy(new iam.PolicyStatement({
      resources: [config['alarm_sns_arn']],
      actions: ['sns:Publish']
    }));

    // Connect the SNS to the Lambda
    sns_topic.addSubscription(new sns_subscription.LambdaSubscription(alarm_forwarder));
  }
}
github duo-labs / cloudmapper / auditor / lib / cloudmapperauditor-stack.js View on Github external
logRetention: logs.RetentionDays.TWO_WEEKS,
      timeout: cdk.Duration.seconds(30),
      memorySize: 128,
      environment: {
        "ALARM_SNS": config['alarm_sns_arn']
      },
    });

    // Add priv to publish the events so the alarms can be forwarded
    alarm_forwarder.addToRolePolicy(new iam.PolicyStatement({
      resources: [config['alarm_sns_arn']],
      actions: ['sns:Publish']
    }));

    // Connect the SNS to the Lambda
    sns_topic.addSubscription(new sns_subscription.LambdaSubscription(alarm_forwarder));
  }
}
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,
            },
        );

        const api = new RestApi(scope, 'SlackApprovalApi');
        api.root.addProxy({
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);
  }
}
github aws / aws-cdk / packages / @aws-cdk / aws-lambda-event-sources / lib / sns.ts View on Github external
public bind(target: lambda.IFunction) {
    this.topic.addSubscription(new subs.LambdaSubscription(target));
  }
}

@aws-cdk/aws-sns-subscriptions

CDK Subscription Constructs for AWS SNS

Apache-2.0
Latest version published 1 year ago

Package Health Score

67 / 100
Full package analysis