Skip to content

Terraform/OpenTofu module which simplifies the process of discovering AWS networking data for Northwood Labs resources.

License

Notifications You must be signed in to change notification settings

northwood-labs/mod-aws-networking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Seal of ApprovalSeal of Approval

AWS Networking

AWS Terraform OpenTofu Golang Node.js

Simplifies the process of discovering AWS networking data for Northwood Labs resources.

Information Description
Terraform Versions 1.6, 1.7, 1.8
OpenTofu Versions 1.6, 1.7

Features

  • Designed to be highly composable, and has no hard-dependencies on other modules.

  • Integration tests run automatically on every commit against supported versions of Terraform/OpenTofu.

  • Outputs can be easily used with other modules which need network identifiers for VPCs and Subnets.

  • Only looks-up data, but does not persist any data itself, making it completely stateless.

  • Purpose-built, meaning that it is designed to solve a single orthogonal problem. Aims to fit 90% of use-cases.

Examples

More examples can be found in the ./examples directory.

# Load the module
module "aws_networking" {
  source = "https://github.com/northwood-labs/mod-aws-networking.git?ref={tag}"
}

resource "aws_lambda_function" "test_lambda" {
  function_name = var.lambda_function_name
  # other configuration...

  vpc_config {
    subnet_ids = module.aws_networking.subnet_ids
  }
}

Requirements

Name Provider Version
terraform ~> 1.6
aws hashicorp/aws ~> 5.42

Inputs

Req Variable Type Description Default

Outputs

Name Description
internet_gateway An object containing all data for this internet gateway.
internet_gateway_arn The ARN of this internet gateway.
internet_gateway_id The ID of this internet gateway.
nacl An object containing all data for this Network Access Control List (NACL).
nacl_ids List of all Network Access Control List (NACL) IDs in the VPC.
route_table An object containing all data for this route table.
route_table_arn The ARN of this route table.
route_table_id The ID of this route table.
subnet_ids List of all Subnet IDs in the VPC.
subnet_int_a An object containing all data for subnet A.
subnet_int_a_arn The ARN of subnet A.
subnet_int_a_cidr The Availability Zone CIDR block of subnet A.
subnet_int_a_id The ID of subnet A.
subnet_int_a_zone The Availability Zone of subnet A.
subnet_int_a_zone_id The Availability Zone ID of subnet A.
subnet_int_b An object containing all data for subnet B.
subnet_int_b_arn The ARN of subnet B.
subnet_int_b_cidr The Availability Zone CIDR block of subnet B.
subnet_int_b_id The ID of subnet B.
subnet_int_b_zone The Availability Zone of subnet B.
subnet_int_b_zone_id The Availability Zone ID of subnet B.
subnet_int_c An object containing all data for subnet C.
subnet_int_c_arn The ARN of subnet C.
subnet_int_c_cidr The Availability Zone CIDR block of subnet C.
subnet_int_c_id The ID of subnet C.
subnet_int_c_zone The Availability Zone of subnet C.
subnet_int_c_zone_id The Availability Zone ID of subnet C.
vpc An object containing all VPC data.
vpc_arn The ARN of the VPC in this account.
vpc_cidr The CIDR of the VPC in this account.
vpc_id The ID of the VPC in this account.

Resources

Kind Source Name Provider
data source data.aws_caller_identity current hashicorp/aws
data source data.aws_internet_gateway igw hashicorp/aws
data source data.aws_network_acls nacl hashicorp/aws
data source data.aws_region current hashicorp/aws
data source data.aws_route_table route_table hashicorp/aws
data source data.aws_subnet subnet_int_a hashicorp/aws
data source data.aws_subnet subnet_int_b hashicorp/aws
data source data.aws_subnet subnet_int_c hashicorp/aws
data source data.aws_subnets subnets hashicorp/aws
data source data.aws_vpc vpc hashicorp/aws

Testing

For integration tests, we use the Terratest testing framework. All of the building and testing dependencies are bundled-up as a Docker image, so see northwood-labs/dev-env before running these tests.

These tests create real resources, which cost real money.

make test

About

Terraform/OpenTofu module which simplifies the process of discovering AWS networking data for Northwood Labs resources.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Contributors 4

  •  
  •  
  •  
  •