Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
319eb82
[PRM-193] - renamed lambda folder to lambdas as lambda is reserved in…
samfallowfield Dec 3, 2025
e52c321
[PRM-193] - further updates from lambdas rename
samfallowfield Dec 3, 2025
929cf35
[PRM-193] - updated makefile commands
samfallowfield Dec 3, 2025
8e77dab
[PRM-193] - changes due to rename of log_alerts_pipeline_error due to…
samfallowfield Dec 3, 2025
bd69f27
[PRM-193] - lambdas change text updated in deploy-stack
samfallowfield Dec 3, 2025
54a1953
[PRM-193] - lambdas change text updated in deploy-stack
samfallowfield Dec 3, 2025
b98b16f
[PRM-193] - progress with updating the sonarqube cloud analysis yml
samfallowfield Dec 3, 2025
ae1c900
[PRM-193] - update to lambdas
samfallowfield Dec 3, 2025
7ecfa4d
Merge branch 'main' into PRM-193
samfallowfield Dec 4, 2025
83b0e6c
[PRM-193] - update lambdas from merge to include readmes
samfallowfield Dec 4, 2025
d9f4fd5
[PRM-193] - test
samfallowfield Dec 16, 2025
7bf229c
Merge remote-tracking branch 'origin/main' into PRM-193
samfallowfield Dec 16, 2025
6205ac8
[PRM-193] - added region for failing test
samfallowfield Dec 16, 2025
aaf5d4f
[PRM-193] - fixed region mock
samfallowfield Dec 16, 2025
9002230
[PRM-193] - fixed region mock default
samfallowfield Dec 16, 2025
562be4f
[PRM-193] - remove blank space
samfallowfield Dec 16, 2025
fffbf78
[PRM-193] - update naming convention
samfallowfield Dec 16, 2025
f828cbb
[PRM-193] - update naming convention
samfallowfield Dec 16, 2025
8e21504
[PRM-193] - lambda to lambdas updates for validate-metrics
samfallowfield Dec 16, 2025
ffb3c69
[PRM-193] - lambda to lambdas updates for email-report
samfallowfield Dec 17, 2025
615066c
[PRM-193] - lambda to lambdas updates for email-report
samfallowfield Dec 17, 2025
36d84e6
[PRM-193] - lambda to lambdas updates for gp2gp dashboard alert
samfallowfield Dec 17, 2025
ca30781
[PRM-193] - lambda to lambdas updates for gp2gp dashboard alert
samfallowfield Dec 17, 2025
9a72e7b
[PRM-193] - lambda to lambdas updates (non aws)
samfallowfield Dec 17, 2025
b8f21a3
[PRM-193] - pipeline error _ instead of -
samfallowfield Dec 17, 2025
ba8db0c
[PRM-193] - sonar-project properties updated
samfallowfield Dec 17, 2025
43a4663
[PRM-193] - update test file name
samfallowfield Dec 17, 2025
2b643b4
[PRM-193] - update validate-metrics to validate_metrics
samfallowfield Dec 17, 2025
ddcabb3
[PRM-193] - added initialisation
samfallowfield Dec 17, 2025
f7bb5a0
[PRM-193] - update
samfallowfield Dec 17, 2025
1ee8a0d
[PRM-193] - stacks folder rename
samfallowfield Dec 17, 2025
76ac7b5
[PRM-193] - undo potentially unnecessary change
samfallowfield Dec 18, 2025
d5f840a
[PRM-193] - store_asid_lookup changes
samfallowfield Dec 18, 2025
cc39ac7
[PRM-193] - store_asid_lookup changes
samfallowfield Dec 18, 2025
76a62f0
[PRM-193] - log_alerts_technical_failures_above_threshold changes
samfallowfield Dec 18, 2025
872006d
[PRM-193] - gp2gp_dashboard_alert updates
samfallowfield Dec 18, 2025
2e7bcf2
[PRM-193] - email-report updates
samfallowfield Dec 18, 2025
a2cdf6e
[PRM-193] - base_networking updates
samfallowfield Dec 18, 2025
af9b4e7
[PRM-193] - base_support updates
samfallowfield Dec 19, 2025
43bcfcc
[PRM-193] - container_repositories updates
samfallowfield Dec 19, 2025
c7a475f
[PRM-193] - ecs_cluster, email_and_alerting, gp2gp_dashboard, metric…
samfallowfield Dec 19, 2025
9be8adb
Revert "[PRM-193] - revert previous commit
samfallowfield Dec 19, 2025
9c07925
Revert "[PRM-193] - ecs_cluster update
samfallowfield Dec 19, 2025
5b1ae73
Revert "[PRM-193] - email and alerting update
samfallowfield Dec 19, 2025
f4c2400
Revert "[PRM-193] - gp2gp dashboard update
samfallowfield Dec 19, 2025
33c7edc
Revert "[PRM-193] - gp2gp dashboard update back
samfallowfield Dec 19, 2025
c3fd947
Revert "[PRM-193] - step_functions update
samfallowfield Dec 19, 2025
329ad94
Revert "[PRM-193] - first alias update
samfallowfield Dec 22, 2025
88eb567
Revert "[PRM-193] - email and alerting alias check update
samfallowfield Dec 22, 2025
c936857
Revert "[PRM-193] - step-function update
samfallowfield Dec 22, 2025
d2983f9
Revert "[PRM-193] - email and alerting image tag, potential
samfallowfield Dec 22, 2025
922b325
Revert "[PRM-193] - email and alerting image tag, potential
samfallowfield Dec 22, 2025
57c00ad
Revert "[PRM-193] - gp2gp fix
samfallowfield Dec 22, 2025
9b36137
[PRM-193] - email and reporting fix
samfallowfield Dec 22, 2025
24e1b46
[PRM-193] - revert deploy stack changes
samfallowfield Dec 22, 2025
cd8b340
[PRM-193] - gp2gp dashboard image tag added
samfallowfield Dec 22, 2025
a54a35e
[PRM-193] - gp2gp dashboard image tag added to var and build lambda
samfallowfield Dec 22, 2025
802e1d9
[PRM-193] - gp2gp dashboard image tag added to var and build lambda
samfallowfield Dec 22, 2025
05f2836
Merge remote-tracking branch 'origin/PRM-193' into PRM-193
samfallowfield Dec 22, 2025
f92fd39
[PRM-193] - gp2gp dashboard image tag added to var and build lambda
samfallowfield Dec 22, 2025
cf95363
[PRM-193] - change to log out failure reason
samfallowfield Dec 23, 2025
cf279c7
[PRM-193] - remove log
samfallowfield Dec 23, 2025
14e4d40
[PRM-193] - attempt alias instead of image_tag
samfallowfield Dec 23, 2025
b677475
[PRM-193] - attempt alias instead of image_tag
samfallowfield Dec 23, 2025
f7cc60b
[PRM-193] - attempt fix on alias
samfallowfield Dec 23, 2025
e0c30dd
[PRM-193] - attempt fix on alias
samfallowfield Dec 23, 2025
483ac11
[PRM-193] - attempt fix on alias
samfallowfield Dec 23, 2025
ee1ca0c
[PRM-193] - added space to query
samfallowfield Dec 23, 2025
23572b9
[PRM-193] - transfer classifier - _ switch and alias added
samfallowfield Dec 23, 2025
5f28052
[PRM-193] - email and alerting init fix poten - _ switch and alias added
samfallowfield Dec 23, 2025
5915983
[PRM-193] - email and alerting init fix poten - _ switch and alias added
samfallowfield Dec 23, 2025
a922fc2
[PRM-193] - revert 'terraform-state' input temp
samfallowfield Jan 5, 2026
e1cdefa
[PRM-193] - return to using terraform_stack when finding the terrafor…
samfallowfield Jan 5, 2026
aca9711
[PRM-193] - image_tag update
samfallowfield Jan 5, 2026
923a6e1
[PRM-193] - terraform stack update
samfallowfield Jan 5, 2026
4f3c04c
[PRM-193] - terraform stack update
samfallowfield Jan 5, 2026
feac100
[PRM-193] - terraform stack update
samfallowfield Jan 5, 2026
507687e
[PRM-193] - terraform stack update
samfallowfield Jan 5, 2026
093ea9e
[PRM-193] - terraform stack update
samfallowfield Jan 5, 2026
89c49ec
[PRM-193] - remove unused input
samfallowfield Jan 5, 2026
bb2c772
[PRM-193] - terraform stack add over image tag
samfallowfield Jan 5, 2026
17f38bc
[PRM-193] - ods-downloader update
samfallowfield Jan 5, 2026
bc46d87
[PRM-193] - ods-downloader update
samfallowfield Jan 5, 2026
d3b9c0a
[PRM-193] - reports-generator update
samfallowfield Jan 6, 2026
29997d9
[PRM-193] - reports-generator stack update
samfallowfield Jan 6, 2026
fb034b0
[PRM-193] - reports-generator stack update
samfallowfield Jan 6, 2026
980a038
[PRM-193] - spine exporter update
samfallowfield Jan 6, 2026
5bfad01
[PRM-193] - metrics_calculator update
samfallowfield Jan 6, 2026
a5fdf3b
[PRM-193] - step-functions update
samfallowfield Jan 6, 2026
b761eb5
[PRM-193] - updated ecr_alias to hyphenated_alias for clarity
samfallowfield Jan 6, 2026
62f5236
[PRM-193] - terraform matrix fix
samfallowfield Jan 6, 2026
9a9b97e
[PRM-193] - production deployment updates
samfallowfield Jan 6, 2026
24659db
[PRM-193] - update sonar exclusions to ignore all for the duration of…
samfallowfield Jan 7, 2026
1f63874
[PRM-193] - PR notes updates
samfallowfield Jan 8, 2026
203f97b
[PRM-193] - small refactor of the make env command
samfallowfield Jan 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ updates:
open-pull-requests-limit: 100

- package-ecosystem: "pip"
directory: "/lambda"
directory: "/lambdas"
schedule:
interval: "weekly"
timezone: "Europe/London"
Expand Down
28 changes: 18 additions & 10 deletions .github/workflows/automated-base-infrastructure-terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ on:
push:
branches: [main]
paths:
- "stacks/container-repositories/**"
- "stacks/base-support/**"
- "stacks/base-networking/**"
- "stacks/ecs-cluster/**"
- "../../stacks/container_repositories/**"
- "../../stacks/base_support/**"
- "../../stacks/base_networking/**"
- "../../stacks/ecs_cluster/**"
- ".github/workflows/automated-base-infrastructure-terraform.yml"
- ".github/workflows/deploy-stack.yml"

pull_request:
branches: [main]
paths:
- "stacks/container-repositories/**"
- "stacks/base-support/**"
- "stacks/base-networking/**"
- "stacks/ecs-cluster/**"
- "../../stacks/container_repositories/**"
- "../../stacks/base_support/**"
- "../../stacks/base_networking/**"
- "../../stacks/ecs_cluster/**"
- ".github/workflows/automated-base-infrastructure-terraform.yml"
- ".github/workflows/deploy-stack.yml"

Expand All @@ -34,11 +34,19 @@ jobs:
matrix:
environment: [dev]
terraform_stack:
[container-repositories, base-support, base-networking, ecs-cluster]
- name: "container_repositories"
hyphenated_alias: "container-repositories"
- name: "base_support"
hyphenated_alias: "base-support"
- name: "base_networking"
hyphenated_alias: "base-networking"
- name: "ecs_cluster"
hyphenated_alias: "ecs-cluster"
uses: ./.github/workflows/deploy-stack.yml
with:
environment: ${{ matrix.environment }}
terraform_stack: ${{ matrix.terraform_stack }}
terraform_stack: ${{ matrix.terraform_stack.name }}
is_deployment: ${{ github.ref == 'refs/heads/main' }}
git_ref: ${{ github.ref }}
hyphenated_alias: ${{ matrix.terraform_stack.hyphenated_alias }}
secrets: inherit
61 changes: 34 additions & 27 deletions .github/workflows/automated-data-pipeline-terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@ on:
push:
branches: [main]
paths:
- "stacks/step-function/**"
- "stacks/transfer-classifier/**"
- "stacks/validate-metrics/**"
- "stacks/ods-downloader/**"
- "stacks/reports-generator/**"
- "stacks/spine-exporter/**"
- "stacks/metrics-calculator/**"
- "../../stacks/step_function/**"
- "../../stacks/transfer_classifier/**"
- "../../stacks/validate_metrics/**"
- "../../stacks/ods_downloader/**"
- "../../stacks/reports_generator/**"
- "../../stacks/spine_exporter/**"
- "../../stacks/metrics_calculator/**"
- ".github/workflows/automated-data-pipeline-terraform.yml"
- ".github/workflows/deploy-stack.yml"
- "lambda/validate-metrics"
- "../../lambdas/validate_metrics"

pull_request:
branches: [main]
paths:
- "stacks/step-function/**"
- "stacks/transfer-classifier/**"
- "stacks/validate-metrics/**"
- "stacks/ods-downloader/**"
- "stacks/reports-generator/**"
- "stacks/spine-exporter/**"
- "stacks/metrics-calculator/**"
- "../../stacks/step_function/**"
- "../../stacks/transfer_classifier/**"
- "../../stacks/validate_metrics/**"
- "../../stacks/ods_downloader/**"
- "../../stacks/reports_generator/**"
- "../../stacks/spine_exporter/**"
- "../../stacks/metrics_calculator/**"
- ".github/workflows/automated-data-pipeline-terraform.yml"
- ".github/workflows/deploy-stack.yml"

Expand All @@ -39,8 +39,9 @@ jobs:
with:
environment: dev
is_deployment: ${{ github.ref == 'refs/heads/main' }}
terraform_stack: step-function
terraform_stack: step_function
git_ref: ${{ github.ref }}
hyphenated_alias: "step-function"
secrets: inherit

transfer-classifier:
Expand All @@ -49,9 +50,10 @@ jobs:
with:
environment: dev
is_deployment: ${{ github.ref == 'refs/heads/main' }}
terraform_stack: transfer-classifier
image_tag: transfer_classifier
terraform_stack: transfer_classifier
image_tag: transfer-classifier
git_ref: ${{ github.ref }}
hyphenated_alias: "transfer-classifier"
secrets: inherit

validate-metrics:
Expand All @@ -60,9 +62,10 @@ jobs:
with:
environment: dev
is_deployment: ${{ github.ref == 'refs/heads/main' }}
terraform_stack: validate-metrics
terraform_stack: validate_metrics
build_lambda: true
git_ref: ${{ github.ref }}
hyphenated_alias: "validate-metrics"
secrets: inherit

ods-downloader:
Expand All @@ -71,9 +74,10 @@ jobs:
with:
environment: dev
is_deployment: ${{ github.ref == 'refs/heads/main' }}
terraform_stack: ods-downloader
image_tag: ods_downloader
terraform_stack: ods_downloader
image_tag: ods-downloader
git_ref: ${{ github.ref }}
hyphenated_alias: "ods-downloader"
secrets: inherit

reports-generator:
Expand All @@ -82,9 +86,10 @@ jobs:
with:
environment: dev
is_deployment: ${{ github.ref == 'refs/heads/main' }}
terraform_stack: reports-generator
image_tag: reports_generator
terraform_stack: reports_generator
image_tag: reports-generator
git_ref: ${{ github.ref }}
hyphenated_alias: "reports_generator"
secrets: inherit

spine-exporter:
Expand All @@ -93,9 +98,10 @@ jobs:
with:
environment: dev
is_deployment: ${{ github.ref == 'refs/heads/main' }}
terraform_stack: spine-exporter
image_tag: spine_exporter
terraform_stack: spine_exporter
image_tag: spine-exporter
git_ref: ${{ github.ref }}
hyphenated_alias: "spine-exporter"
secrets: inherit

metrics-calculator:
Expand All @@ -104,7 +110,8 @@ jobs:
with:
environment: dev
is_deployment: ${{ github.ref == 'refs/heads/main' }}
terraform_stack: metrics-calculator
image_tag: metrics_calculator
terraform_stack: metrics_calculator
image_tag: metrics-calculator
git_ref: ${{ github.ref }}
hyphenated_alias: "metrics_calculator"
secrets: inherit
26 changes: 14 additions & 12 deletions .github/workflows/automated-email-and-alerting-terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ on:
push:
branches: [main]
paths:
- "stacks/email-and-alerting/**"
- "stacks/gp2gp-dashboard/**"
- "../../stacks/email_and_alerting/**"
- "../../stacks/gp2gp_dashboard/**"
- ".github/workflows/automated-email-and-alerting-terraform.yml"
- ".github/workflows/deploy-stack.yml"
- "lambda/email-report/**"
- "lambda/gp2gp-dashboard-alert/**"
- "lambda/log-alerts-pipeline-error/**"
- "lambda/log-alerts-technical-failures-above-threshold/**"
- "lambda/store-asid-lookup/**"
- "../../lambdas/email_report/**"
- "../../lambdas/gp2gp_dashboard_alert/**"
- "../../lambdas/log_alerts_pipeline_error/**"
- "../../lambdas/log_alerts_technical_failures_above_threshold/**"
- "../../lambdas/store_asid_lookup/**"

pull_request:
branches: [main]
paths:
- "stacks/email-and-alerting/**"
- "stacks/gp2gp-dashboard/**"
- "../../stacks/email_and_alerting/**"
- "../../stacks/gp2gp_dashboard/**"
- ".github/workflows/automated-email-and-alerting-terraform.yml"
- ".github/workflows/deploy-stack.yml"

Expand All @@ -33,9 +33,10 @@ jobs:
with:
environment: dev
is_deployment: ${{ github.ref == 'refs/heads/main' }}
terraform_stack: email-and-alerting
terraform_stack: email_and_alerting
build_lambda: true
git_ref: ${{ github.ref }}
hyphenated_alias: "email-and-alerting"
secrets: inherit

gp2gp-dashboard:
Expand All @@ -44,8 +45,9 @@ jobs:
with:
environment: dev
is_deployment: ${{ github.ref == 'refs/heads/main' }}
terraform_stack: gp2gp-dashboard
image_tag: gp2gp_dashboard
terraform_stack: gp2gp_dashboard
image_tag: gp2gp-dashboard
build_lambda: true
git_ref: ${{ github.ref }}
hyphenated_alias: "gp2gp-dashboard"
secrets: inherit
18 changes: 18 additions & 0 deletions .github/workflows/automated-sonarqube-cloud-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,26 @@ jobs:
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Set up Python 3.14
uses: actions/setup-python@v6
with:
python-version: 3.14

- name: Make virtual environment
run: |
make env

- name: Test with pytest
run: |
make test-coverage
cd ./lambdas
sed -i "s@filename=\"@filename=\"lambdas/@" coverage.xml
cd ..

- name: SonarQube Cloud Scan
uses: SonarSource/sonarqube-scan-action@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

#
53 changes: 29 additions & 24 deletions .github/workflows/base-deploy-to-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
type: string
required: true
build_lambda:
description: "Does the workflow need a lambda build"
description: "Does the workflow need a lambdas build"
type: boolean
default: false
image_tag:
Expand All @@ -23,6 +23,10 @@ on:
description: "The git_ref to deploy"
type: string
default: main
hyphenated_alias:
description: "Hyphenated stack Alias"
type: string
default: ""

permissions:
pull-requests: write
Expand Down Expand Up @@ -61,8 +65,8 @@ jobs:
- name: ECR Copy
id: ecr-copy
run: |
source_repo=${{ secrets.AWS_DEV_ACCOUNT_ID }}.dkr.ecr.eu-west-2.amazonaws.com/${{ secrets.AWS_ECR_DEV_REPOSITORY }}${{ inputs.terraform_stack }}
destination_repo=${{ steps.creds.outputs.aws-account-id }}.dkr.ecr.eu-west-2.amazonaws.com/${{ secrets.AWS_ECR_REPOSITORY }}${{ inputs.terraform_stack }}
source_repo=${{ secrets.AWS_DEV_ACCOUNT_ID }}.dkr.ecr.eu-west-2.amazonaws.com/${{ secrets.AWS_ECR_DEV_REPOSITORY }}${{ inputs.hyphenated_alias }}
destination_repo=${{ steps.creds.outputs.aws-account-id }}.dkr.ecr.eu-west-2.amazonaws.com/${{ secrets.AWS_ECR_REPOSITORY }}${{ inputs.hyphenated_alias }}
docker pull $source_repo:latest
docker tag $source_repo:latest $destination_repo:latest
docker tag $source_repo:latest $destination_repo:${{ steps.checkout.outputs.commit }}
Expand All @@ -83,6 +87,7 @@ jobs:
image_tag: ${{ inputs.image_tag }}
build_lambda: ${{ inputs.build_lambda }}
git_ref: ${{ inputs.git_ref }}
hyphenated_alias: ${{ inputs.hyphenated_alias }}
secrets: inherit

deploy-infra-no-images:
Expand Down Expand Up @@ -128,7 +133,7 @@ jobs:
- name: Terraform Init
id: init
run: |
terraform init -no-color -backend-config="key=data-pipeline/${{ inputs.terraform_stack }}/terraform.tfstate" \
terraform init -no-color -backend-config="key=data-pipeline/${{ inputs.hyphenated_alias }}/terraform.tfstate" \
-backend-config="bucket=${{ secrets.AWS_STATE_BUCKET }}" \
-backend-config="dynamodb_table=${{ secrets.AWS_STATE_LOCK_TABLE }}"
shell: bash
Expand All @@ -145,19 +150,19 @@ jobs:
EOF

- name: Setup Terraform variables for Build Lambda
id: update-lambda-build-references
id: update-lambdas-build-references
if: inputs.build_lambda
run: |-
aws_env="${{ vars.AWS_ENVIRONMENT }}"
cat > pipeline.auto.tfvars <<EOF
environment = "$aws_env"
log_alerts_pipeline_error_lambda_zip = "$GITHUB_WORKSPACE/lambda/build/log-alerts-pipeline-error.zip"
log_alerts_technical_failures_above_threshold_lambda_zip = "$GITHUB_WORKSPACE/lambda/build/log-alerts-technical-failures-above-threshold.zip"
gp2gp_dashboard_alert_lambda_zip = "$GITHUB_WORKSPACE/lambda/build/gp2gp-dashboard-alert.zip"
email_report_lambda_zip = "$GITHUB_WORKSPACE/lambda/build/email-report.zip"
validate_metrics_lambda_zip = "$GITHUB_WORKSPACE/lambda/build/validate-metrics.zip"
degrades_dashboards_lambda_zip = "$GITHUB_WORKSPACE/lambda/build/degrades-dashboards.zip"
store_asid_lookup_lambda_zip = "$GITHUB_WORKSPACE/lambda/build/store-asid-lookup.zip"
log_alerts_pipeline_error_lambda_zip = "$GITHUB_WORKSPACE/lambdas/build/log_alerts_pipeline_error.zip"
log_alerts_technical_failures_above_threshold_lambda_zip = "$GITHUB_WORKSPACE/lambdas/build/log_alerts_technical_failures_above_threshold.zip"
gp2gp_dashboard_alert_lambda_zip = "$GITHUB_WORKSPACE/lambdas/build/gp2gp_dashboard_alert.zip"
email_report_lambda_zip = "$GITHUB_WORKSPACE/lambdas/build/email_report.zip"
validate_metrics_lambda_zip = "$GITHUB_WORKSPACE/lambdas/build/validate_metrics.zip"
degrades_dashboards_lambda_zip = "$GITHUB_WORKSPACE/lambdas/build/degrades-dashboards.zip"
store_asid_lookup_lambda_zip = "$GITHUB_WORKSPACE/lambdas/build/store_asid_lookup.zip"
EOF

- name: Terraform Plan
Expand Down Expand Up @@ -214,7 +219,7 @@ jobs:
- name: Terraform Init
id: init
run: |
terraform init -no-color -backend-config="key=data-pipeline/${{ inputs.terraform_stack }}/terraform.tfstate" \
terraform init -no-color -backend-config="key=data-pipeline/${{ inputs.hyphenated_alias }}/terraform.tfstate" \
-backend-config="bucket=${{ secrets.AWS_STATE_BUCKET }}" \
-backend-config="dynamodb_table=${{ secrets.AWS_STATE_LOCK_TABLE }}"
shell: bash
Expand All @@ -234,30 +239,30 @@ jobs:
id: vars-image-tag
if: inputs.image_tag
run: |-
IMAGE_TAG=$(aws ecr describe-images --repository-name ${{ secrets.AWS_ECR_REPOSITORY }}${{ inputs.terraform_stack }} --query 'sort_by(imageDetails,& imagePushedAt)[-1].imageTags[0]')
IMAGE_TAG=$(aws ecr describe-images --repository-name ${{ secrets.AWS_ECR_REPOSITORY }}${{ inputs.image_tag }} --query 'sort_by(imageDetails,& imagePushedAt)[-1].imageTags[0]')
cat > pipeline.auto.tfvars <<EOF
${{ inputs.image_tag }}_image_tag = $IMAGE_TAG
${{ inputs.terraform_stack }}_image_tag = $IMAGE_TAG
environment = "${{ vars.AWS_ENVIRONMENT }}"
EOF

- name: Setup Terraform variables for Build Lambda
id: update-lambda-build-references
id: update-lambdas-build-references
if: inputs.build_lambda
run: |-
image_key="${{ inputs.image_tag }}"
aws_env="${{ vars.AWS_ENVIRONMENT }}"
cat > pipeline.auto.tfvars <<EOF
environment = "$aws_env"
log_alerts_pipeline_error_lambda_zip = "$GITHUB_WORKSPACE/lambda/build/log-alerts-pipeline-error.zip"
log_alerts_technical_failures_above_threshold_lambda_zip = "$GITHUB_WORKSPACE/lambda/build/log-alerts-technical-failures-above-threshold.zip"
gp2gp_dashboard_alert_lambda_zip = "$GITHUB_WORKSPACE/lambda/build/gp2gp-dashboard-alert.zip"
email_report_lambda_zip = "$GITHUB_WORKSPACE/lambda/build/email-report.zip"
validate_metrics_lambda_zip = "$GITHUB_WORKSPACE/lambda/build/validate-metrics.zip"
degrades_dashboards_lambda_zip = "$GITHUB_WORKSPACE/lambda/build/degrades-dashboards.zip"
store_asid_lookup_lambda_zip = "$GITHUB_WORKSPACE/lambda/build/store-asid-lookup.zip"
log_alerts_pipeline_error_lambda_zip = "$GITHUB_WORKSPACE/lambdas/build/log_alerts_pipeline_error.zip"
log_alerts_technical_failures_above_threshold_lambda_zip = "$GITHUB_WORKSPACE/lambdas/build/log_alerts_technical_failures_above_threshold.zip"
gp2gp_dashboard_alert_lambda_zip = "$GITHUB_WORKSPACE/lambdas/build/gp2gp_dashboard_alert.zip"
email_report_lambda_zip = "$GITHUB_WORKSPACE/lambdas/build/email_report.zip"
validate_metrics_lambda_zip = "$GITHUB_WORKSPACE/lambdas/build/validate_metrics.zip"
degrades_dashboards_lambda_zip = "$GITHUB_WORKSPACE/lambdas/build/degrades-dashboards.zip"
store_asid_lookup_lambda_zip = "$GITHUB_WORKSPACE/lambdas/build/store_asid_lookup.zip"
EOF
if [[ -n "$image_key" ]]; then
IMAGE_TAG=$(aws ecr describe-images --repository-name ${{ secrets.AWS_ECR_REPOSITORY }}${{ inputs.terraform_stack }} --query 'sort_by(imageDetails,& imagePushedAt)[-1].imageTags[0]')
IMAGE_TAG=$(aws ecr describe-images --repository-name ${{ secrets.AWS_ECR_REPOSITORY }}${{ inputs.hyphenated_alias }} --query 'sort_by(imageDetails,& imagePushedAt)[-1].imageTags[0]')
image_tag=$IMAGE_TAG
echo "${image_key}_image_tag = $image_tag" >> pipeline.auto.tfvars
cat pipeline.auto.tfvars
Expand Down
Loading
Loading