File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ ARGS=($( jq -r --unbuffered ' .repo_full_name,.tag' ) )
3+ curl -Ls " https://github.com/${ARGS[0]} /releases/download/${ARGS[1]} /lambda.sha256base64" | jq -cR ' {"sha": .}'
Original file line number Diff line number Diff line change @@ -32,11 +32,14 @@ resource "null_resource" "lambda_zip" {
3232 }
3333}
3434
35- data "http" "shasum" {
36- url = " https://github.com/${ local . repo_full_name } /releases/download/${ local . lambda_version_tag } /lambda.sha256base64"
35+ data "external" "sha" {
36+ program = [
37+ " ${ path . module } /getsha.sh"
38+ ]
3739
38- request_headers = {
39- Accept = " text/plain"
40+ query = {
41+ repo_full_name = local.repo_full_name
42+ tag = local.lambda_version_tag
4043 }
4144}
4245
@@ -88,7 +91,6 @@ data "aws_iam_policy_document" "lambda_policy_doc" {
8891 " *"
8992 ]
9093 }
91-
9294}
9395
9496resource "aws_iam_role_policy" "this" {
@@ -111,7 +113,7 @@ resource "aws_lambda_function" "this" {
111113 handler = " rolling-restart.handler"
112114 runtime = " python3.6"
113115 timeout = 600
114- source_code_hash = data. http . shasum . body
116+ source_code_hash = data. external . sha . result . sha
115117 tags = module. tags . tags
116118
117119 environment {
You can’t perform that action at this time.
0 commit comments