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

ingress_rules #335

Open
1 task done
gavinc-git opened this issue Mar 21, 2025 · 4 comments
Open
1 task done

ingress_rules #335

gavinc-git opened this issue Mar 21, 2025 · 4 comments

Comments

@gavinc-git
Copy link

gavinc-git commented Mar 21, 2025

Description

Unable to use the ingress_rules function, this hangs and never completes.
Have purged .terraform dir and re-init, issue persists

  • ✋ I have searched the open/closed issues and my issue is not listed.

⚠️ Note

Before you submit an issue, please perform the following first:

  1. Remove the local .terraform directory (! ONLY if state is stored remotely, which hopefully you are following that best practice!): rm -rf .terraform/
  2. Re-initialize the project root to pull down modules: terraform init
  3. Re-attempt your terraform plan or apply and check if the issue still persists

Versions

  • Module version [Required]:
    v5.3.0
  • Terraform version:
    v1.10.5
  • Provider version(s):
    aws : 5.92.0

Reproduction Code [Required]

module "sg_public_web_2a" {
  source = "terraform-aws-modules/security-group/aws"
  name = "sg_public_web_2a"
  description = "Public facing web servers"
  vpc_id = module.vpc.vpc_id
  ingress_rules = ["https-443-tcp","http-80-tcp"]
  
  egress_with_cidr_blocks = [
    {
      protocol = "all"
      from_port = "-1"
      to_port = "-1"
      description = "All and everything"
      cidr_blocks = "0.0.0.0/0"
    },
  ]
  tags = {
    Terraform = "true"
  }
}

Expected behavior

Create ingress for http and https as per the following block that works

ingress_with_cidr_blocks = [
    {
      protocol = "tcp"
      from_port = "80"
      to_port = "80"
      description = "Port 80 mapping"
      cidr_blocks = "0.0.0.0/0"
    },
    {
      protocol = "tcp"
      from_port = "443"
      to_port = "443"
      description = "Port 443 mapping"
      cidr_blocks = "0.0.0.0/0"
    }
  ]

Actual behavior

Hangs, fails to build the rules

Additional context

I left this running while I went for a vape and made a coffee, and still hadnt completed.
Running the block noted in excepted behaviour, completes within seconds

@gavinc-git
Copy link
Author

Again tried some other rules this time:

ingress_rules = [
    "activemq-5671-tcp",
    "activemq-8883-tcp",
    "activemq-61614-tcp",
    "activemq-61617-tcp",
    "activemq-61619-tcp"
  ]

Terminal:

Image

@jalet
Copy link

jalet commented Mar 27, 2025

I don't think this is an issue with the module. I stumbled upon this as well and then found this, hashicorp/terraform-provider-aws#40091

Reverting back to AWS provider 5.72.1 solved the issue for me.

@gavinc-git
Copy link
Author

gavinc-git commented Mar 28, 2025

Reverting back to AWS provider 5.72.1 solved the issue for me.

Thank you @jalet , I'll give that a try.

@gavinc-git
Copy link
Author

Had to drop VPC module back a few versions as well.

Still doesnt seem to apply the rules, but now the output is going all the way through to complete:

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants