Skip to content

Commit bc491c8

Browse files
authored
feat: Updated Lambda module to work with Terraform 0.13 (#99)
1 parent bd830a2 commit bc491c8

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ Doing serverless with Terraform? Check out [serverless.tf framework](https://ser
99

1010
## Terraform versions
1111

12-
Terraform 0.12. Pin module version to `~> v3.0`. Submit pull-requests to `master` branch.
12+
Terraform 0.13. Pin module version to `~> v4.0`. Submit pull-requests to `master` branch.
13+
14+
Terraform 0.12. Pin module version to `3.4.0` (or older). Submit pull-requests to `terraform012` branch.
1315

1416
Terraform 0.11. Pin module version to `~> v1.0`.
1517

@@ -30,7 +32,7 @@ Terraform 0.11. Pin module version to `~> v1.0`.
3032
```hcl
3133
module "notify_slack" {
3234
source = "terraform-aws-modules/notify-slack/aws"
33-
version = "~> 3.0"
35+
version = "~> 4.0"
3436
3537
sns_topic_name = "slack-topic"
3638

examples/notify-slack-simple/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,6 @@ module "notify_slack" {
1919
tags = {
2020
Name = "notify-slack-simple"
2121
}
22+
23+
depends_on = [aws_sns_topic.my_sns]
2224
}

main.tf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ resource "aws_sns_topic_subscription" "sns_notify_slack" {
6767

6868
module "lambda" {
6969
source = "terraform-aws-modules/lambda/aws"
70-
version = ">= 1.18.0"
70+
version = "1.18.0"
7171

7272
create = var.create
7373

@@ -104,6 +104,8 @@ module "lambda" {
104104
attach_policy_json = true
105105
policy_json = element(concat(data.aws_iam_policy_document.lambda[*].json, [""]), 0)
106106

107+
use_existing_cloudwatch_log_group = true
108+
107109
allowed_triggers = {
108110
AllowExecutionFromSNS = {
109111
principal = "sns.amazonaws.com"
@@ -112,4 +114,6 @@ module "lambda" {
112114
}
113115

114116
tags = merge(var.tags, var.lambda_function_tags)
117+
118+
depends_on = [aws_cloudwatch_log_group.lambda]
115119
}

0 commit comments

Comments
 (0)