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 @@ -33,11 +33,14 @@ resource "null_resource" "lambda_zip" {
3333 }
3434}
3535
36- data "http" "shasum" {
37- url = " https://github.com/${ local . repo_full_name } /releases/download/${ local . lambda_version_tag } /lambda.sha256base64"
36+ data "external" "sha" {
37+ program = [
38+ " ${ path . module } /getsha.sh"
39+ ]
3840
39- request_headers = {
40- Accept = " text/plain"
41+ query = {
42+ repo_full_name = local.repo_full_name
43+ tag = local.lambda_version_tag
4144 }
4245}
4346
@@ -89,7 +92,6 @@ data "aws_iam_policy_document" "lambda_policy_doc" {
8992 " *"
9093 ]
9194 }
92-
9395}
9496
9597resource "aws_iam_role_policy" "this" {
@@ -112,7 +114,7 @@ resource "aws_lambda_function" "this" {
112114 handler = " rolling-restart.handler"
113115 runtime = " python3.6"
114116 timeout = 600
115- source_code_hash = data. http . shasum . body
117+ source_code_hash = data. external . sha . result . sha
116118 tags = module. tags . tags
117119
118120 environment {
You can’t perform that action at this time.
0 commit comments