This Terraform Module adds a default set of Network
ACLs to a VPC created using the
vpc-app module. The ACLs enforce the following security settings (based on A Reference VPC
Architecture):
Public subnet: Allow all requests.
Private app subnet: Allow all requests to/from the public subnets, private persistence subnets, and the Mgmt VPC.
Allow all outbound TCP requests plus return traffic from any IP for those TCP requests on ephemeral
ports.
Private persistence subnet: Allow all requests to/from the private app subnets and the Mgmt VPC.
Check out variables.tf for all the configuration options available.
What's a VPC?
A VPC or Virtual Private Cloud is a logically isolated section of your AWS cloud. Each
VPC defines a virtual network within which you run your AWS resources, as well as rules for what can go in and out of
that network. This includes subnets, route tables that tell those subnets how to route inbound and outbound traffic,
security groups, access controls lists for the network (NACLs), and any other network components such as VPN connections.
What's a Network ACL?
Network ACLs provide an extra layer of network
security, similar to a security group.
Whereas a security group controls what inbound and outbound traffic is allowed for a specific resource (e.g. a single
EC2 instance), a network ACL controls what inbound and outbound traffic is allowed for an entire subnet.
How do I configure the Network ACLs for public ELB access?
The recommended configuration for public Elastic Load Balancers is to deploy the public facing ELB (Application Load
Balancer/ALB or Network Load Balancer/NLB) in the public subnet tier, and the applications in the private app subnet
tier. For the most part, the Network ACLs configured in this module should be sufficient for exposing access to the
private services through the public ELB.
However, for NLBs, the default network ACLs in the module would restrict access to the private services routed from the
NLB if the application is listening on a privileged port (port numbers less than 1024, e.g. HTTP port 80). This is
because unlike ALBs, NLBs do not do address translation, and thus the VPC firewalls end up seeing the client IP address
instead of the NLB IP address. This triggers the firewall rules in the network ACLs that will block access to the
private service in the private app subnet, as the traffic will not appear to come from the public subnet tier.
To ensure the NLB traffic can make it to the private service, you must expose access to the privileged port from the
client IP address in the network ACL rules. To do this, you can use the private_app_allow_inbound_ports_from_cidr
input variable. For example, to allow access to a service listening on port 443 (HTTPS):
module"network_acls" {
# other arguments omitted for brevity
private_app_allow_inbound_ports_from_cidr = {
AllowAnyPublicHTTP = {
client_cidr_block = "0.0.0.0/0"
protocol = "tcp"
from_port = 443
to_port = 443
icmp_type = null
icmp_code = null
# We pick rule number 99 to ensure it has the highest priority.
rule_number = 99
}
}
}
Questions? Ask away.
We're here to talk about our services, answer any questions, give advice, or just to chat.
{"treedata":{"name":"root","toggled":true,"children":[{"name":".circleci","children":[{"name":"config.yml","path":".circleci/config.yml","sha":"343e4251aedcf80e5dea160c531080b41972f7f6"}]},{"name":".github","children":[{"name":"ISSUE_TEMPLATE","children":[{"name":"bug_report.md","path":".github/ISSUE_TEMPLATE/bug_report.md","sha":"d2e87e27c601e423865ed660ec697082470ca60f"},{"name":"feature_request.md","path":".github/ISSUE_TEMPLATE/feature_request.md","sha":"023a33099be2336476930c96e17ff1ba5dc55348"}]},{"name":"pull_request_template.md","path":".github/pull_request_template.md","sha":"1ed18daca8d8613b91574ddd1641f2d129204f50"}]},{"name":".gitignore","path":".gitignore","sha":"b4d646276b2bd09ca0637874dedb1e03dc831406"},{"name":".pre-commit-config.yaml","path":".pre-commit-config.yaml","sha":"49ee828ed16f55335ac4dcc74331f190366b1858"},{"name":"CODEOWNERS","path":"CODEOWNERS","sha":"930cbd5b0688fd763a1884a38bc2b899a4bddf48"},{"name":"LICENSE.txt","path":"LICENSE.txt","sha":"f4e3d9bd4717a044ed31ad847a300eee74371a78"},{"name":"README.md","path":"README.md","sha":"070884b6c8a01db8a21f30d4cef3c4b2d8a6ad95"},{"name":"examples","children":[{"name":"vpc-app-custom-az-ids","children":[{"name":"main.tf","path":"examples/vpc-app-custom-az-ids/main.tf","sha":"11db36cebf769082aa2e3c8edc42b519a86e235d"},{"name":"output.tf","path":"examples/vpc-app-custom-az-ids/output.tf","sha":"2d75b1b5b85d9aac1c4004dde2579ad5443833ef"},{"name":"variables.tf","path":"examples/vpc-app-custom-az-ids/variables.tf","sha":"871d1b624b399695b8cdee793b25e2406b17e617"}]},{"name":"vpc-app-multiple-public-route-tables","children":[{"name":"README.md","path":"examples/vpc-app-multiple-public-route-tables/README.md","sha":"87d78d1635611fbe823dba4251232da604bd5fac"},{"name":"main.tf","path":"examples/vpc-app-multiple-public-route-tables/main.tf","sha":"c9c3fe41d3052a621031ee7148c6772925d2c4a7"},{"name":"outputs.tf","path":"examples/vpc-app-multiple-public-route-tables/outputs.tf","sha":"a801fc3b1ede5802904b07e859669bda4bab4339"},{"name":"variables.tf","path":"examples/vpc-app-multiple-public-route-tables/variables.tf","sha":"02439559dc5a3f2fb6a09df87d21cc76a24accdc"}]},{"name":"vpc-app-no-nat-gateway","children":[{"name":"README.md","path":"examples/vpc-app-no-nat-gateway/README.md","sha":"826fb03cb21dbe3aff9abc46bc4241baf41e2b13"},{"name":"main.tf","path":"examples/vpc-app-no-nat-gateway/main.tf","sha":"efc27cbd8d2dd70dd7d41259b311acddf3ac37c1"},{"name":"outputs.tf","path":"examples/vpc-app-no-nat-gateway/outputs.tf","sha":"e5fe2a9caaa3168dd704ef17ca49fbba76b3ede7"},{"name":"variables.tf","path":"examples/vpc-app-no-nat-gateway/variables.tf","sha":"20dea2995e4f8e7b697b2d7395a7b61ab02261ac"}]},{"name":"vpc-app-subnets-disabled","children":[{"name":"README.md","path":"examples/vpc-app-subnets-disabled/README.md","sha":"2256bcba3ca92f542f9ccf5f53822d4dd41a5fd5"},{"name":"main.tf","path":"examples/vpc-app-subnets-disabled/main.tf","sha":"36affa6f0687a9d2e1afe6e33d3bbe3a1af6801b"},{"name":"outputs.tf","path":"examples/vpc-app-subnets-disabled/outputs.tf","sha":"6630dcfe2cf399866778a70b9f5530d99d5fc886"},{"name":"variables.tf","path":"examples/vpc-app-subnets-disabled/variables.tf","sha":"d29c3a45b54bb5e7e549d9a46d228ce7e427ad6d"}]},{"name":"vpc-app-with-endpoint","children":[{"name":"README.md","path":"examples/vpc-app-with-endpoint/README.md","sha":"97440c1a07a0725d9649ca2903f662eec25da17a"},{"name":"main.tf","path":"examples/vpc-app-with-endpoint/main.tf","sha":"c29982d92273f64834908c270c571a74137e62d9"},{"name":"outputs.tf","path":"examples/vpc-app-with-endpoint/outputs.tf","sha":"36e21a8b972bd561cbc3bdaea7b21b8982d6a662"},{"name":"variables.tf","path":"examples/vpc-app-with-endpoint/variables.tf","sha":"be23cd1bfd3a29beb63724612f6bb9a7e5bd3d25"}]},{"name":"vpc-app-with-inbound-network","children":[{"name":"README.md","path":"examples/vpc-app-with-inbound-network/README.md","sha":"9468946f438fd3ed5922f195b5b1a581162d1625"},{"name":"main.tf","path":"examples/vpc-app-with-inbound-network/main.tf","sha":"0fe022530d78bbb564fe0257ee280bee3860c573"},{"name":"outputs.tf","path":"examples/vpc-app-with-inbound-network/outputs.tf","sha":"729e7cb3afd8cfee49d4dde4ca3ba20f88ad930f"},{"name":"variables.tf","path":"examples/vpc-app-with-inbound-network/variables.tf","sha":"20dea2995e4f8e7b697b2d7395a7b61ab02261ac"}]},{"name":"vpc-app","children":[{"name":"README.md","path":"examples/vpc-app/README.md","sha":"826fb03cb21dbe3aff9abc46bc4241baf41e2b13"},{"name":"main.tf","path":"examples/vpc-app/main.tf","sha":"08d911fba394550eb2d1f8533067b5cb4c24bc8a"},{"name":"outputs.tf","path":"examples/vpc-app/outputs.tf","sha":"eb78df2471f68dbf71dc86175155e02a7065d4db"},{"name":"variables.tf","path":"examples/vpc-app/variables.tf","sha":"20dea2995e4f8e7b697b2d7395a7b61ab02261ac"}]},{"name":"vpc-custom-cidr-blocks","children":[{"name":"README.md","path":"examples/vpc-custom-cidr-blocks/README.md","sha":"0d398610e8f25b771726e94863ed642805f2cefa"},{"name":"main.tf","path":"examples/vpc-custom-cidr-blocks/main.tf","sha":"51500fafea3b39ad18027d4d3791a5dc1cf054fa"},{"name":"outputs.tf","path":"examples/vpc-custom-cidr-blocks/outputs.tf","sha":"e5fe2a9caaa3168dd704ef17ca49fbba76b3ede7"},{"name":"variables.tf","path":"examples/vpc-custom-cidr-blocks/variables.tf","sha":"56d3e0ca50ded5ea2535c71f3568f3728106a42b"}]},{"name":"vpc-flow-logs","children":[{"name":"README.md","path":"examples/vpc-flow-logs/README.md","sha":"9b99c0c7ce9ea7af0c9a6acf0a47f5247476d70a"},{"name":"main.tf","path":"examples/vpc-flow-logs/main.tf","sha":"3f2ee71432600220d6ca2c1ea7917a01960f4ce6"},{"name":"outputs.tf","path":"examples/vpc-flow-logs/outputs.tf","sha":"1832dd649235eb4f917497c2772299c761d39dad"},{"name":"variables.tf","path":"examples/vpc-flow-logs/variables.tf","sha":"3ac7ead850b612a5973fd4c58192dc6b856330df"}]},{"name":"vpc-mgmt-no-nat-gateway","children":[{"name":"README.md","path":"examples/vpc-mgmt-no-nat-gateway/README.md","sha":"3b0f25e9a18355a5fd58495b2b37c778c221edd6"},{"name":"main.tf","path":"examples/vpc-mgmt-no-nat-gateway/main.tf","sha":"bbc27702de43f5bbf0d8dd9c8ad98ae1ade36483"},{"name":"outputs.tf","path":"examples/vpc-mgmt-no-nat-gateway/outputs.tf","sha":"c11cde7873d030ed8e8e44a726ee2ea19d65fcd6"},{"name":"variables.tf","path":"examples/vpc-mgmt-no-nat-gateway/variables.tf","sha":"bf7cddc01e2b42855c9c435e5c2751e010e6a435"}]},{"name":"vpc-mgmt","children":[{"name":"README.md","path":"examples/vpc-mgmt/README.md","sha":"3b0f25e9a18355a5fd58495b2b37c778c221edd6"},{"name":"main.tf","path":"examples/vpc-mgmt/main.tf","sha":"90448ff65e0ad98d109048be8bd4965795e06eaa"},{"name":"outputs.tf","path":"examples/vpc-mgmt/outputs.tf","sha":"c11cde7873d030ed8e8e44a726ee2ea19d65fcd6"},{"name":"variables.tf","path":"examples/vpc-mgmt/variables.tf","sha":"59225eb0320c7af08fa4cade7bbeaf10bdeac295"}]},{"name":"vpc-network-acls","children":[{"name":"README.md","path":"examples/vpc-network-acls/README.md","sha":"63fd2a4f7ba03e727f6f01a0efea2f5a0b11648e"},{"name":"main.tf","path":"examples/vpc-network-acls/main.tf","sha":"21e23240438b90a22b8cde99d9f8a59ab444b11f"},{"name":"outputs.tf","path":"examples/vpc-network-acls/outputs.tf","sha":"5f59a828f7128b7bd7e52599fa794abd0f760293"},{"name":"variables.tf","path":"examples/vpc-network-acls/variables.tf","sha":"a19ecd5a9d56e8127d6dbd39ea9594b0ef49a696"}]},{"name":"vpc-peering-cross-accounts","children":[{"name":"README.md","path":"examples/vpc-peering-cross-accounts/README.md","sha":"5e9b780bfd5faf2d088af9006070a7ae1dfc8963"},{"name":"accepter.tf","path":"examples/vpc-peering-cross-accounts/accepter.tf","sha":"e53c83a1d3a4af5c0348176531eee8161ca23248"},{"name":"dependencies.tf","path":"examples/vpc-peering-cross-accounts/dependencies.tf","sha":"e5a5292d4e9ac44f072f4c88b8e5bc16861a67e5"},{"name":"outputs.tf","path":"examples/vpc-peering-cross-accounts/outputs.tf","sha":"5257d0521e3fa33b514cb90f55a811416141c9a2"},{"name":"providers.tf","path":"examples/vpc-peering-cross-accounts/providers.tf","sha":"e1e3cb4875ae9d9484ef965ad5ced9fa05bce6be"},{"name":"requester.tf","path":"examples/vpc-peering-cross-accounts/requester.tf","sha":"04db526f10d09196303216287992c78a9b7c4ebc"},{"name":"variables.tf","path":"examples/vpc-peering-cross-accounts/variables.tf","sha":"a3af170a52ebe3617c5cbdbc751924c2ef77560a"},{"name":"versions.tf","path":"examples/vpc-peering-cross-accounts/versions.tf","sha":"468159204ae9279f2b7c8a166992f66637d5c909"}]},{"name":"vpc-peering-external","children":[{"name":"README.md","path":"examples/vpc-peering-external/README.md","sha":"6976d17089bb100c609ee72b843994ccf76fcb05"},{"name":"main.tf","path":"examples/vpc-peering-external/main.tf","sha":"d968ea05c7fd426e8b2305a2f60e72d591416a8e"},{"name":"outputs.tf","path":"examples/vpc-peering-external/outputs.tf","sha":"5239df47a80d13f33ea58412eb73a83f4ff431ed"},{"name":"variables.tf","path":"examples/vpc-peering-external/variables.tf","sha":"891f648219c644354f932af309fa3dffb0de3bd5"}]},{"name":"vpc-peering","children":[{"name":"README.md","path":"examples/vpc-peering/README.md","sha":"7f8f87742afce56eb28e16f1fa4b14fad5d3e91f"},{"name":"main.tf","path":"examples/vpc-peering/main.tf","sha":"e86adc6c23b9e4c0a0ee3f75883cfea2041d8bf2"},{"name":"outputs.tf","path":"examples/vpc-peering/outputs.tf","sha":"85acf3fc320ca7969f57133d94515e80150f7c79"},{"name":"variables.tf","path":"examples/vpc-peering/variables.tf","sha":"6a8eb9ed4db5427a9eddb3205cfca9fc7386c085"}]}]},{"name":"modules","children":[{"name":"_docs","children":[{"name":"vpc-core-concepts.md","path":"modules/_docs/vpc-core-concepts.md","sha":"df81498e01f1289c6d6f1b00632bd6c45eb593c6"},{"name":"vpc_app_architecture.png","path":"modules/_docs/vpc_app_architecture.png","sha":"1cb6d726e1a35614b27be9f3d45b9752589b9683"}]},{"name":"network-acl-inbound","children":[{"name":"README.md","path":"modules/network-acl-inbound/README.md","sha":"3784f45a817ccb73f2e8254c22c674eb77f29a8d"},{"name":"main.tf","path":"modules/network-acl-inbound/main.tf","sha":"ad8d22e4a5b157aa69ac5990a9c45f722c12e953"},{"name":"variables.tf","path":"modules/network-acl-inbound/variables.tf","sha":"5bb3140cec48ca71ebc09ac664fca09c115ad77b"}]},{"name":"network-acl-outbound","children":[{"name":"README.md","path":"modules/network-acl-outbound/README.md","sha":"b0a204c8f1e30c99da43158c231436b018e53db6"},{"name":"main.tf","path":"modules/network-acl-outbound/main.tf","sha":"9d856905da73d1f5b8aa62c8c1b4ab4016697370"},{"name":"variables.tf","path":"modules/network-acl-outbound/variables.tf","sha":"a36ad2e23d0bab06dc5f2333203c2e9092f5e741"}]},{"name":"vpc-app-network-acls","children":[{"name":"README.md","path":"modules/vpc-app-network-acls/README.md","sha":"5e23f0c63324bee10cbc3d9f03ee982c7e77b2e9","toggled":true},{"name":"main.tf","path":"modules/vpc-app-network-acls/main.tf","sha":"6614a71267f752473e488fecb8d37edb090fc95a"},{"name":"outputs.tf","path":"modules/vpc-app-network-acls/outputs.tf","sha":"1e48debceed70b0444a7f7c8fc4c6f90d7cd49d3"},{"name":"variables.tf","path":"modules/vpc-app-network-acls/variables.tf","sha":"ebae242a463a9d654438faa6b1fca473489f9bdb"}],"toggled":true},{"name":"vpc-app","children":[{"name":"README.md","path":"modules/vpc-app/README.md","sha":"8aa894968578ac2f3c3da9ca52884ff3a33b09fb"},{"name":"main.tf","path":"modules/vpc-app/main.tf","sha":"0f303ba46bdea383ebc1600716fadabfc04412cd"},{"name":"outputs.tf","path":"modules/vpc-app/outputs.tf","sha":"ca324d96ae8df5dd8bd023e96c199c7bcaa508a5"},{"name":"variables.tf","path":"modules/vpc-app/variables.tf","sha":"9687387c785cd6940551a02500e55bf95b46d0e3"}]},{"name":"vpc-dns-forwarder-rules","children":[{"name":"README.md","path":"modules/vpc-dns-forwarder-rules/README.md","sha":"e61361e740adf9b6c95de03ee3ee4044162f57b8"},{"name":"main.tf","path":"modules/vpc-dns-forwarder-rules/main.tf","sha":"8dac64a52b8607d53e2f9ec467259dba923687dc"},{"name":"variables.tf","path":"modules/vpc-dns-forwarder-rules/variables.tf","sha":"b5baaad0819ce7c23d47d1292fe0798dee12cdf5"}]},{"name":"vpc-dns-forwarder","children":[{"name":"README.md","path":"modules/vpc-dns-forwarder/README.md","sha":"0d0b4fffb15431758fd436c7cdc474bace686b7e"},{"name":"main.tf","path":"modules/vpc-dns-forwarder/main.tf","sha":"7e8b06d61de77e16e14ee4dccf2b61aec8777e3b"},{"name":"outputs.tf","path":"modules/vpc-dns-forwarder/outputs.tf","sha":"382b7f3ae80e99cfd8325c9b4de404110e4d85ef"},{"name":"variables.tf","path":"modules/vpc-dns-forwarder/variables.tf","sha":"3c27308d90da5517d686c5bfb901801ba65637c0"}]},{"name":"vpc-flow-logs","children":[{"name":"README.md","path":"modules/vpc-flow-logs/README.md","sha":"09fa1ba0a3b308bb305f2652e11b6160edf9bce0"},{"name":"main.tf","path":"modules/vpc-flow-logs/main.tf","sha":"bf8854622986f8c9eb5b48eb11ce09f293db8020"},{"name":"outputs.tf","path":"modules/vpc-flow-logs/outputs.tf","sha":"029e23b76b63c324e836a69891a7cb452da99a06"},{"name":"variables.tf","path":"modules/vpc-flow-logs/variables.tf","sha":"9e44a2f0c8637f71001ab4e8b15eb8944bc6e688"}]},{"name":"vpc-interface-endpoint","children":[{"name":"README.md","path":"modules/vpc-interface-endpoint/README.md","sha":"5c65f1eec3964b3cc00637270f252406f9247a8a"},{"name":"main.tf","path":"modules/vpc-interface-endpoint/main.tf","sha":"84690332461150a56832822af7bed63dfe354401"},{"name":"outputs.tf","path":"modules/vpc-interface-endpoint/outputs.tf","sha":"cabaade4036421a8e46d53626e3fa19080d69c8f"},{"name":"variables.tf","path":"modules/vpc-interface-endpoint/variables.tf","sha":"4bfa9450ec8eae88f12ffa47ef7178eb8d7d8b78"}]},{"name":"vpc-mgmt-network-acls","children":[{"name":"README.md","path":"modules/vpc-mgmt-network-acls/README.md","sha":"5afe5e9c3b7b4f371b36780e0d3be6ad73a74452"},{"name":"main.tf","path":"modules/vpc-mgmt-network-acls/main.tf","sha":"0517b2fa9b3817b5a875a3e91023f6b9ee010054"},{"name":"outputs.tf","path":"modules/vpc-mgmt-network-acls/outputs.tf","sha":"a5e4effa3263fe4789957fb3058477f0419f65ab"},{"name":"variables.tf","path":"modules/vpc-mgmt-network-acls/variables.tf","sha":"6181036ea5629d4effc3ac95c149709ad8a15b0e"}]},{"name":"vpc-mgmt","children":[{"name":"README.md","path":"modules/vpc-mgmt/README.md","sha":"d94a31971b65ae3cf70c168a0ab41073ae648c12"},{"name":"main.tf","path":"modules/vpc-mgmt/main.tf","sha":"c43158f871a3638188e7ffdb2764e32b3817445b"},{"name":"outputs.tf","path":"modules/vpc-mgmt/outputs.tf","sha":"defdf79928efddcc6f7de1fa9a2492decc654a49"},{"name":"variables.tf","path":"modules/vpc-mgmt/variables.tf","sha":"7f7f73c1fd2b5478c900d22131f9eafdc1d96496"}]},{"name":"vpc-peering-cross-accounts-accepter","children":[{"name":"README.md","path":"modules/vpc-peering-cross-accounts-accepter/README.md","sha":"797e659ca65995c0cd7aa5bfbd08eb2466f95e34"},{"name":"main.tf","path":"modules/vpc-peering-cross-accounts-accepter/main.tf","sha":"73ffa7b65ccce10dc7e6af54dd2f3defe52d8e7b"},{"name":"outputs.tf","path":"modules/vpc-peering-cross-accounts-accepter/outputs.tf","sha":"905c5efb879537848fd4df0d0f47465a4cf6c87c"},{"name":"variables.tf","path":"modules/vpc-peering-cross-accounts-accepter/variables.tf","sha":"70c3e97b0a72be1ecd2137ba35db000c15229d30"},{"name":"versions.tf","path":"modules/vpc-peering-cross-accounts-accepter/versions.tf","sha":"468159204ae9279f2b7c8a166992f66637d5c909"}]},{"name":"vpc-peering-cross-accounts-requester","children":[{"name":"README.md","path":"modules/vpc-peering-cross-accounts-requester/README.md","sha":"4895670d7ca6ac45916b1e8d48557e87ff0f4047"},{"name":"main.tf","path":"modules/vpc-peering-cross-accounts-requester/main.tf","sha":"52e44cc4ac9e00fc0517cbdc109c494e9f3272f5"},{"name":"outputs.tf","path":"modules/vpc-peering-cross-accounts-requester/outputs.tf","sha":"dc15d00e21644f86600bedb6359954e3bbc20f54"},{"name":"variables.tf","path":"modules/vpc-peering-cross-accounts-requester/variables.tf","sha":"c1cf6724b737f92c9529dded5fee3fc1a1d746cd"},{"name":"versions.tf","path":"modules/vpc-peering-cross-accounts-requester/versions.tf","sha":"468159204ae9279f2b7c8a166992f66637d5c909"}]},{"name":"vpc-peering-external","children":[{"name":"README.md","path":"modules/vpc-peering-external/README.md","sha":"3a7b91706130c0901ee5f523633318a21fbe9483"},{"name":"main.tf","path":"modules/vpc-peering-external/main.tf","sha":"ac75620771500e2ab65d57c015e31865aeba9885"},{"name":"variables.tf","path":"modules/vpc-peering-external/variables.tf","sha":"b7a9760c9a22524b8452e83d68495b31e3af18dc"}]},{"name":"vpc-peering","children":[{"name":"README.md","path":"modules/vpc-peering/README.md","sha":"5f10e61c54fd9e175d18f4fdf5f8ae0ae8217d47"},{"name":"main.tf","path":"modules/vpc-peering/main.tf","sha":"a7724afe8b6265e703e055c129f5c44eebe3f771"},{"name":"variables.tf","path":"modules/vpc-peering/variables.tf","sha":"60502cffac1867fa48a5f68ef6ef0aa566cef21e"}]}],"toggled":true},{"name":"terraform-cloud-enterprise-private-module-registry-placeholder.tf","path":"terraform-cloud-enterprise-private-module-registry-placeholder.tf","sha":"ae586c0fe830819580e1009d41a9074f16e65bed"},{"name":"test","children":[{"name":"README.md","path":"test/README.md","sha":"ef26d3851db2fff0b36dfa61379724c0db9ff281"},{"name":"go.mod","path":"test/go.mod","sha":"6fe89f241eca6158c2a618b8e2c52a1dd2d0125e"},{"name":"go.sum","path":"test/go.sum","sha":"5ec0753ebc4cfa821c45221da7d7b2a1621c6735"},{"name":"test_helpers.go","path":"test/test_helpers.go","sha":"fed9f8f85573d3385fca72f8ec562b84b6df71d2"},{"name":"validation","children":[{"name":"validate_all_modules_and_examples_test.go","path":"test/validation/validate_all_modules_and_examples_test.go","sha":"74c928d0cbc2914e5cd708277bd857cb2375b660"}]},{"name":"vpc_app_custom_az_id_test.go","path":"test/vpc_app_custom_az_id_test.go","sha":"fb0c00c72a9828a4c68c64c274b33b64063758ef"},{"name":"vpc_app_no_nat_gateway_test.go","path":"test/vpc_app_no_nat_gateway_test.go","sha":"c23d6186a6ebb7de534c9dcc73f74a8e278cf4c2"},{"name":"vpc_app_route_tables_public_subnet_test.go","path":"test/vpc_app_route_tables_public_subnet_test.go","sha":"7384441e4bd9fecd1cc40fa4c1f4deead3a4bca4"},{"name":"vpc_app_subnets_disabled_test.go","path":"test/vpc_app_subnets_disabled_test.go","sha":"09d13233dec81215f8e92645ec9ffadc43aa0f6a"},{"name":"vpc_app_test.go","path":"test/vpc_app_test.go","sha":"1bf684982358dbf7b0f484c8e06577bc391f48e7"},{"name":"vpc_app_with_endpoint_test.go","path":"test/vpc_app_with_endpoint_test.go","sha":"7d0308586c09b36ff78fce285c765cb340a78e02"},{"name":"vpc_app_with_inbound_network_test.go","path":"test/vpc_app_with_inbound_network_test.go","sha":"13b78ced82ed45618e5b74399f19e3a79a2d9322"},{"name":"vpc_custom_cidr_blocks_test.go","path":"test/vpc_custom_cidr_blocks_test.go","sha":"056710e3d1fc6d6affc28f23caef27cac9042519"},{"name":"vpc_flow_logs_test.go","path":"test/vpc_flow_logs_test.go","sha":"c7462ba92c39088663fafb522ddbf4117355c490"},{"name":"vpc_mgmt_no_nat_gateway_test.go","path":"test/vpc_mgmt_no_nat_gateway_test.go","sha":"98a5b6189e3651267f7038f906deaa0304fcc699"},{"name":"vpc_mgmt_test.go","path":"test/vpc_mgmt_test.go","sha":"4df8061bd0de902e3ef3d1ff56e4e32758fb8ad8"},{"name":"vpc_network_acls_test.go","path":"test/vpc_network_acls_test.go","sha":"5ed930679340c81ea7549b0a26e94566e18ce660"},{"name":"vpc_peering_cross_accounts_test.go","path":"test/vpc_peering_cross_accounts_test.go","sha":"8b1b13de36acd9dc77fa28c2a2daeacb383ee7c5"},{"name":"vpc_peering_external_test.go","path":"test/vpc_peering_external_test.go","sha":"2ce81263d16d2b5f7387993404bea2849ca60698"},{"name":"vpc_peering_test.go","path":"test/vpc_peering_test.go","sha":"fde78ff0e98bfcd42213e5e44d4d2913458ed59c"}]}]},"detailsContent":"<h1 class=\"preview__body--title\" id=\"vpc-app-network-ac-ls-terraform-module\">VPC-App Network ACLs Terraform Module</h1><div class=\"preview__body--border\"></div><p>This Terraform Module adds a default set of <a href=\"http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html\" class=\"preview__body--description--blue\" target=\"_blank\">Network\nACLs</a> to a VPC created using the\n<a href=\"/repos/v0.18.11/terraform-aws-vpc/modules/vpc-app\" class=\"preview__body--description--blue\">vpc-app</a> module. The ACLs enforce the following security settings (based on <a href=\"https://www.whaletech.co/2014/10/02/reference-vpc-architecture.html\" class=\"preview__body--description--blue\" target=\"_blank\">A Reference VPC\nArchitecture</a>):</p>\n<ul>\n<li><strong>Public subnet</strong>: Allow all requests.</li>\n<li><strong>Private app subnet</strong>: Allow all requests to/from the public subnets, private persistence subnets, and the Mgmt VPC.\nAllow all outbound TCP requests plus return traffic from any IP for those TCP requests on <a href=\"http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html#VPC_ACLs_Ephemeral_Ports\" class=\"preview__body--description--blue\" target=\"_blank\">ephemeral\nports</a>.</li>\n<li><strong>Private persistence subnet</strong>: Allow all requests to/from the private app subnets and the Mgmt VPC.</li>\n</ul>\n<h2 class=\"preview__body--subtitle\" id=\"how-do-you-use-this-module\">How do you use this module?</h2>\n<p>Check out the <a href=\"/repos/v0.18.11/terraform-aws-vpc/examples/vpc-network-acls\" class=\"preview__body--description--blue\">vpc-network-acls example</a>.</p>\n<p>Check out <a href=\"/repos/v0.18.11/terraform-aws-vpc/modules/vpc-app-network-acls/variables.tf\" class=\"preview__body--description--blue\">variables.tf</a> for all the configuration options available.</p>\n<h2 class=\"preview__body--subtitle\" id=\"whats-a-vpc\">What's a VPC?</h2>\n<p>A <a href=\"https://aws.amazon.com/vpc/\" class=\"preview__body--description--blue\" target=\"_blank\">VPC</a> or Virtual Private Cloud is a logically isolated section of your AWS cloud. Each\nVPC defines a virtual network within which you run your AWS resources, as well as rules for what can go in and out of\nthat network. This includes subnets, route tables that tell those subnets how to route inbound and outbound traffic,\nsecurity groups, access controls lists for the network (NACLs), and any other network components such as VPN connections.</p>\n<h2 class=\"preview__body--subtitle\" id=\"whats-a-network-acl\">What's a Network ACL?</h2>\n<p><a href=\"http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html\" class=\"preview__body--description--blue\" target=\"_blank\">Network ACLs</a> provide an extra layer of network\nsecurity, similar to a <a href=\"http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html\" class=\"preview__body--description--blue\" target=\"_blank\">security group</a>.\nWhereas a security group controls what inbound and outbound traffic is allowed for a specific resource (e.g. a single\nEC2 instance), a network ACL controls what inbound and outbound traffic is allowed for an entire subnet.</p>\n<h2 class=\"preview__body--subtitle\" id=\"how-do-i-configure-the-network-ac-ls-for-public-elb-access\">How do I configure the Network ACLs for public ELB access?</h2>\n<p>The recommended configuration for public Elastic Load Balancers is to deploy the public facing ELB (Application Load\nBalancer/ALB or Network Load Balancer/NLB) in the public subnet tier, and the applications in the private app subnet\ntier. For the most part, the Network ACLs configured in this module should be sufficient for exposing access to the\nprivate services through the public ELB.</p>\n<p>However, for NLBs, the default network ACLs in the module would restrict access to the private services routed from the\nNLB if the application is listening on a privileged port (port numbers less than 1024, e.g. HTTP port 80). This is\nbecause unlike ALBs, NLBs do not do address translation, and thus the VPC firewalls end up seeing the client IP address\ninstead of the NLB IP address. This triggers the firewall rules in the network ACLs that will block access to the\nprivate service in the private app subnet, as the traffic will not appear to come from the public subnet tier.</p>\n<p>To ensure the NLB traffic can make it to the private service, you must expose access to the privileged port from the\nclient IP address in the network ACL rules. To do this, you can use the <code>private_app_allow_inbound_ports_from_cidr</code>\ninput variable. For example, to allow access to a service listening on port 443 (HTTPS):</p>\n<pre><span class=\"hljs-keyword\">module</span> <span class=\"hljs-string\">\"network_acls\"</span> {\n <span class=\"hljs-comment\"># other arguments omitted for brevity</span>\n\n private_app_allow_inbound_ports_from_cidr = {\n AllowAnyPublicHTTP = {\n client_cidr_block = <span class=\"hljs-string\">\"0.0.0.0/0\"</span>\n protocol = <span class=\"hljs-string\">\"tcp\"</span>\n from_port = <span class=\"hljs-number\">443</span>\n to_port = <span class=\"hljs-number\">443</span>\n icmp_type = null\n icmp_code = null \n\n <span class=\"hljs-comment\"># We pick rule number 99 to ensure it has the highest priority.</span>\n rule_number = <span class=\"hljs-number\">99</span>\n }\n }\n}\n</pre>\n","repoName":"terraform-aws-vpc","repoRef":"v0.20.0","serviceDescriptor":{"serviceName":"Virtual Private Cloud (VPC)","serviceRepoName":"terraform-aws-vpc","serviceRepoOrg":"gruntwork-io","cloudProviders":["aws"],"description":"Create a Virtual Private Cloud (VPC). Includes multiple subnet tiers, NACLs, NAT gateways, Internet Gateways, and VPC peering.","imageUrl":"vpc.png","licenseType":"subscriber","technologies":["Terraform"],"compliance":[],"tags":[""]},"serviceCategoryName":"Networking","fileName":"README.md","filePath":"/modules/vpc-app-network-acls","title":"Repo Browser: Virtual Private Cloud (VPC)","description":"Browse the repos in the Gruntwork Infrastructure as Code Library."}