From ff1b8ed12150bc8b840c93755fc5a1d4777ccf5e Mon Sep 17 00:00:00 2001 From: David Arnold <10138997+djaboxx@users.noreply.github.com> Date: Thu, 17 Apr 2025 02:20:13 -0700 Subject: [PATCH] Image build (#3) * Remove obsolete Lambda packaging script and related configuration files - Deleted `package_lambda.py` script responsible for packaging AWS Lambda functions and layers. - Removed `pip.conf` configuration file for pip settings. - Eliminated `requirements.txt` file that specified Python dependencies. - Deleted `test_payload.json` used for testing Lambda functions. - Removed empty JSON and TFVAR files in `varfiles` directory. - Deleted `variables.tf` file containing Terraform variable definitions. - Removed `versions.tf` file specifying Terraform version requirements. - Added new GitHub Actions workflow for building and pushing Lambda container images using Packer. - Introduced `packer.pkr.hcl` file for Packer configuration to build Docker images for Lambda. * Refactor GitHub API integration to remove Census-specific references and improve configuration handling * Update Python setup in build workflow to use actions/setup-python@v4 and improve dependency installation * Add Terraform backend configuration for GCS storage --------- Co-authored-by: Dave Arnold --- .github/workflows/build.yml | 14 ++++++++++---- backend.tf | 7 +++++++ 2 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 backend.tf diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 94f52fc..8c23787 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: push: branches: [ "main" ] - + permissions: contents: write id-token: write @@ -33,11 +33,16 @@ jobs: curl -sSL https://raw.githubusercontent.com/HappyPathway/centralized-actions/main/gtag.py -o gtag.py curl -sSL https://raw.githubusercontent.com/HappyPathway/centralized-actions/main/gtag_requirements.txt -o requirements.txt - - name: Setup Python - uses: actions/setup-python@v2 + - name: Setup minimal Python for gtag + uses: actions/setup-python@v4 with: python-version: '3.11' - cache: pip + cache: 'pip' + cache-dependency-path: requirements.txt + + - name: Install gtag dependencies + run: | + python -m pip install -r requirements.txt - name: Setup Terraform uses: hashicorp/setup-terraform@v3.1.2 @@ -95,3 +100,4 @@ jobs: -var "repository_uri=${{ env.repository_uri }}" \ -var "tag=${{ env.next_tag }}" \ packer.pkr.hcl + diff --git a/backend.tf b/backend.tf new file mode 100644 index 0000000..e059210 --- /dev/null +++ b/backend.tf @@ -0,0 +1,7 @@ +terraform { + backend "gcs" { + bucket = "hpwe-terraform-state" + prefix = "eks-automation-lambda" + } +} +