File tree Expand file tree Collapse file tree 4 files changed +16
-10
lines changed
Expand file tree Collapse file tree 4 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ No requirements.
88
99| Name | Version |
1010| ------| ---------|
11- | archive | n/a |
1211| aws | n/a |
1312
1413## Inputs
@@ -21,9 +20,11 @@ No requirements.
2120| function\_ name | Name of the aws lambda function | ` string ` | n/a | yes |
2221| handler | Handler for the aws lambda function, the structure should be the following --> filename.mainfunction | ` string ` | n/a | yes |
2322| lambda\_ role\_ name | Name of the aws lambda execution role | ` string ` | n/a | yes |
23+ | lambda\_ runtime | Lambda runtime i.e <python3.8> | ` string ` | ` "python3.8" ` | no |
2424| output\_ path | The path and name of the resulting zip file | ` string ` | n/a | yes |
2525| region | n/a | ` string ` | ` "us-east-1" ` | no |
2626| schedule\_ expression | Cloudwatch rule rate expression for how frequent you want the lambda function to run | ` string ` | n/a | yes |
27+ | source\_ code\_ hash | hash of the current zip file, changes in the function code will produce an update of the lambda function | ` string ` | n/a | yes |
2728| source\_ file | The path in your filesystem where your script is located | ` string ` | n/a | yes |
2829| table\_ name | Name of the DynamoDB table | ` string ` | n/a | yes |
2930
Original file line number Diff line number Diff line change 1- data "aws_caller_identity" "current" {}
2-
3- data "archive_file" "lambda_zip" {
4- type = " zip"
5- source_file = var. source_file
6- output_path = var. output_path
7- }
1+ data "aws_caller_identity" "current" {}
Original file line number Diff line number Diff line change @@ -8,10 +8,10 @@ locals {
88resource "aws_lambda_function" "check_sgs" {
99 filename = var. output_path
1010 function_name = var. function_name
11- source_code_hash = data . archive_file . lambda_zip . output_base64sha256
11+ source_code_hash = var . source_code_hash
1212 role = aws_iam_role. iam_for_lambda . arn
1313 handler = var. handler
14- runtime = " python3.8 "
14+ runtime = var . lambda_runtime
1515 timeout = 10
1616
1717 environment {
Original file line number Diff line number Diff line change @@ -18,6 +18,17 @@ variable "function_name" {
1818 description = " Name of the aws lambda function"
1919}
2020
21+ variable "lambda_runtime" {
22+ type = string
23+ description = " Lambda runtime i.e <python3.8>"
24+ default = " python3.8"
25+ }
26+
27+ variable "source_code_hash" {
28+ type = string
29+ description = " hash of the current zip file, changes in the function code will produce an update of the lambda function"
30+ }
31+
2132variable "table_name" {
2233 type = string
2334 description = " Name of the DynamoDB table"
You can’t perform that action at this time.
0 commit comments