diff --git a/README.md b/README.md index 656cde65..afd213ea 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,9 @@ If you want to subscribe AWS Lambda Function created by this module to an existi ## Examples -* [notify-slack-simple](https://github.com/terraform-aws-modules/terraform-aws-notify-slack/tree/master/modules/notify-slack-simple) - Creates SNS topic which sends messages to Slack channel. -* [notify-slack-kms](https://github.com/terraform-aws-modules/terraform-aws-notify-slack/tree/master/modules/notify-slack-simple) - Creates SNS topic which sends messages to Slack channel (using KMS to encrypt Slack webhook URL). -* [cloudwatch-alerts-to-slack](https://github.com/terraform-aws-modules/terraform-aws-notify-slack/tree/master/modules/cloudwatch-alerts-to-slack) - End to end example which shows how to send AWS Cloudwatch alerts to Slack channel and use KMS to encrypt webhook URL. +* [notify-slack-simple](https://github.com/terraform-aws-modules/terraform-aws-notify-slack/tree/master/examples/notify-slack-simple) - Creates SNS topic which sends messages to Slack channel. +* [notify-slack-kms](https://github.com/terraform-aws-modules/terraform-aws-notify-slack/tree/master/examples/notify-slack-simple) - Creates SNS topic which sends messages to Slack channel (using KMS to encrypt Slack webhook URL). +* [cloudwatch-alerts-to-slack](https://github.com/terraform-aws-modules/terraform-aws-notify-slack/tree/master/examples/cloudwatch-alerts-to-slack) - End to end example which shows how to send AWS Cloudwatch alerts to Slack channel and use KMS to encrypt webhook URL. ## Authors diff --git a/main.tf b/main.tf index e0de3206..f6c551ee 100644 --- a/main.tf +++ b/main.tf @@ -36,7 +36,7 @@ data "archive_file" "notify_slack" { resource "aws_lambda_function" "notify_slack" { filename = "${data.archive_file.notify_slack.output_path}" - function_name = "notify_slack" + function_name = "${var.lambda_function_name}" role = "${aws_iam_role.lambda.arn}" handler = "notify_slack.lambda_handler" source_code_hash = "${data.archive_file.notify_slack.output_base64sha256}" diff --git a/variables.tf b/variables.tf index 78f66d4a..9940da82 100644 --- a/variables.tf +++ b/variables.tf @@ -3,6 +3,11 @@ variable "create_sns_topic" { default = true } +variable "lambda_function_name" { + description = "The name of the Lambda function to create" + default = "notify_slack" +} + variable "sns_topic_name" { description = "The name of the SNS topic to create" }