Skip to content

Commit 991c563

Browse files
authored
Merge pull request #9 from non-existing-organization/feature/env_variables
Feature/env variables
2 parents 6f6fc23 + 10e8d37 commit 991c563

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Change Log
2+
3+
## [0.1.0] (2023-12-27)
4+
5+
- Provide arbitrary env variables for lambda as input

USAGE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ No requirements.
2222
| handler | Handler for the aws lambda function, the structure should be the following --> filename.mainfunction | `string` | n/a | yes |
2323
| lambda\_role\_name | Name of the aws lambda execution role | `string` | n/a | yes |
2424
| lambda\_runtime | Lambda runtime i.e <python3.8> | `string` | `"python3.8"` | no |
25+
| lambda\_vars | n/a | `map` | `{}` | no |
2526
| output\_path | The path and name of the resulting zip file | `string` | n/a | yes |
2627
| region | n/a | `string` | `"us-east-1"` | no |
2728
| schedule\_expression | Cloudwatch rule rate expression for how frequent you want the lambda function to run | `string` | n/a | yes |

main.tf

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,13 @@ resource "aws_lambda_function" "lambda_function" {
1515
timeout = 10
1616

1717
environment {
18-
variables = {
19-
table_name = local.table_name
20-
attribute_name = local.attribute_name
21-
}
18+
variables = merge(
19+
{
20+
table_name = local.table_name
21+
attribute_name = local.attribute_name
22+
},
23+
var.lambda_vars
24+
)
2225
}
2326
}
2427

variables.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,8 @@ variable "lambda_role_name" {
6262
variable "cw_event_is_enabled" {
6363
type = bool
6464
description = "Mark if CW event rule is enabled or not"
65+
}
66+
67+
variable "lambda_vars" {
68+
default = {}
6569
}

0 commit comments

Comments
 (0)