Skip to content

Plan fails due to cycle when upgrading from v6.x to v7.0.0Β #258

@languitar

Description

@languitar

Description

When updating from version 6 of this module to version 7 (including the mandatory update to AWS provider v6), the plan fails with a detected cycle:

  β”‚ Error: Cycle: module.notify_slack.module.lambda.aws_lambda_permission.unqualified_alias_triggers (expand), module.notify_slack.module.lambda.aws_lambda_permission.unqualified_alias_triggers["AllowExecutionFromSNS"], module.notify_slack.module.lambda.aws_lambda_permission.unqualified_alias_triggers["AllowExecutionFromSNS"] (destroy deposed 55dd3ccb), module.notify_slack.module.lambda.aws_iam_policy.additional_json[0] (destroy), module.notify_slack.module.lambda.aws_lambda_permission.current_version_triggers (expand), module.notify_slack.module.lambda.aws_lambda_permission.current_version_triggers["AllowExecutionFromSNS"], module.notify_slack.module.lambda.aws_lambda_permission.current_version_triggers["AllowExecutionFromSNS"] (destroy deposed e3f3f222), module.notify_slack.module.lambda.aws_iam_role_policy_attachment.additional_json[0] (destroy), module.notify_slack.module.lambda.aws_lambda_function.this[0]
  • βœ‹ I have searched the open/closed issues and my issue is not listed.

Versions

  • Module version [Required]: v7.0.0

  • Terraform version:

    OpenTofu v1.9.1
    on linux_amd64

  • Provider version(s):

    + provider registry.opentofu.org/cloudposse/awsutils v0.20.1
    + provider registry.opentofu.org/hashicorp/aws v6.7.0
    + provider registry.opentofu.org/hashicorp/external v2.3.5
    + provider registry.opentofu.org/hashicorp/local v2.5.3
    + provider registry.opentofu.org/hashicorp/null v3.2.4
    

Reproduction Code [Required]

Steps to reproduce the behavior:

Starting from:

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "5.100.0"
    }
  }
}

resource "aws_ssm_parameter" "notification_slack_webhook_url" {
  type  = "String"
  name  = "/foo/slack-webhook"
  value = "PLACEHOLDER"
}

module "notify_slack" {
  source  = "terraform-aws-modules/notify-slack/aws"
  version = "~> 6.0"

  sns_topic_name       = "some-topic"
  lambda_function_name = "notify_slack_issues"

  slack_webhook_url = aws_ssm_parameter.notification_slack_webhook_url.value
  slack_channel     = "xxx"
  slack_username    = "xxx"
  slack_emoji       = "xxx"
}

This state was applied.

Afterwards, upgrade the AWS provider to 6.7.0 and the module version to ~> 7.0 and try to plan:

Expected behavior

Plan works

Actual behavior

* Failed to execute "tofu plan" in ./.terragrunt-cache/ecUpAdU4bVp0Ju-svwtQZKHeVhw/0JJkSmAoC9OEzS37wZvHZ9LYzY4
  β•·
  β”‚ Error: Cycle: module.notify_slack.module.lambda.aws_lambda_permission.unqualified_alias_triggers (expand), module.notify_slack.module.lambda.aws_lambda_permission.unqualified_alias_triggers["AllowExecutionFromSNS"], module.notify_slack.module.lambda.aws_lambda_permission.unqualified_alias_triggers["AllowExecutionFromSNS"] (destroy deposed 55dd3ccb), module.notify_slack.module.lambda.aws_iam_policy.additional_json[0] (destroy), module.notify_slack.module.lambda.aws_lambda_permission.current_version_triggers (expand), module.notify_slack.module.lambda.aws_lambda_permission.current_version_triggers["AllowExecutionFromSNS"], module.notify_slack.module.lambda.aws_lambda_permission.current_version_triggers["AllowExecutionFromSNS"] (destroy deposed e3f3f222), module.notify_slack.module.lambda.aws_iam_role_policy_attachment.additional_json[0] (destroy), module.notify_slack.module.lambda.aws_lambda_function.this[0]

Terminal Output Screenshot(s)

see above

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions