TL;DR
I wrote this article. Minimum configuration sample that automatically releases Lambda by Java with Codepipeline
This is a private memo of the surrounding information of Code Pipeline written in this article.
Get the code for regular monitoring and updates of the github repository.
Build with CodeBuild. The build will be executed as described in buildspec.yml.
gradlew
creates a jar file.S3 :: auto-release-sample
.packaged-minimum-lambda-java-model.yaml
) is generated and placed in the S3 bucket created for Codepipeline.Lambda functions are constructed from template files and jar files.
S3
An S3 bucket is created when you create a CodePipeline. The naming pattern is
codepipeline-<region name>-<random value>
Example: codepipeline-ap-northeast-1- ????????????? /
As for the contents, all the files downloaded from github and the template file generated by the build execution are compressed with zip and saved. A folder is created internally with the I / O artifact name at each step.
cloudformation-lambda-execution-role
The role for CloudFormation to work in the Staging stage. A role prepared by the developer in advance. s3: GetObject`` lambda: * `` cloudformation: CreateChangeSet
etc.
--code-build-<build project name> -service-role
A role that enables CodeBuild to work. You can create s3: PutObject
to S3 :: auto-release-sample
. You can do s3: PutObject`` s3: GetObject
to codepipeline-ap-northeast-1-121111111111 /
.
reference: http://docs.aws.amazon.com/ja_jp/codebuild/latest/userguide/setting-up.html?icmpid=docs_acb_console#setting-up-service-role
AWS-CodePipeline-Service
A role for AWS CodePipeline to work. Looking at the contents of the policy, there are settings other than the processing you want to do this time, such as code commit
, code deploy
ʻelasticbeanstalk, ʻautoscaling
, so it seems that all the typical settings are included.
--<Stack name> -AutoReleasedLambdaRole-<Random value>
The role when Lambda runs. Automatically generated when a Lambda is created in CloudFormation. ʻAutoReleasedLambdaRole is probably a fixed string. The contents are those with ʻAWS LambdaBasicExecutionRole
. (Details unverified)
If you need various role settings to run Lambda, you may need to prepare separately. (Unverified) (Prepare in advance or set in CloudFormation template)
Recommended Posts