Package: aws-ci-cd-lambda
AWS Lambda PipelineA library that creates a full out-of-the-box solution for AWS Lambda with CI/CD pipeline.RemarksThe project is written byDeividas Tamkus, supervised byLaimonas Sutkusand is owned byiDenfy. This is an open source
library intended to be used by anyone.iDenfyaims
to share its knowledge and educate market for better and more secure IT infrastructure.Related technologyThis project utilizes the following technology:AWS(Amazon Web Services).AWS CDK(Amazon Web Services Cloud Development Kit).AWS CloudFormation.AWS Lambda.AWS CodePipeline.AssumptionsThis library project assumes the following:You have knowledge in AWS (Amazon Web Services).You have knowledge in AWS CloudFormation.You are managing your infrastructure with AWS CDK.You are writing AWS CDK templates with a python language.InstallThe project is built and uploaded to PyPi. Install it by using pip.pipinstallaws-lambda-pipelineOr directly install it through source../build.sh-icDescriptionThis package creates a Lambda function and a pipeline
for a complete out-of-the-box hosting infrastructure.The pipeline takes your source code from CodeCommit and deploys it to Lambda.TutorialCreate a full infrastructure around AWS Lambda by using the following code below in your stack.fromaws_ci_cd_lambda.parameters.pipeline_parametersimportPipelineParametersfromaws_ci_cd_lambda.parameters.ssh_parametersimportSshParametersfromaws_ci_cd_lambda.parameters.lambda_parametersimportLambdaParametersfromaws_ci_cd_lambda.parameters.vpc_parametersimportVpcParametersfromaws_ci_cd_lambda.ci_cd_lambdaimportCiCdLambdafromaws_cdkimportcore,aws_ec2,aws_iamfromaws_cdk.aws_lambdaimportRuntimeclassMainStack(core.Stack):def__init__(self,scope:core.App)->None:super().__init__(scope=scope,id='MyCoolStack')# Create your own vpc or use an existing one.vpc=aws_ec2.Vpc(...)# Create an execution role for your function.role=aws_iam.Role(...)# Create a security group for your function.sg=aws_ec2.SecurityGroup(...)vpc_params=VpcParameters(vpc=vpc,subnets=vpc.isolated_subnets,security_groups=[sg],)lambda_params=LambdaParameters(execution_role=role,lambda_memory=1024,lambda_timeout=60,lambda_runtime=Runtime.PYTHON_3_6,lambda_handler='manage.runner',)pipeline_params=PipelineParameters(ssh_params=SshParameters(aws_secret=('MyCoolSecret','arn:aws:secretsmanager:region:account_id:secret:MyCoolSecret-rAnDomStrinG',None)))self.ci_cd_lambda=CiCdLambda(scope=self,prefix='MyCool',vpc_params=vpc_params,lambda_params=lambda_params,pipeline_params=pipeline_params)Provision you infrastructure withCloudFormationby callingcdk deploy.After you provision your infrastructure, go toAWS CodeCommitin your AWS Console.Find a newly created git repository.Commit any code you want to the newly created repository to trigger a pipeline.(A tutorial on pushing code to remote repositories:AWS Tutorial).(A tutorial on setting up git ssh with aws git repositories:AWS Tutorial)Release history3.4.0Add md files.3.3.0Dependency update 1.60.0 - 2.0.0.3.2.0Force update AWS CDK dependency version to 1.44.0.3.1.0Added the ability to add custom commands to buildspec.3.0.1Bug fix.3.0.0Moved SSH parameters to a separate class.2.3.0Add ability to specify KMS key for secret decryption.2.2.0Add ability to specify arguments for install and test scripts.2.1.0Add error and throttles alarms. Add ability to specify lambda environment.
Add reserved concurrent executions.2.0.1Bug fix.2.0.0Refactor. Increase clarity.1.1.0Major refactoring and minor updates and fixes.1.0.1Made use CDK version 1.27.01.0.0Initial commit.