Terraform module which creates Private Zone resources on Alibaba Cloud.
These types of resources are supported:
Root module calls these modules which can also be used separately to create independent resources:
- attachment - attach zone id and vpc id
- zone - creates zone
- record - creates records
- record_list means multiple record
NOTE
:
- Domain (record) need follow RFC.
You can use this in your terraform template with the following steps.
-
Adding a module resource to your template, e.g. main.tf
module "pvtz" { source = "terraform-alicloud-modules/private-zone/alicloud" domain_name = "pvtz.com" vpc_id_list = ["${module.vpc.vpc_id}"] need_attachment = true record_list = [ { name = "www" type = "A" ttl = 600 value = "223.5.5.5" priority = 1 }, { name = "www" type = "MX" ttl = 600 value = "mx.aliyun.com" priority = 1 }, { name = "cname" type = "CNAME" ttl = 600 value = "mx.aliyun.com" priority = 1 } ] } module "vpc" { source = "alibaba/vpc/alicloud" vpc_name = "testVpc" vpc_cidr = "192.168.0.0/16" vpc_description = "pvtz test vpc" }
-
Setting values for the following variables through environment variables:
- ALICLOUD_ACCESS_KEY
- ALICLOUD_SECRET_KEY
- ALICLOUD_REGION
Name | Description | Type | Default | Required |
---|---|---|---|---|
domain_name | domain name which you want to add | list | - | yes |
record_list | record list | list | - | yes |
vpc_id_list | the vpc id list what you want to attached | list | - | no |
need_attachment | attachment switch | bool | false | no |
Name | Description |
---|---|
this_domain_name | domain name |
this_records | record info list |
Created and maintained by Zeng Yichen(@microdustor [email protected])