Skip to content

Commit

Permalink
Merge pull request #13 from tetsuya28/fix-terraform-release-download
Browse files Browse the repository at this point in the history
Fix Terraform module, download release
  • Loading branch information
tetsuya28 authored Dec 31, 2023
2 parents a39ec03 + 5df04df commit 75a444a
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions module/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,24 @@ data "github_release" "this" {

resource "null_resource" "this" {
triggers = {
build_version = var.build_version
timestamp = timestamp()
}
provisioner "local-exec" {
command = "wget -O ${local.lambda_zip_file} ${data.github_release.this.assets[2].browser_download_url}"
command = <<EOF
test -e ${local.lambda_zip_file} ||
wget -O ${local.lambda_zip_file} ${data.github_release.this.assets[2].browser_download_url}
EOF
}
}

resource "aws_lambda_function" "this" {
function_name = var.name
runtime = "go1.x"
handler = "aws-cost-report"
filename = local.lambda_zip_file
source_code_hash = fileexists(local.lambda_zip_file) ? filebase64sha256(local.lambda_zip_file) : ""
memory_size = 128
timeout = 10
role = aws_iam_role.this.arn
function_name = var.name
runtime = "go1.x"
handler = "aws-cost-report"
filename = local.lambda_zip_file
memory_size = 128
timeout = 10
role = aws_iam_role.this.arn
environment {
variables = {
"SLACK_TOKEN" = var.slack_token
Expand Down

0 comments on commit 75a444a

Please sign in to comment.