AWS Amazon EC2 Network ACL

This page shows how to write Terraform and CloudFormation for Amazon EC2 Network ACL and write them securely.

code-icon

Fix issues in your cloud & app configurations

Test for misconfigurations of this resource in your cloud.

get-started-button

Terraform Example (aws_network_acl)

Provides an network ACL resource. You might set up network ACLs with rules similar to your security groups in order to add an additional layer of security to your VPC.

NOTE on Network ACLs and Network ACL Rules: Terraform currently provides both a standalone Network ACL Rule resource and a Network ACL resource with rules defined in-line. At this time you cannot use a Network ACL with in-line rules in conjunction with any Network ACL Rule resources. Doing so will cause a conflict of rule settings and will overwrite rules.

Parameters

Example Usage (from GitHub)

github-icontappoflw/tappo1
resource "aws_network_acl" "acl-02363a11d7ec94225" {
    vpc_id     = "vpc-07d17e9a63e917701"
    subnet_ids = ["subnet-044e67e5ccb2d56bb", "subnet-0e6e8fcd90b8a13de"]

    ingress {
        from_port  = 0
github-iconDianaMayesCloud/Project-v1
resource "aws_network_acl" "pub_az1_nacl" {
  vpc_id     = aws_vpc.green_vpc.id
  subnet_ids = [aws_subnet.pub_az1_subnet.id]
  tags = {
    Name = "Public-AZ1-NACL"
  }
github-iconDianaMayesCloud/Project-v2
resource "aws_network_acl" "pub_az1_nacl" {
  vpc_id     = aws_vpc.green_vpc.id
  subnet_ids = [aws_subnet.pub_az1_subnet.id]
  tags = {
    Name = "Public-AZ1-NACL"
  }

CloudFormation Example (AWS::EC2::NetworkAcl)

Specifies a network ACL for your VPC.

Parameters

Frequently asked questions

What is AWS Amazon EC2 Network ACL?

AWS Amazon EC2 Network ACL is a resource for Amazon EC2 of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS Amazon EC2 Network ACL?

For Terraform, the tappoflw/tappo1, DianaMayesCloud/Project-v1 and DianaMayesCloud/Project-v2 source code examples are useful. See the Terraform Example section for further details.