Skip to content

This template gives you a GitLab CICD workflow for AWS Lambda packaging, validating, and deploying functions automatically.

Notifications You must be signed in to change notification settings

NashTech-Labs/gitlab_aws_lambda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GitLab + AWS Lambda DevOps Hub

This template demonstrates deploying an AWS Lambda function with Terraform and automating the workflow using GitLab CI/CD.


πŸš€ Features

  • Package Python Lambda with dependencies
  • Deploy Lambda via Terraform
  • GitLab CI/CD pipeline with stages:
    • package β†’ build Lambda zip
    • validate β†’ Terraform syntax check
    • plan β†’ preview changes
    • apply β†’ manual approval for deployment
  • CloudWatch log group created automatically

πŸ” Setup

  1. Create an AWS IAM user with programmatic access.
  2. Store credentials in GitLab CI/CD Variables:
    • AWS_ACCESS_KEY_ID
    • AWS_SECRET_ACCESS_KEY
    • AWS_DEFAULT_REGION
  3. Optional variables:
    • TF_VAR_project_name
    • TF_VAR_env

πŸ§ͺ Usage

Run pipeline

  • Push to GitLab β†’ pipeline packages Lambda and runs Terraform plan.
  • Manual approval needed for apply to deploy Lambda.

Run locally

cd lambda
pip install -r requirements.txt -t .
zip -r ../lambda_package.zip .

cd ../terraform
terraform init
terraform plan
terraform apply

About

This template gives you a GitLab CICD workflow for AWS Lambda packaging, validating, and deploying functions automatically.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published