Skip to content

Latest commit

 

History

History

step_two

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Java AWS Serverless - Step Two

  • Step One: Basic lambdas and getting them deployed
  • Step Two: Adding CodePipeline to avoid manual deployments
  • Step Three: Tips & Tricks

Step Two

Structure

  • infra - Deploys lambda with CDK
  • lambdas - Contains Java lambda functions
  • layer - Creates layer for use by the lambdas

CICD with CodePipeline

How to create a Code Pipeline for builds, triggered from Github

  • Grant access to Github repo
  • Setup token in AWS Secrets Manager: aws secretsmanager create-secret --name GITHUB_TOKEN --secret-string <YOUR_GITHUB_PERSONAL_ACCESS_TOKEN> --profile <YOUR_PROFILE>
  • Set github values in infra/cdk.json
  • Define a CodePipeline linked to github (see CodeServicesCICDStack)
  • Temporarily change CoreServicesCdkApp to setup code pipeline.

Build & Deploy Stack changes

Note: AWS CDK CLI & Docker is required on your machine to deploy the solution

  • mvn clean package - build the solution
  • cd infra
  • cdk synth --profile <your profile> - synth the solution
  • cdk deploy --profile <your profile> - deploy the solution

Useful resources: