Git Product home page Git Product logo

ryanoatz99 / terraform-alicloud-network-with-nat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from terraform-alicloud-modules/terraform-alicloud-network-with-nat

0.0 0.0 0.0 20 KB

Terraform Module for building a VPC and Nat gateway network environment on Alibaba Cloud.

Home Page: https://registry.terraform.io/modules/terraform-alicloud-modules/network-with-nat/alicloud

License: Apache License 2.0

HCL 100.00%

terraform-alicloud-network-with-nat's Introduction

Terraform Module for building a VPC and Nat gateway network environment on Alibaba Cloud. terraform-alicloud-network-and-nat

English | 简体中文

Terraform Module for building a VPC and Nat gateway network environment on Alibaba Cloud and bind EIP, add SNAT and DNAT.

These types of resources are supported:

Usage

// Create VPC and nat gateway
module "vpc-nat" {
  source     = "terraform-alicloud-modules/network-with-nat/alicloud"

  create_vpc = true
  vpc_name   = "my-env-vpc"
  vpc_cidr   = "10.10.0.0/16"

  availability_zones = ["cn-hangzhou-e", "cn-hangzhou-f", "cn-hangzhou-g"]
  vswitch_cidrs      = ["10.10.1.0/24", "10.10.2.0/24", "10.10.3.0/24"]

  vpc_tags = {
    Owner       = "user"
    Environment = "staging"
    Name        = "complete"
  }

  vswitch_tags = {
    Project  = "Secret"
    Endpoint = "true"
  }

  // common bandwidth package
  cbp_bandwidth = 10
  cbp_ratio     = 100

  // nat_gateway
  create_nat = true
  nat_name   = "nat-gateway-foo"

  // eip
  create_eip = true
  eip_name   = "eip-nat-foo"

  // create eip, snat and bind eip with vswitch_cidrs
  create_snat        = true
  number_of_snat_eip = 3

  // create eip, snat and bind eip with instance
  create_dnat        = true
  number_of_dnat_eip = 1
  dnat_entries = [
    {
      name          = "dnat-443-8443"
      ip_protocol   = "tcp"
      external_port = "443"
      internal_port = "8443"
      internal_ip   = "10.10.1.24"
    }
  ]
}

Examples

Notes

From the version v1.1.0, the module has removed the following provider setting:

provider "alicloud" {
  profile                 = var.profile != "" ? var.profile : null
  shared_credentials_file = var.shared_credentials_file != "" ? var.shared_credentials_file : null
  region                  = var.region != "" ? var.region : null
  skip_region_validation  = var.skip_region_validation
  configuration_source    = "terraform-alicloud-modules/network-with-nat"
}

If you still want to use the provider setting to apply this module, you can specify a supported version, like 1.0.0:

module "vpc-nat" {
  source  = "terraform-alicloud-modules/network-with-nat/alicloud"
  version     = "1.0.0"
  region      = "cn-hangzhou"
  profile     = "Your-Profile-Name"
  create_vpc = true
  vpc_name   = "my-env-vpc"
  // ...
}

If you want to upgrade the module to 1.1.0 or higher in-place, you can define a provider which same region with previous region:

provider "alicloud" {
  region  = "cn-hangzhou"
  profile = "Your-Profile-Name"
}
module "vpc-nat" {
  source  = "terraform-alicloud-modules/network-with-nat/alicloud"
  create_vpc = true
  vpc_name   = "my-env-vpc"
  // ...
}

or specify an alias provider with a defined region to the module using providers:

provider "alicloud" {
  region  = "cn-hangzhou"
  profile = "Your-Profile-Name"
  alias   = "hz"
}
module "vpc-nat" {
  source  = "terraform-alicloud-modules/network-with-nat/alicloud"
  providers = {
    alicloud = alicloud.hz
  }
  create_vpc = true
  vpc_name   = "my-env-vpc"
  // ...
}

and then run terraform init and terraform apply to make the defined provider effect to the existing module state.

More details see How to use provider in the module

Submit Issues

If you have any problems when using this module, please opening a provider issue and let us know.

Note: There does not recommend to open an issue on this repo.

Authors

Created and maintained by Zhou qilin([email protected]), He Guimin(@xiaozhu36, [email protected]).

License

Apache 2 Licensed. See LICENSE for full details.

Reference

terraform-alicloud-network-with-nat's People

Contributors

mrwolong avatar xiaozhu36 avatar zql-tqy 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.