Skip to content

Commit 0a1fae8

Browse files
authored
feat: Update lambda module and bump Terraform/AWS provider versions (#151)
1 parent 6b7db5d commit 0a1fae8

File tree

16 files changed

+103
-58
lines changed

16 files changed

+103
-58
lines changed

.github/workflows/unit-test.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Unit Test
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- master
8+
paths:
9+
- 'functions/**'
10+
- '.github/workflows/unit-test.yml'
11+
12+
defaults:
13+
run:
14+
working-directory: functions
15+
16+
jobs:
17+
test:
18+
name: Execute unit tests
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v2
24+
25+
- name: Set up Python 3.8
26+
uses: actions/setup-python@v2
27+
with:
28+
python-version: 3.8
29+
30+
- name: Install pipenv
31+
run: |
32+
python -m pip install --upgrade pip
33+
python -m pip install pipenv

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ terraform.rc
3232
builds/
3333
__pycache__/
3434
functions/pytest.ini
35+
*.zip

.pre-commit-config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.58.0
3+
rev: v1.60.0
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_validate
@@ -26,3 +26,4 @@ repos:
2626
rev: v4.0.1
2727
hooks:
2828
- id: check-merge-conflict
29+
- id: end-of-file-fixer

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,20 +80,20 @@ To run the tests:
8080

8181
| Name | Version |
8282
|------|---------|
83-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.0 |
84-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 2.35 |
83+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
84+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.61 |
8585

8686
## Providers
8787

8888
| Name | Version |
8989
|------|---------|
90-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 2.35 |
90+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.61 |
9191

9292
## Modules
9393

9494
| Name | Source | Version |
9595
|------|--------|---------|
96-
| <a name="module_lambda"></a> [lambda](#module\_lambda) | terraform-aws-modules/lambda/aws | 1.47.0 |
96+
| <a name="module_lambda"></a> [lambda](#module\_lambda) | terraform-aws-modules/lambda/aws | 2.27.1 |
9797

9898
## Resources
9999

@@ -153,7 +153,7 @@ To run the tests:
153153
| <a name="output_notify_slack_lambda_function_last_modified"></a> [notify\_slack\_lambda\_function\_last\_modified](#output\_notify\_slack\_lambda\_function\_last\_modified) | The date Lambda function was last modified |
154154
| <a name="output_notify_slack_lambda_function_name"></a> [notify\_slack\_lambda\_function\_name](#output\_notify\_slack\_lambda\_function\_name) | The name of the Lambda function |
155155
| <a name="output_notify_slack_lambda_function_version"></a> [notify\_slack\_lambda\_function\_version](#output\_notify\_slack\_lambda\_function\_version) | Latest published version of your Lambda function |
156-
| <a name="output_this_slack_topic_arn"></a> [this\_slack\_topic\_arn](#output\_this\_slack\_topic\_arn) | The ARN of the SNS topic from which messages will be sent to Slack |
156+
| <a name="output_slack_topic_arn"></a> [slack\_topic\_arn](#output\_slack\_topic\_arn) | The ARN of the SNS topic from which messages will be sent to Slack |
157157
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
158158

159159
## Authors

examples/cloudwatch-alerts-to-slack/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,16 @@ Note that this example may create resources which can cost money. Run `terraform
6060

6161
| Name | Version |
6262
|------|---------|
63-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.0 |
64-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 2.35 |
65-
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2 |
63+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
64+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.61 |
65+
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.0 |
6666

6767
## Providers
6868

6969
| Name | Version |
7070
|------|---------|
71-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 2.35 |
72-
| <a name="provider_random"></a> [random](#provider\_random) | >= 2 |
71+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.61 |
72+
| <a name="provider_random"></a> [random](#provider\_random) | >= 2.0 |
7373

7474
## Modules
7575

@@ -102,5 +102,5 @@ No inputs.
102102
| <a name="output_notify_slack_lambda_function_last_modified"></a> [notify\_slack\_lambda\_function\_last\_modified](#output\_notify\_slack\_lambda\_function\_last\_modified) | The date Lambda function was last modified |
103103
| <a name="output_notify_slack_lambda_function_name"></a> [notify\_slack\_lambda\_function\_name](#output\_notify\_slack\_lambda\_function\_name) | The name of the Lambda function |
104104
| <a name="output_notify_slack_lambda_function_version"></a> [notify\_slack\_lambda\_function\_version](#output\_notify\_slack\_lambda\_function\_version) | Latest published version of your Lambda function |
105-
| <a name="output_this_sns_topic_arn"></a> [this\_sns\_topic\_arn](#output\_this\_sns\_topic\_arn) | The ARN of the SNS topic from which messages will be sent to Slack |
105+
| <a name="output_sns_topic_arn"></a> [sns\_topic\_arn](#output\_sns\_topic\_arn) | The ARN of the SNS topic from which messages will be sent to Slack |
106106
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

examples/cloudwatch-alerts-to-slack/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ resource "aws_cloudwatch_metric_alarm" "lambda_duration" {
5555
threshold = "5000"
5656
alarm_description = "Duration of notifying slack exceeds threshold"
5757

58-
alarm_actions = [module.notify_slack["develop"].this_slack_topic_arn]
58+
alarm_actions = [module.notify_slack["develop"].slack_topic_arn]
5959

6060
dimensions = {
6161
FunctionName = module.notify_slack["develop"].notify_slack_lambda_function_name

examples/cloudwatch-alerts-to-slack/outputs.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
output "this_sns_topic_arn" {
1+
output "sns_topic_arn" {
22
description = "The ARN of the SNS topic from which messages will be sent to Slack"
3-
value = module.notify_slack["develop"].this_slack_topic_arn
3+
value = module.notify_slack["develop"].slack_topic_arn
44
}
55

66
output "lambda_iam_role_arn" {
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
terraform {
2-
required_version = ">= 0.13.0"
2+
required_version = ">= 0.13.1"
33

44
required_providers {
5-
aws = ">= 2.35"
6-
random = ">= 2"
5+
aws = {
6+
source = "hashicorp/aws"
7+
version = ">= 3.61"
8+
}
9+
random = {
10+
source = "hashicorp/random"
11+
version = ">= 2.0"
12+
}
713
}
814
}

examples/notify-slack-simple/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ Note that this example may create resources which can cost money (AWS Elastic IP
2323

2424
| Name | Version |
2525
|------|---------|
26-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.0 |
27-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 2.35 |
26+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
27+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.61 |
2828

2929
## Providers
3030

3131
| Name | Version |
3232
|------|---------|
33-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 2.35 |
33+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.61 |
3434

3535
## Modules
3636

@@ -60,5 +60,5 @@ No inputs.
6060
| <a name="output_notify_slack_lambda_function_last_modified"></a> [notify\_slack\_lambda\_function\_last\_modified](#output\_notify\_slack\_lambda\_function\_last\_modified) | The date Lambda function was last modified |
6161
| <a name="output_notify_slack_lambda_function_name"></a> [notify\_slack\_lambda\_function\_name](#output\_notify\_slack\_lambda\_function\_name) | The name of the Lambda function |
6262
| <a name="output_notify_slack_lambda_function_version"></a> [notify\_slack\_lambda\_function\_version](#output\_notify\_slack\_lambda\_function\_version) | Latest published version of your Lambda function |
63-
| <a name="output_this_sns_topic_arn"></a> [this\_sns\_topic\_arn](#output\_this\_sns\_topic\_arn) | The ARN of the SNS topic from which messages will be sent to Slack |
63+
| <a name="output_sns_topic_arn"></a> [sns\_topic\_arn](#output\_sns\_topic\_arn) | The ARN of the SNS topic from which messages will be sent to Slack |
6464
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

examples/notify-slack-simple/outputs.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
output "this_sns_topic_arn" {
1+
output "sns_topic_arn" {
22
description = "The ARN of the SNS topic from which messages will be sent to Slack"
3-
value = module.notify_slack.this_slack_topic_arn
3+
value = module.notify_slack.slack_topic_arn
44
}
55

66
output "lambda_iam_role_arn" {

0 commit comments

Comments
 (0)