Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Lambda function to handle CodePipeline CloudWatch events and send a notification
![Started](docs/sample-notification-succeeded.png)

### Deployment
Requires Terraform to be installed.
Requires Terraform 0.12+ to be installed.

1. Change permissions of deployment bash script `chmod +x deploy.sh`
2. Run `./deploy.sh` which will prompt you for the following variables:
Expand Down
12 changes: 6 additions & 6 deletions terraform/lambda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ resource "aws_lambda_function" "lambda" {
function_name = "codepipeline-teams-notifications"
role = "${aws_iam_role.lambda.arn}"
handler = "index.handler"
source_code_hash = "${base64sha256(file("../lambda.zip"))}"
source_code_hash = "${filebase64sha256("../lambda.zip")}
runtime = "nodejs8.10"
timeout = 20

Expand All @@ -15,9 +15,9 @@ resource "aws_lambda_function" "lambda" {
}

resource "aws_lambda_permission" "cloudwatch_execution" {
statement_id = "AllowExecutionFromCloudWatch"
action = "lambda:InvokeFunction"
function_name = "${aws_lambda_function.lambda.function_name}"
principal = "events.amazonaws.com"
source_arn = "${aws_cloudwatch_event_rule.codepipeline_event.arn}"
statement_id = "AllowExecutionFromCloudWatch"
action = "lambda:InvokeFunction"
function_name = "${aws_lambda_function.lambda.function_name}"
principal = "events.amazonaws.com"
source_arn = "${aws_cloudwatch_event_rule.codepipeline_event.arn}"
}