Giter Site home page Giter Site logo

terraform-aws-vpc's Introduction

terraform-aws-vpc

Lint Status LICENSE

This module creates the basic and advance network resources for a region.

The following resources will be created:

  • Virtual Private Cloud (VPC)
  • VPC Flow Logs
  • AWS Cloudwatch log groups
  • Subnets
    • Public
    • Private
    • Database
  • Internet Gateway
  • Nat Gateway
  • Route tables for the Public, Private, Database subnets
  • Associate all Route Tables created to the correct subnet
  • Database Subnet group - Provides an RDS DB subnet group resources without Internet
  • Adding routes in Route Table for VPC Peering

Usages

module "vpc_main" {
  source      = "git::https://github.com/tothenew/terraform-aws-vpc.git?ref=v0.2.0"
  cidr_block  = "10.1.0.0/16"
  subnet_bits = 8
}

Requirements

Name Version
terraform >= 1.3.0

Providers

Name Version
aws n/a

Modules

Name Source Version
subnet_advance ./modules/subnets-module-advance n/a
subnet_simple ./modules/subnets-module-simple n/a
vpc_endpoint git::https://github.com/tothenew/terraform-aws-vpc-endpoint.git v0.1.0
vpc_main ./modules/vpc n/a

Resources

Name Type
aws_cloudwatch_log_group.flow_log resource
aws_flow_log.flow_log resource
aws_iam_policy.vpc_flow_log_cloudwatch resource
aws_iam_role.vpc_flow_log_cloudwatch resource
aws_iam_role_policy_attachment.vpc_flow_log_cloudwatch resource
aws_vpc_ipv4_cidr_block_association.secondary_cidr_blocks resource
aws_availability_zones.available data source
aws_iam_policy_document.flow_log_cloudwatch_assume_role data source
aws_iam_policy_document.vpc_flow_log_cloudwatch data source
aws_region.current data source

Inputs

Name Description Type Default Required
additional_subnet_group Subnet details having zone and cidr address
map(object({
is_public = bool
nat_gateway = bool
details = list(object({
availability_zone = string
cidr_address = string
}))
}))
{} no
cidr_block IPV4 range for VPC Creation string "10.20.0.0/20" no
common_tags A map to add common tags to all the resources map(string) {} no
create_peering_routes True/False value need to create Peering Route or not, Default to false bool false no
create_vpc_endpoint Create all VPC Endpoint bool false no
default_tags A map to add common tags to all the resources map(string)
{
"CreatedBy": "Terraform",
"Scope": "VPC"
}
no
enable_dns_hostnames A boolean flag to enable/disable DNS hostnames in the VPC bool true no
enable_dns_support A boolean flag to enable/disable DNS support in the VPC bool true no
enable_flow_log Whether or not to enable VPC Flow Logs bool false no
flow_log_cloudwatch_log_group_retention_in_days Specifies the number of days you want to retain log events in the specified log group for VPC flow logs. number 7 no
flow_log_destination_type Type of flow log destination. Can be s3 or cloud-watch-logs. string "cloud-watch-logs" no
flow_log_log_format The fields to include in the flow log record, in the order in which they should appear. string null no
flow_log_max_aggregation_interval The maximum interval of time during which a flow of packets is captured and aggregated into a flow log record. Valid Values: 60 seconds or 600 seconds. number 600 no
flow_log_traffic_type The type of traffic to capture. Valid values: ACCEPT, REJECT, ALL. string "ALL" no
max_subnet_az Maximum number of Subnets per Availability Zone number 2 no
name A string value to describe prefix of all the resources string "" no
routes Route details having destination and target address
map(object({
peering = map(string)
}))
{} no
secondary_cidr_blocks List of secondary CIDR blocks to associate with the VPC to extend the IP Address pool list(string) [] no
subnet Subnet details having zone and cidr address
map(object({
is_public = bool
nat_gateway = bool
details = list(object({
availability_zone = string
cidr_address = string
}))
}))
{} no
subnet_bits Number Bits required for creating Subnets number 8 no
subnet_group Subnets group divided into public, private and database
map(object({
is_public = bool
nat_gateway = bool
}))
{
"database": {
"is_public": false,
"nat_gateway": false
},
"private": {
"is_public": false,
"nat_gateway": true
},
"public": {
"is_public": true,
"nat_gateway": false
}
}
no

Outputs

Name Description
eip_id n/a
internet_gateway_id n/a
route_table_id n/a
subnet_cidr n/a
subnet_details_cidr n/a
subnet_details_id n/a
subnet_ids n/a
vpc_cidr n/a
vpc_id n/a

Authors

Module managed by TO THE NEW Pvt. Ltd.

License

Apache 2 Licensed. See LICENSE for full details.

terraform-aws-vpc's People

Contributors

prashantguptattn avatar abhishekchauhan98 avatar prashantgupta123 avatar harkeshkumar avatar abhishek-ttn avatar github-actions[bot] avatar rahulttn avatar onlykumarabhishek avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.