How to use the @aws-cdk/aws-lambda.Runtime.PYTHON_3_7 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-check-parameter-action / src / codepipeline-check-parameter-action.ts View on Github external
protected bound(
        scope: Construct,
        _stage: IStage,
        options: ActionBindOptions,
    ): ActionConfig {
        const { parameterName, regExp, logParameter = false } = this.props;

        const checkParameterFunction = new Function(
            scope,
            'CheckParamterFunction',
            {
                runtime: Runtime.PYTHON_3_7,
                code: Code.fromAsset(`${LAMBDA_PATH}/check-parameter`),
                handler: 'check_parameter.lambda_handler',
            },
        );

        // allow pipeline to list functions
        options.role.addToPolicy(
            new PolicyStatement({
                actions: ['lambda:ListFunctions'],
                resources: ['*'],
            }),
        );

        // allow pipeline to invoke this lambda functionn
        options.role.addToPolicy(
            new PolicyStatement({
github cloudcomponents / cdk-components / packages / cdk-pull-request-check / src / pull_request_check.ts View on Github external
],
            }),
        );

        const pullRequestFunction = new Function(this, 'PullRequestFunction', {
            runtime: Runtime.PYTHON_3_7,
            code: Code.fromAsset(`${lambdaPath}/pull-request`),
            handler: 'pull_request.lambda_handler',
            role: lambdaRole,
        });

        const codeBuildResultFunction = new Function(
            this,
            'CodeBuildResultFunction',
            {
                runtime: Runtime.PYTHON_3_7,
                code: Code.asset(`${lambdaPath}/code-build-result`),
                handler: 'code_build_result.lambda_handler',
                role: lambdaRole,
            },
        );

        const pullRequestProject = new Project(this, 'PullRequestProject', {
            projectName: `${repository.repositoryName}-pull-request`,
            source: Source.codeCommit({
                repository,
            }),
            environment: {
                buildImage,
                computeType,
            },
            buildSpec,
github cloudcomponents / cdk-components / packages / cdk-pull-request-check / src / pull_request_check.ts View on Github external
lambdaRole.addToPolicy(
            new PolicyStatement({
                resources: ['*'],
                actions: [
                    'codebuild:*',
                    'codecommit:*',
                    'logs:CreateLogGroup',
                    'logs:CreateLogStream',
                    'logs:PutLogEvents',
                    'logs:GetLogEvents',
                ],
            }),
        );

        const pullRequestFunction = new Function(this, 'PullRequestFunction', {
            runtime: Runtime.PYTHON_3_7,
            code: Code.fromAsset(`${lambdaPath}/pull-request`),
            handler: 'pull_request.lambda_handler',
            role: lambdaRole,
        });

        const codeBuildResultFunction = new Function(
            this,
            'CodeBuildResultFunction',
            {
                runtime: Runtime.PYTHON_3_7,
                code: Code.asset(`${lambdaPath}/code-build-result`),
                handler: 'code_build_result.lambda_handler',
                role: lambdaRole,
            },
        );