Skip to content

BreakingPitt/terraform-packer-vpc-module

Repository files navigation

Terraform AWS VPC Module

This Terraform module creates an AWS Virtual Private Cloud (VPC) that can be used in conjunction with the Packer AMI builder to create Amazon Machine Images (AMIs). The VPC includes essential resources like an Internet Gateway and subnets.

Table of Contents

Prerequisites

Before using this Terraform module, ensure you have the following prerequisites:

  • Terraform installed (version >= 1.5.2)
  • AWS credentials configured for your environment
  • Basic understanding of AWS networking concepts

Usage

To use this module, include it in your Terraform configuration. Here's an example of how to use it:

module "vpc" {
  source = "github.com/your-org/terraform-aws-vpc"

  # Customize input variables as needed
  cidr_block       = "10.0.1.0/16"
  enable_flow_log  = false
  name            = "packer"
  namespace       = "Engine9.io"
  stage           = "dev"
  traffic_type    = "ALL"
}

Requirements

Name Version
terraform ~> 1.5.2
aws ~> 5.6.2
http ~> 3.4.0
random ~> 3.5.1
time ~> 0.9.1
tls ~> 4.0.4

Providers

Name Version
aws 5.6.2
time 0.9.1

Modules

Name Source Version
label cloudposse/label/terraform 0.8.0

Resources

Name Type
aws_flow_log.vpc_flow_log resource
aws_internet_gateway.default resource
aws_route_table.default resource
aws_route_table_association.default resource
aws_subnet.default resource
aws_vpc.default resource
time_static.default resource
aws_availability_zones.default data source

Inputs

Name Description Type Default Required
cidr_block The IP prefix to the CIDR block assigned to the VPC string "10.0.1.0" no
enable Flag to control the VPC creation. bool true no
enable_flow_log Enable VPC flow logs. bool false no
name The VPC name. string "packer" no
namespace The namespace can be your organization name or abbreviation. string "Engine9.io" no
s3_bucket_arn ARN of the S3 Bucket used to store the VPC flow logs. string "" no
stage The stage, e.g. 'prod', 'staging', 'dev' string "" no
traffic_type Type of traffic to capture. Valid values: ACCEPT, REJECT, ALL. string "ALL" no

Outputs

Name Description
internet_gateway_id The Id of the Internet Gateway.
subnet_id Subnet Id
vpc_cidr_block The CIDR block of the VPC.
vpc_id VPC Id

Examples

You can find more usage examples in the examples directory.

Contributing

Contributions to enhance and expand the lab with new vulnerability scenarios and mitigations are welcome! Please follow ethical guidelines and ensure the examples provided are solely intended for educational purposes.

License

The content in this repository is licensed under the MIT License.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Authors

About

Terraform module to create a Packer's build vpc

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages