Skip to content

Commit 4b61af2

Browse files
author
Scott Miller
committed
fixes
1 parent 8e8fa81 commit 4b61af2

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

.github/workflows/lambda_zip.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ jobs:
2626
if-no-files-found: error
2727

2828
- name: get checksum
29-
run: cat lambda.zip | openssl dgst -binary -sha256 | base64 > lambda.sha256sum.base64
29+
run: cat lambda.zip | openssl dgst -binary -sha256 | base64 > lambda.sha256base64
3030

3131
- name: upload shasum artifact
3232
uses: actions/upload-artifact@v2
3333
with:
34-
name: lambda.sha256sum.base64
34+
name: lambda.sha256base64
3535
path: ${{ github.workspace }}/lambda.zip
3636
if-no-files-found: error
3737

@@ -53,6 +53,6 @@ jobs:
5353
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5454
with:
5555
upload_url: ${{ github.event.release.upload_url }}
56-
asset_path: ./lambda.sha256sum.base64
57-
asset_name: lambda.sha256sum.base64
56+
asset_path: ./lambda.sha256base64
57+
asset_name: lambda.sha256base64
5858
asset_content_type: text/plain

main.tf

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,12 @@ resource "null_resource" "lambda_zip" {
3333
}
3434
}
3535

36-
data "http_http" "shasum" {
37-
url = "https://github.com/${local.repo_full_name}/releases/download/${local.lambda_version_tag}/lambda.sha256sum.base64"
36+
data "http" "shasum" {
37+
url = "https://github.com/${local.repo_full_name}/releases/download/${local.lambda_version_tag}/lambda.sha256base64"
38+
39+
request_headers = {
40+
Accept = "text/plain"
41+
}
3842
}
3943

4044
data "aws_iam_policy_document" "lambda_assume_role_policy" {
@@ -108,7 +112,7 @@ resource "aws_lambda_function" "this" {
108112
handler = "rolling-restart.handler"
109113
runtime = "python3.6"
110114
timeout = 600
111-
source_code_hash = filebase64sha256("lambda-${local.lambda_version}.zip")
115+
source_code_hash = data.http.shasum.body
112116
tags = module.tags.tags
113117

114118
environment {

0 commit comments

Comments
 (0)