Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Terraform 0.15 #135

Closed
afsmeira opened this issue Apr 19, 2021 · 2 comments
Closed

Support Terraform 0.15 #135

afsmeira opened this issue Apr 19, 2021 · 2 comments

Comments

@afsmeira
Copy link
Contributor

afsmeira commented Apr 19, 2021

Description

Terraform 0.15 (changelog) removed the deprecated functions list and map which this module uses.

Versions

  • Terraform: 0.15

Reproduction

Steps to reproduce the behavior:

  • Terraform file (see below)
  • terraform init && terraform validate

Code Snippet to Reproduce

terraform {
  required_version = ">= 0.15"
}
provider "aws" {
  region = "eu-west-1"
}

module "slack_notifications" {
  source  = "terraform-aws-modules/notify-slack/aws"
  version = "4.13.0"

  sns_topic_name = "topic-name"

  slack_webhook_url = "https://fake-url.com"
  slack_channel     = "some-channel"
  slack_username    = "AWS Cloud Watch - Dead-letter queue alarms"

  cloudwatch_log_group_retention_in_days = 14

  iam_role_name_prefix = ""

  lambda_function_name = "lambda-name"
  lambda_description   = "description"
}

Expected behavior

terraform validate should not fail.

Actual behavior

terraform validate fails with

│ Error: Error in function call
│
│   on .terraform/modules/slack_notifications.lambda/iam.tf line 23, in data "aws_iam_policy_document" "assume_role":
│   23:       identifiers = distinct(concat(slice(list("lambda.amazonaws.com", "edgelambda.amazonaws.com"), 0, var.lambda_at_edge ? 2 : 1), var.trusted_entities))
│
│ Call to function "list" failed: the "list" function was deprecated in
│ Terraform v0.12 and is no longer available; use tolist([ ... ]) syntax to
│ write a literal list.
╵
╷
│ Error: Error in function call
│
│   on .terraform/modules/slack_notifications.lambda/outputs.tf line 98, in output "s3_object":
│   98:   value       = map("bucket", local.s3_bucket, "key", local.s3_key, "version_id", local.s3_object_version)
│     ├────────────────
│     │ local.s3_bucket is a string, known only after apply
│     │ local.s3_key will be known only after apply
│     │ local.s3_object_version will be known only after apply
│
│ Call to function "map" failed: the "map" function was deprecated in
│ Terraform v0.12 and is no longer available; use tomap({ ... }) syntax to
│ write a literal map.
|
│ Error: Error in function call
│
│   on .terraform/modules/slack_notifications/main.tf line 29, in locals:
│   29:     resources = [replace("${element(concat(aws_cloudwatch_log_group.lambda[*].arn, list("")), 0)}:*", ":*:*", ":*")]
│
│ Call to function "list" failed: the "list" function was deprecated in
│ Terraform v0.12 and is no longer available; use tolist([ ... ]) syntax to
│ write a literal list.
@antonbabenko
Copy link
Member

Fixed in #136. Thank you, @afsmeira !

v4.14.0 has been just released.

@github-actions
Copy link

github-actions bot commented Nov 8, 2022

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants