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

No rules created when using computed_ingress_with_source_security_group_id #72

Closed
devonhk opened this issue Sep 10, 2018 · 3 comments
Closed

Comments

@devonhk
Copy link

devonhk commented Sep 10, 2018

Description
No inbound rules are created when using computed_ingress_with_source_security_group_id

Repro steps

  1. Example terraform security group:
module "mysql_wordpress_security_group" {
  source = "terraform-aws-modules/security-group/aws"

  name = "mysql_wordpress_security_group"
  vpc_id = "${module.vpc.vpc_id}"
  description = "test"

  computed_ingress_with_source_security_group_id = [
    {
      source_security_group_id = "${module.ec2_security_group.this_security_group_id}"
      rule = "mysql-tcp"
    }
  ]
  egress_cidr_blocks = ["0.0.0.0/0"]
  egress_rules = ["all-all"]


  tags = {
    Terraform = "true"
    Environment = "${terraform.workspace}"
  }
}
  1. terraform plan & terraform apply

Expected behavior
A security group with an inbound rule is created

Actual behavior
A security group without any inbound rules is created.

@devonhk
Copy link
Author

devonhk commented Sep 10, 2018

I found the relevant documentation about my issue.
I need to specify the number of security groups to created.
number_of_computed_ingress_with_source_security_group_id = 1
Maybe this issue can be converted into a future improvement where the number_of_computed_ingress_with_source_security_group_id could be computed dynamically?
Actually idk when this will be possible hashicorp/terraform#16712

@devonhk devonhk closed this as completed Sep 10, 2018
@antonbabenko
Copy link
Member

Yes, as you have found out, number_of_computed_... type of arguments were added exactly to solve the limitation with computed values in Terraform 0.11. It will become unnecessary in Terraform 0.12.

@github-actions
Copy link

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 17, 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