How to use the @aws-cdk/aws-lambda.Runtime.NODEJS_10_X function in @aws-cdk/aws-lambda

To help you get started, we’ve selected a few @aws-cdk/aws-lambda 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 cloudcomponents / cdk-components / packages / cdk-codepipeline-slack / src / slack-notifier.ts View on Github external
SLACK_BOT_TOKEN: slackBotToken,
            SLACK_SIGNING_SECRET: slackSigningSecret,
            SLACK_CHANNEL: slackChannel || '',
            SLACK_CHANNEL_ID: slackChannelId || '',
        };

        if (slackBotName) {
            this.environment.SLACK_BOT_NAME = slackBotName;
        }

        if (slackBotIcon) {
            this.environment.SLACK_BOT_ICON = slackBotIcon;
        }

        const notifier = new Function(scope, 'SlackNotifierFunction', {
            runtime: Runtime.NODEJS_10_X,
            handler: 'lib/notifier.handler',
            code: Code.asset(
                path.join(__dirname, '..', 'lambda', 'bundle.zip'),
            ),
            environment: this.environment,
        });
        notifier.addToRolePolicy(
            new PolicyStatement({
                resources: [pipeline.pipelineArn],
                actions: [
                    'codepipeline:GetPipelineState',
                    'codepipeline:GetPipelineExecution',
                ],
            }),
        );
github cloudcomponents / cdk-components / packages / cdk-codepipeline-slack / src / slack-approval-action.ts View on Github external
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({
            defaultIntegration: new LambdaIntegration(approvalHandler),
        });

        approvalHandler.addToRolePolicy(
            new PolicyStatement({
                actions: ['codepipeline:PutApprovalResult'],
github cloudcomponents / cdk-components / packages / cdk-contentful-webhook / src / contentful-webhook.ts View on Github external
public constructor(
        scope: Construct,
        id: string,
        props: ContentfulWebhookProps,
    ) {
        super(scope, id);

        const handler = new SingletonFunction(this, 'CustomResourceHandler', {
            uuid: '91f2075f-b950-4743-a66b-ee0f6febf50d',
            runtime: Runtime.NODEJS_10_X,
            code: Code.fromAsset(
                path.join(__dirname, '..', 'lambda', 'bundle.zip'),
            ),
            handler: 'lib/contentful-webhook.handler',
            lambdaPurpose: 'Custom::ContentfulWebhook',
            timeout: Duration.minutes(15),
        });

        new CustomResource(this, 'CustomResource', {
            provider: CustomResourceProvider.lambda(handler),
            resourceType: 'Custom::ContentfulWebhook',
            properties: {
                ...props,
            },
        });
    }
github cloudcomponents / cdk-components / packages / cdk-github-webhook / src / github-webhook.ts View on Github external
public constructor(
        parent: Construct,
        id: string,
        props: GithubWebhookProps,
    ) {
        super(parent, id);

        const handler = new SingletonFunction(this, 'CustomResourceHandler', {
            uuid: '83CBF3EB-7B62-44F2-8C67-8441E4C1232E',
            runtime: Runtime.NODEJS_10_X,
            code: Code.fromAsset(
                path.join(__dirname, '..', 'lambda', 'bundle.zip'),
            ),
            handler: 'lib/github-webhook.handler',
            lambdaPurpose: 'Custom::GithubWebhook',
            timeout: Duration.minutes(15),
        });

        const {
            githubApiToken,
            githubRepoUrl,
            payloadUrl,
            events,
            logLevel,
        } = props;
github cloudcomponents / cdk-components / packages / cdk-codepipeline-slack / src / slack-approval-action.ts View on Github external
options: ActionBindOptions,
    ): ActionConfig {
        const environment = {
            SLACK_BOT_TOKEN: this.props.slackBotToken,
            SLACK_SIGNING_SECRET: this.props.slackSigningSecret,
            SLACK_CHANNEL: this.props.slackChannel as string,
            SLACK_CHANNEL_ID: this.props.slackChannelId as string,
            SLACK_BOT_NAME: this.props.slackBotName || 'buildbot',
            SLACK_BOT_ICON: this.props.slackBotIcon || ':robot_face:',
        };

        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',
            {
github cloudcomponents / cdk-components / packages / cdk-stripe-webhook / src / stripe-webhook.ts View on Github external
public constructor(
        scope: Construct,
        id: string,
        props: StripeWebhookProps,
    ) {
        super(scope, id);

        const handler = new SingletonFunction(this, 'CustomResourceHandler', {
            uuid: 'e9db3870-d793-4cd2-96a9-efe2e318ebbc',
            runtime: Runtime.NODEJS_10_X,
            code: Code.fromAsset(
                path.join(__dirname, '..', 'lambda', 'bundle.zip'),
            ),
            handler: 'lib/stripe-webhook.handler',
            lambdaPurpose: 'Custom::StripeWebhook',
            timeout: Duration.minutes(15),
        });

        new CustomResource(this, 'CustomResource', {
            provider: CustomResourceProvider.lambda(handler),
            resourceType: 'Custom::StripeWebhook',
            properties: {
                ...props,
            },
        });
    }