Terraform module Provides an Network ACL resource in AWS cloud provider. 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.
This module can be used to deploy a Network ACL on AWS Cloud Provider......
This module needs Terraform 0.12.23 or newer. You can download the latest Terraform version from here.
Below we are able to check the resources that are being created as part of this module call:
- Network ACL
To use this module, add the following call to your code:
- Sample Code:
module "network_acl" {
source = "git::https://github.com/nitinda/terraform-module-aws-network-acl.git?ref=master"
vpc_id = var.vpc_id
}
module "network_acl" {
source = "git::https://github.com/nitinda/terraform-module-aws-network-acl.git?ref=master"
vpc_id = module.vpc.id
subnet_ids = [module.vpc_subnet_public_1a.id, module.vpc_subnet_public_1b.id]
egress = [
{
protocol = "all"
rule_no = 100
action = "allow"
cidr_block = "0.0.0.0/0"
from_port = 0
to_port = 0
}
]
ingress = [
{
protocol = "all"
rule_no = 100
action = "allow"
cidr_block = "0.0.0.0/0"
from_port = 0
to_port = 0
}
]
tags = merge(
var.common_tags,
{
Environment = "prod"
Name = "network-acl"
}
)
}
The variables required in order for the module to be successfully called from the deployment repository are the following:
Variable | Description | Type | Argument Status | Default Value |
---|---|---|---|---|
vpc_id | The ID of the associated VPC | string | Required | |
subnet_ids | A list of Subnet IDs to apply the ACL to | list(string) | Optional | [] |
ingress | Specifies an ingress rule | any | Optional | [] |
egress | Specifies an egress rule | any | Optional | [] |
tags | A mapping of tags to assign to the resource | map(string) | Optional | {} |
This module has the following outputs:
- id
In order for the variables to be accessed at module level please use the syntax below:
module.<module_name>.<output_variable_name>
The output variable is able to be accessed through terraform state file using the syntax below:
data.terraform_remote_state.<layer_name>.<output_variable_name>
Module maintained by Module maintained by the - Nitin Das