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

Allow network ACL management exclusion for given subnets #898

Closed
samuel-phan opened this issue Feb 27, 2023 · 9 comments
Closed

Allow network ACL management exclusion for given subnets #898

samuel-phan opened this issue Feb 27, 2023 · 9 comments
Labels

Comments

@samuel-phan
Copy link

Is your request related to a new offering from AWS?

Is this functionality available in the AWS provider for Terraform? See CHANGELOG.md, too.

  • Yes ✅: AWS provider v3+ (I think)

Is your request related to a problem? Please describe.

We would like to test an AZ failure for Business Continuity Plan (BCP) or Chaos engineering.

To simulate an AZ failure, a solution is to flip the network ACL for all the subnets in an AZ and set DENY traffic to all.

Describe the solution you'd like.

We could introduce an input variable to exclude network ACL management for some given subnets.

module "vpc" {
  source = "terraform-aws-modules/vpc/aws"

  private_dedicated_network_acl = true
  private_acl_excluded_subnets  = ["subnet-123456789"]

  # ...
}

resource "aws_network_acl" "block_all" {
  vpc_id     = module.vpc.vpc.id
  subnet_ids = ["subnet-123456789"]

  ingress {
    rule_no    = 1
    protocol   = "all"
    from_port  = 0
    to_port    = 0
    cidr_block = "0.0.0.0/0"
    action     = "deny"
  }

  ingress {
    rule_no         = 2
    protocol        = "all"
    from_port       = 0
    to_port         = 0
    ipv6_cidr_block = "::/0"
    action          = "deny"
  }

  egress {
    rule_no    = 1
    protocol   = "all"
    from_port  = 0
    to_port    = 0
    cidr_block = "0.0.0.0/0"
    action     = "deny"
  }

  egress {
    rule_no         = 2
    protocol        = "all"
    from_port       = 0
    to_port         = 0
    ipv6_cidr_block = "::/0"
    action          = "deny"
  }
}

Describe alternatives you've considered.

I don't see any other alternative.

Additional context

Current:
Page 1

BCP test with one AZ failure simulation:
BPC

@bryantbiggs
Copy link
Member

This module already supports NACLs so you would just update the NACL rules - or am I missing something?

@samuel-phan
Copy link
Author

But how would I have a custom NACL only for 1 subnet like in the diagram above?

@bryantbiggs
Copy link
Member

If you want it specifically for one subnet, I think the route you show above is the correct route (where you provide the NACL and associate it with the subnet(s) of interest). I don't think adding this into the module makes a lot of sense at this time

@samuel-phan
Copy link
Author

What I showed above is not what is implemented, but a suggestion of what I'd like.

@bryantbiggs
Copy link
Member

What I showed above is not what is implemented, but a suggestion of what I'd like.

Understood - and I am suggesting that this is an implementation detail left to users, not the module

@samuel-phan
Copy link
Author

The part that needs to be part of the module is this one:

  private_acl_excluded_subnets  = ["subnet-123456789"]

@github-actions
Copy link

This issue has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this issue will be closed in 10 days

@github-actions github-actions bot added the stale label Mar 30, 2023
@github-actions
Copy link

github-actions bot commented Apr 9, 2023

This issue was automatically closed because of stale in 10 days

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 9, 2023
@github-actions
Copy link

github-actions bot commented May 9, 2023

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 May 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants