Skip to content

thalassa-cloud/terraform-thalassa-vpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform Module for Thalassa Cloud VPC

This Terraform module creates a VPC (Virtual Private Cloud) infrastructure in Thalassa Cloud with support for public and private (no internet access) subnets, NAT Gateway, and route tables. It provides a flexible networking foundation for your cloud resources.

Features

  • Create a VPC with customizable CIDR blocks
  • Deploy subnets with stretched network architecture
  • Optional NAT Gateway deployment
  • Configurable route tables for subnets
  • Support for custom labels and descriptions

Usage

module "vpc" {
  source = "thalassa-cloud/vpc/thalassa"

  name             = "my-vpc"
  description      = "Production VPC for my application"
  organisation_id  = "org-123456"
  region          = "nl-01"
  
  vpc_cidrs = ["10.0.0.0/16"]

  public_subnets = {
    public-1 = {
      cidr        = "10.0.1.0/24"
      description = "Public subnet"
      labels = {
        environment = "production"
        tier       = "public"
      }
    }
  }

  private_subnets = {
    private-1 = {
      cidr        = "10.0.2.0/24"
      description = "Private subnet"
      labels = {
        environment = "production"
        tier       = "private"
      }
    }
  }

  enable_nat_gateway = true
  labels = {
    environment = "production"
    managed-by  = "terraform"
  }
}

Requirements

The following requirements are needed by this module:

Providers

The following providers are used by this module:

Modules

No modules.

Resources

The following resources are used by this module:

Required Inputs

The following input variables are required:

Description: The description of the VPC

Type: string

Description: The name of the VPC

Type: string

Description: The ID of the organisation to create the resources in. If not provided, the organisation set in the provider will be used.

Type: string

Description: n/a

Type: any

Description: n/a

Type: any

Optional Inputs

The following input variables are optional (have default values):

Description: Whether to deploy a NAT Gateway in the VPC

Type: bool

Default: false

Description: The labels to apply to the VPC

Type: map(string)

Default: {}

Description: The private subnets to create in the VPC. Private Subnets have no access to the internet.

Type:

map(object({
    cidr        = string
    description = optional(string)
    labels      = optional(map(string))
  }))

Default: {}

Description: The public subnets to create in the VPC. Public Subnets have access to the internet through a NAT Gateway.

Type:

map(object({
    cidr               = string
    description        = optional(string)
    enable_nat_gateway = optional(bool)
    labels             = optional(map(string))
  }))

Default: {}

Description: The region to create the VPC resources in

Type: string

Default: "nl-01"

Description: The CIDRs to create the VPC with

Type: list(string)

Default:

[
  "10.0.0.0/16"
]

Outputs

The following outputs are exported:

Description: Map of NAT gateway endpoint IPs by subnet key

Description: Map of NAT gateway slugs by subnet key

Description: Map of NAT gateway IPv4 addresses by subnet key

Description: Map of NAT gateway IPv6 addresses by subnet key

Description: Map of private subnet IDs by subnet key

Description: Map of private subnet slugs by subnet key

Description: Map of public subnet IDs by subnet key

Description: Map of public subnet slugs by subnet key

Description: Map of route table IDs by subnet key and type

Description: Map of all subnet slugs by subnet key and type

Description: The CIDR blocks of the VPC

Description: The ID of the VPC

Description: The slug of the VPC

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This module is released under the MIT License.

About

Thalassa Cloud Terraform Module for provisioning a VPC and related networking components

Topics

Resources

License

Stars

Watchers

Forks

Languages