Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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({
],
}),
);
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,
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,
},
);