generated from cloudposse/terraform-example-module
-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Cycle dependency #76
Labels
bug
🐛 An issue with the system
Comments
This is causing this problem terraform-aws-security-group/main.tf Lines 81 to 109 in 276a494
The fact that the module can handle inline, even if inline is disabled, that does not matter. Here is simplistic example to demonstrate that:
module "sg_1" {
source = "./module"
rules = [module.sg_2.id]
}
module "sg_2" {
source = "./module"
rules = [module.sg_1.id]
}
variable "rules" {
type = list(any)
}
resource "aws_security_group" "default" {
dynamic "does_not_matter_what" {
for_each = var.rules # it can be local behind some flag, it does not matter
content {
does_not_matter_what = ""
}
}
}
output "id" {
value = aws_security_group.default.id
}
╷
│ Error: Cycle: module.sg_2.aws_security_group.default, module.sg_2.output.id (expand), module.sg_1.var.rules (expand), module.sg_1.aws_security_group.default, module.sg_1.output.id (expand), module.sg_2.var.rules (expand)
│
│
╵ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the Bug
Trying to move from
https://github.com/terraform-aws-modules/terraform-aws-security-group
, a simple declaration ofSecurity Group rules
for two newSecurity Group
in order to:creates a cycle and Terraform is not able to perform a plan.
Use case:
(where setting
allow_all_egress
totrue
is not an option, from a security point of view)Expected Behavior
Terraform plan finishes without error about cycle dependency.
Steps to Reproduce
Run
with following code:
Screenshots
No response
Environment
Terraform v1.7.4
on darwin_arm64
Additional Context
Same "code" with
terraform-aws-modules/security-group/aws
implementation produces no errorand plan seems consistent with expected output
The text was updated successfully, but these errors were encountered: