@@ -3,25 +3,18 @@ name: 'Z-BASE: Cleanup - Lambda@Edge'
33on :
44 workflow_call :
55 inputs :
6- sandbox_workspace :
7- description : ' The sandbox workspace name '
6+ git_ref :
7+ description : ' Branch, tag or SHA '
88 required : true
99 type : string
10- environment :
10+ sandbox_name :
11+ description : ' Sandbox name'
1112 required : true
1213 type : string
13- lambda_function_name :
14- description : ' The sandbox workspace name'
14+ environment :
15+ description : " GitHub Environment name"
1516 required : true
1617 type : string
17- python_version :
18- description : ' Version of Python to run the cleanup script against'
19- required : true
20- type : ' string'
21- build_branch :
22- description : ' Feature branch to push to sandbox.'
23- required : true
24- type : ' string'
2518 secrets :
2619 AWS_ASSUME_ROLE :
2720 required : true
@@ -39,23 +32,21 @@ jobs:
3932 steps :
4033 - name : Display passed variables
4134 run : |
42- echo Python Version : ${{ inputs.python_version }}
43- echo Build Branch : ${{ inputs.build_branch }}
35+ echo Sandbox name : ${{ inputs.sandbox_name }}
36+ echo Git branch/tag/sha : ${{ inputs.git_ref }}
4437 echo Environment: ${{ inputs.environment }}
45- echo Sandbox: ${{ inputs.sandbox_workspace }}
46- echo Lambda Function Name: ${{ inputs.lambda_function_name }}
4738
4839 - name : Checkout
4940 uses : actions/checkout@v5
5041 with :
5142 repository : ' nhsconnect/national-document-repository-infrastructure'
52- ref : ${{ inputs.build_branch }}
43+ ref : ${{ inputs.git_ref }}
5344 fetch-depth : ' 0'
5445
55- - name : Set up Python ${{ inputs.python_version }}
46+ - name : Set up Python 3.11
5647 uses : actions/setup-python@v6
5748 with :
58- python-version : ${{ inputs.python_version }}
49+ python-version : 3.11
5950
6051 - name : Configure AWS Credentials for ${{ vars.AWS_REGION }}
6152 uses : aws-actions/configure-aws-credentials@v5
@@ -69,11 +60,11 @@ jobs:
6960 id : cloudfront
7061 run : |
7162 aws cloudfront list-distributions > distributions.json
72- distribution_id=$(jq -r --arg origin_id "${{ inputs.sandbox_workspace }}-lloyd-george-store" \
63+ distribution_id=$(jq -r --arg origin_id "${{ inputs.sandbox_name }}-lloyd-george-store" \
7364 '.DistributionList.Items[] | select(.Origins.Items[].Id==$origin_id) | .Id' distributions.json | head -n 1)
7465
7566 if [ -z "$distribution_id" ]; then
76- echo "No distribution found for origin ID: ${{ inputs.sandbox_workspace }}-lloyd-george-store"
67+ echo "No distribution found for origin ID: ${{ inputs.sandbox_name }}-lloyd-george-store"
7768 else
7869 echo "Distribution ID found: $distribution_id"
7970 fi
9182 run : ./venv/bin/python3 -u scripts/remove_edge_associations.py
9283 env :
9384 DISTRIBUTION_ID : ${{ env.DISTRIBUTION_ID }}
94- LAMBDA_FUNCTION_NAME : ${{ inputs.lambda_function_name }}
85+ LAMBDA_FUNCTION_NAME : " ${{ inputs.sandbox_name }}_EdgePresignLambda "
0 commit comments