Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

Commit

Permalink
added source_code_hash to examples
Browse files Browse the repository at this point in the history
  • Loading branch information
moritzzimmer committed Mar 6, 2020
1 parent 36c9cf2 commit 8e3d145
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 51 deletions.
26 changes: 14 additions & 12 deletions examples/example-with-cloudwatch-event/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ provider "aws" {
}

module "lambda-scheduled" {
source = "../../"
description = "Example AWS Lambda using go with cloudwatch scheduled event trigger"
filename = "${path.module}/test_function.zip"
function_name = "tf-example-go-basic"
handler = "example-lambda-func"
runtime = "go1.x"
source = "../../"
description = "Example AWS Lambda using go with cloudwatch scheduled event trigger"
filename = "${path.module}/test_function.zip"
function_name = "tf-example-go-basic"
handler = "example-lambda-func"
runtime = "go1.x"
source_code_hash = filebase64sha256("${path.module}/test_function.zip")

event = {
type = "cloudwatch-event"
Expand All @@ -17,12 +18,13 @@ module "lambda-scheduled" {
}

module "lambda-pattern" {
source = "../../"
description = "Example AWS Lambda using go with cloudwatch event pattern trigger"
filename = "${path.module}/test_function.zip"
function_name = "tf-example-go-basic"
handler = "example-lambda-func"
runtime = "go1.x"
source = "../../"
description = "Example AWS Lambda using go with cloudwatch event pattern trigger"
filename = "${path.module}/test_function.zip"
function_name = "tf-example-go-basic"
handler = "example-lambda-func"
runtime = "go1.x"
source_code_hash = filebase64sha256("${path.module}/test_function.zip")

event = {
type = "cloudwatch-event"
Expand Down
11 changes: 6 additions & 5 deletions examples/example-with-dynamodb-event/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ provider "aws" {
}

module "lambda" {
source = "../../"
filename = "${path.module}/test_function.zip"
function_name = "my-function"
handler = "my-handler"
runtime = "go1.x"
source = "../../"
filename = "${path.module}/test_function.zip"
function_name = "my-function"
handler = "my-handler"
runtime = "go1.x"
source_code_hash = filebase64sha256("${path.module}/test_function.zip")

event = {
type = "dynamodb"
Expand Down
11 changes: 6 additions & 5 deletions examples/example-with-kinesis-event/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ provider "aws" {
}

module "lambda" {
source = "../../"
filename = "${path.module}/test_function.zip"
function_name = "my-function"
handler = "my-handler"
runtime = "go1.x"
source = "../../"
filename = "${path.module}/test_function.zip"
function_name = "my-function"
handler = "my-handler"
runtime = "go1.x"
source_code_hash = filebase64sha256("${path.module}/test_function.zip")

event = {
type = "kinesis"
Expand Down
13 changes: 7 additions & 6 deletions examples/example-with-s3-event/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ resource "aws_s3_bucket_notification" "bucket_notification" {
}

module "lambda" {
source = "../../"
description = "Example AWS Lambda using go with S3 trigger"
filename = "${path.module}/test_function.zip"
function_name = "tf-example-go-s3"
handler = "example-lambda-func"
runtime = "go1.x"
source = "../../"
description = "Example AWS Lambda using go with S3 trigger"
filename = "${path.module}/test_function.zip"
function_name = "tf-example-go-s3"
handler = "example-lambda-func"
runtime = "go1.x"
source_code_hash = filebase64sha256("${path.module}/test_function.zip")

event = {
type = "s3"
Expand Down
13 changes: 7 additions & 6 deletions examples/example-with-sns-event/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ provider "aws" {
}

module "lambda" {
source = "../../"
description = "Example AWS Lambda using go with sns trigger"
filename = "${path.module}/test_function.zip"
function_name = "tf-example-go-sns"
handler = "example-lambda-func"
runtime = "go1.x"
source = "../../"
description = "Example AWS Lambda using go with sns trigger"
filename = "${path.module}/test_function.zip"
function_name = "tf-example-go-sns"
handler = "example-lambda-func"
runtime = "go1.x"
source_code_hash = filebase64sha256("${path.module}/test_function.zip")

event = {
type = "sns"
Expand Down
11 changes: 6 additions & 5 deletions examples/example-with-sqs-event/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ provider "aws" {
}

module "lambda" {
source = "../../"
filename = "${path.module}/test_function.zip"
function_name = "my-function"
handler = "my-handler"
runtime = "go1.x"
source = "../../"
filename = "${path.module}/test_function.zip"
function_name = "my-function"
handler = "my-handler"
runtime = "go1.x"
source_code_hash = filebase64sha256("${path.module}/test_function.zip")

event = {
type = "sqs"
Expand Down
13 changes: 7 additions & 6 deletions examples/example-with-vpc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ provider "aws" {
}

module "lambda" {
source = "../../"
description = "Example AWS Lambda inside a VPC using go with cloudwatch scheduled event trigger"
filename = "${path.module}/test_function.zip"
function_name = "tf-example-go-basic-vpc"
handler = "example-lambda-func"
runtime = "go1.x"
source = "../../"
description = "Example AWS Lambda inside a VPC using go with cloudwatch scheduled event trigger"
filename = "${path.module}/test_function.zip"
function_name = "tf-example-go-basic-vpc"
handler = "example-lambda-func"
runtime = "go1.x"
source_code_hash = filebase64sha256("${path.module}/test_function.zip")

vpc_config = {
subnet_ids = ["subnet-123456", "subnet-123457"]
Expand Down
13 changes: 7 additions & 6 deletions examples/example-without-event/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ provider "aws" {
}

module "lambda" {
source = "../../"
description = "Example AWS Lambda using go with cloudwatch scheduled event trigger"
filename = "${path.module}/test_function.zip"
function_name = "tf-example-go-basic"
handler = "example-lambda-func"
runtime = "go1.x"
source = "../../"
description = "Example AWS Lambda using go with cloudwatch scheduled event trigger"
filename = "${path.module}/test_function.zip"
function_name = "tf-example-go-basic"
handler = "example-lambda-func"
runtime = "go1.x"
source_code_hash = filebase64sha256("${path.module}/test_function.zip")
}

0 comments on commit 8e3d145

Please sign in to comment.