Git Product home page Git Product logo

terraform-alicloud-private-zone's Introduction

Terraform module which create Private Zone on Alibaba Cloud.
terraform-alicloud-private-zone

English | 简体中文

Terraform module which creates Private Zone resources on Alibaba Cloud, add records and attach VPC.

These types of resources are supported:

Usage

Create a Private Zone.

Create a Private Zone without any record and VPC.

module "pvtz" {
  source      = "terraform-alicloud-modules/private-zone/alicloud"
  zone_name   = "pvtz.com"
}

Create a Private Zone and add records.

module "pvtz" {
  source      = "terraform-alicloud-modules/private-zone/alicloud"
  zone_name   = "pvtz.com"
  records = [
    {
      rr       = "aaa"
      type     = "A"
      ttl      = 600
      value    = "223.5.5.5"
      priority = 1
    },
    {
      rr       = "bbb"
      type     = "MX"
      ttl      = 600
      value    = "mx.aliyun.com"
      priority = 1
    }
  ]
}

Create a Private Zone, add records and attach VPC.

module "pvtz" {
  source      = "terraform-alicloud-modules/private-zone/alicloud"
  zone_name   = "pvtz.com"
  vpc_ids     = ["vpc-uf61gzxodh2w60l9n****"]
  records = [
    {
      rr       = "aaa"
      type     = "A"
      ttl      = 600
      value    = "223.5.5.5"
      priority = 1
    },
    {
      rr       = "bbb"
      type     = "MX"
      ttl      = 600
      value    = "mx.aliyun.com"
      priority = 1
    }
  ]
}

Examples

Notes

From the version v1.4.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/private-zone"
}

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

module "pvtz" {
  source    = "terraform-alicloud-modules/private-zone/alicloud"
  version   = "1.3.0"
  region    = "cn-beijing"
  profile   = "Your-Profile-Name"
  zone_name = "pvtz.com"
  // ...
}

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

provider "alicloud" {
  region  = "cn-beijing"
  profile = "Your-Profile-Name"
}
module "pvtz" {
  source    = "terraform-alicloud-modules/private-zone/alicloud"
  zone_name = "pvtz.com"
  // ...
}

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

provider "alicloud" {
  region  = "cn-beijing"
  profile = "Your-Profile-Name"
  alias   = "bj"
}
module "pvtz" {
  source    = "terraform-alicloud-modules/private-zone/alicloud"
  providers = {
    alicloud = alicloud.bj
  }
  zone_name = "pvtz.com"
  // ...
}

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

Terraform versions

Name Version
terraform >= 0.12.0
alicloud >= 1.62.1

Authors

Created and maintained by Alibaba Cloud Terraform Team([email protected])

License

Apache 2 Licensed. See LICENSE for full details.

Reference

terraform-alicloud-private-zone'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.