Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
infrastructure
提交
fdcd204e
I
infrastructure
项目概览
openeuler
/
infrastructure
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
infrastructure
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fdcd204e
编写于
10月 09, 2019
作者:
I
imjoey
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Format tf config files to a cannonical format
Signed-off-by:
N
imjoey
<
majunjiev@gmail.com
>
上级
4184ca2d
变更
22
隐藏空白更改
内联
并排
Showing
22 changed file
with
155 addition
and
155 deletion
+155
-155
environment/huaweicloud/cce/cluster.tf
environment/huaweicloud/cce/cluster.tf
+25
-25
environment/huaweicloud/cce/out_puts.tf
environment/huaweicloud/cce/out_puts.tf
+6
-6
environment/huaweicloud/cce/vars.tf
environment/huaweicloud/cce/vars.tf
+1
-1
environment/huaweicloud/dns/dns_template.tf
environment/huaweicloud/dns/dns_template.tf
+4
-4
environment/huaweicloud/dns/dns_vars.tf
environment/huaweicloud/dns/dns_vars.tf
+7
-7
environment/huaweicloud/elb/elb.tf
environment/huaweicloud/elb/elb.tf
+1
-1
environment/huaweicloud/elb/out_puts.tf
environment/huaweicloud/elb/out_puts.tf
+2
-2
environment/huaweicloud/elb/vars.tf
environment/huaweicloud/elb/vars.tf
+1
-1
environment/huaweicloud/internet/internet_temp.tf
environment/huaweicloud/internet/internet_temp.tf
+5
-5
environment/huaweicloud/internet/internet_vars.tf
environment/huaweicloud/internet/internet_vars.tf
+3
-3
environment/huaweicloud/internet/out_puts.tf
environment/huaweicloud/internet/out_puts.tf
+3
-3
environment/huaweicloud/nat/nat_template.tf
environment/huaweicloud/nat/nat_template.tf
+1
-1
environment/huaweicloud/nat/nat_vars.tf
environment/huaweicloud/nat/nat_vars.tf
+1
-1
environment/huaweicloud/network/network_output.tf
environment/huaweicloud/network/network_output.tf
+3
-3
environment/huaweicloud/network/network_template.tf
environment/huaweicloud/network/network_template.tf
+2
-2
environment/huaweicloud/network/network_vars.tf
environment/huaweicloud/network/network_vars.tf
+1
-1
environment/huaweicloud/output.tf
environment/huaweicloud/output.tf
+10
-10
environment/huaweicloud/resources.tf
environment/huaweicloud/resources.tf
+56
-56
environment/huaweicloud/sg/output.tf
environment/huaweicloud/sg/output.tf
+2
-2
environment/huaweicloud/sg/sg_template.tf
environment/huaweicloud/sg/sg_template.tf
+3
-3
environment/huaweicloud/sg/vars.tf
environment/huaweicloud/sg/vars.tf
+1
-1
environment/huaweicloud/vars.tf
environment/huaweicloud/vars.tf
+17
-17
未找到文件。
environment/huaweicloud/cce/cluster.tf
浏览文件 @
fdcd204e
resource
"huaweicloud_cce_cluster_v3"
"this"
{
name
=
"
${
var
.
name
}
"
cluster_type
=
"VirtualMachine"
flavor_id
=
"
${
var
.
flavor_id
}
"
vpc_id
=
"
${
var
.
vpc_id
}
"
subnet_id
=
"
${
var
.
subnet_id
}
"
container_network_type
=
"overlay_l2"
authentication_mode
=
"rbac"
description
=
"
${
var
.
description
}
"
name
=
"
${
var
.
name
}
"
cluster_type
=
"VirtualMachine"
flavor_id
=
"
${
var
.
flavor_id
}
"
vpc_id
=
"
${
var
.
vpc_id
}
"
subnet_id
=
"
${
var
.
subnet_id
}
"
container_network_type
=
"overlay_l2"
authentication_mode
=
"rbac"
description
=
"
${
var
.
description
}
"
}
resource
"huaweicloud_cce_node_v3"
"this"
{
count
=
"
${
length
(
var
.
nodes
)
}
"
cluster_id
=
"
${
join
(
""
,
huaweicloud_cce_cluster_v3
.
this
.
*
.
id
)
}
"
name
=
"
${
lookup
(
var
.
nodes
[
count
.
index
],
"name"
)
}
"
flavor_id
=
"
${
lookup
(
var
.
nodes
[
count
.
index
],
"flavor_id"
)
}
"
iptype
=
"5_bgp"
availability_zone
=
"
${
lookup
(
var
.
nodes
[
count
.
index
],
"az"
)
}
"
key_pair
=
"
${
lookup
(
var
.
nodes
[
count
.
index
],
"ssh_key"
)
}
"
root_volume
{
size
=
40
volumetype
=
"SATA"
}
sharetype
=
"PER"
bandwidth_size
=
100
data_volumes
{
size
=
100
volumetype
=
"SATA"
}
count
=
"
${
length
(
var
.
nodes
)
}
"
cluster_id
=
"
${
join
(
""
,
huaweicloud_cce_cluster_v3
.
this
.
*
.
id
)
}
"
name
=
"
${
lookup
(
var
.
nodes
[
count
.
index
],
"name"
)
}
"
flavor_id
=
"
${
lookup
(
var
.
nodes
[
count
.
index
],
"flavor_id"
)
}
"
iptype
=
"5_bgp"
availability_zone
=
"
${
lookup
(
var
.
nodes
[
count
.
index
],
"az"
)
}
"
key_pair
=
"
${
lookup
(
var
.
nodes
[
count
.
index
],
"ssh_key"
)
}
"
root_volume
{
size
=
40
volumetype
=
"SATA"
}
sharetype
=
"PER"
bandwidth_size
=
100
data_volumes
{
size
=
100
volumetype
=
"SATA"
}
}
environment/huaweicloud/cce/out_puts.tf
浏览文件 @
fdcd204e
output
"clusters_1"
{
description
=
"The first cluster information"
value
=
"
${
value
=
"
${
map
(
"name"
,
"
${
huaweicloud_cce_cluster_v3
.
this
.
certificate_clusters
.
0
.
name
}
"
,
"server"
,
"
${
huaweicloud_cce_cluster_v3
.
this
.
certificate_clusters
.
0
.
server
}
"
,
"certificate_authority"
,
"
${
huaweicloud_cce_cluster_v3
.
this
.
certificate_clusters
.
0
.
certificate_authority_data
}
"
"certificate_authority"
,
"
${
huaweicloud_cce_cluster_v3
.
this
.
certificate_clusters
.
0
.
certificate_authority_data
}
"
)
}
"
}
output
"users_1"
{
description
=
"List first user infomation"
value
=
"
${
value
=
"
${
map
(
"name"
,
"
${
huaweicloud_cce_cluster_v3
.
this
.
certificate_users
.
0
.
name
}
"
,
"client_certificate"
,
"
${
huaweicloud_cce_cluster_v3
.
this
.
certificate_users
.
0
.
client_certificate_data
}
"
,
"client_key"
,
"
${
huaweicloud_cce_cluster_v3
.
this
.
certificate_users
.
0
.
client_key_data
}
"
"client_key"
,
"
${
huaweicloud_cce_cluster_v3
.
this
.
certificate_users
.
0
.
client_key_data
}
"
)
}
"
}
...
...
@@ -23,11 +23,11 @@ output "users_1" {
output
"clusters"
{
description
=
"List the clusters"
value
=
"
${
huaweicloud_cce_cluster_v3
.
this
.
certificate_clusters
}
"
value
=
"
${
huaweicloud_cce_cluster_v3
.
this
.
certificate_clusters
}
"
}
output
"users"
{
description
=
"List the users information"
value
=
"
${
huaweicloud_cce_cluster_v3
.
this
.
certificate_users
}
"
value
=
"
${
huaweicloud_cce_cluster_v3
.
this
.
certificate_users
}
"
}
environment/huaweicloud/cce/vars.tf
浏览文件 @
fdcd204e
...
...
@@ -28,7 +28,7 @@ variable "subnet_id" {
}
variable
"nodes"
{
type
=
list
(
map
(
string
))
type
=
list
(
map
(
string
))
description
=
"List of cluster node"
default
=
[]
}
environment/huaweicloud/dns/dns_template.tf
浏览文件 @
fdcd204e
resource
"huaweicloud_dns_ptrrecord_v2"
"this"
{
count
=
"
${
length
(
var
.
ptrs
)
}
"
name
=
"
${
lookup
(
var
.
ptrs
[
count
.
index
],
"domain"
,
null
)
}
"
description
=
"
${
lookup
(
var
.
ptrs
[
count
.
index
],
"description"
,
"ptr"
)
}
"
count
=
"
${
length
(
var
.
ptrs
)
}
"
name
=
"
${
lookup
(
var
.
ptrs
[
count
.
index
],
"domain"
,
null
)
}
"
description
=
"
${
lookup
(
var
.
ptrs
[
count
.
index
],
"description"
,
"ptr"
)
}
"
floatingip_id
=
"
${
lookup
(
var
.
ptrs
[
count
.
index
],
"ip"
,
null
)
}
"
ttl
=
"
${
lookup
(
var
.
ptrs
[
count
.
index
],
"ttl"
,
3000
)
}
"
ttl
=
"
${
lookup
(
var
.
ptrs
[
count
.
index
],
"ttl"
,
3000
)
}
"
}
...
...
environment/huaweicloud/dns/dns_vars.tf
浏览文件 @
fdcd204e
...
...
@@ -8,27 +8,27 @@ variable "email" {
variable
"ttl"
{
description
=
"The ttl time"
default
=
3000
}
default
=
3000
}
variable
"type"
{
description
=
"The DNS type, the value would be public or private"
default
=
"public"
default
=
"public"
}
variable
"description"
{
description
=
"The dns description string"
default
=
""
default
=
""
}
variable
"records"
{
type
=
list
(
map
(
string
))
type
=
list
(
map
(
string
))
description
=
"List of each dns records"
default
=
[]
default
=
[]
}
variable
"ptrs"
{
type
=
list
(
map
(
string
))
type
=
list
(
map
(
string
))
description
=
"List of ptr records"
default
=
[]
}
environment/huaweicloud/elb/elb.tf
浏览文件 @
fdcd204e
...
...
@@ -7,7 +7,7 @@ resource "huaweicloud_lb_loadbalancer_v2" "this" {
}
resource
"huaweicloud_networking_floatingip_associate_v2"
"this"
{
count
=
"
${
length
(
var
.
loadbalancers
)
}
"
count
=
"
${
length
(
var
.
loadbalancers
)
}
"
floating_ip
=
"
${
lookup
(
var
.
loadbalancers
[
count
.
index
],
"eip"
,
null
)
}
"
port_id
=
"
${
huaweicloud_lb_loadbalancer_v2
.
this
[
count
.
index
].
vip_port_id
}
"
}
environment/huaweicloud/elb/out_puts.tf
浏览文件 @
fdcd204e
output
"this_elb_ids"
{
description
=
"List of IDs of the elbs"
value
=
"
${
join
(
","
,
huaweicloud_lb_loadbalancer_v2
.
this
.
*
.
id
)
}
"
value
=
"
${
join
(
","
,
huaweicloud_lb_loadbalancer_v2
.
this
.
*
.
id
)
}
"
}
output
"this_port_ids"
{
description
=
"List of the port ids of all elbs"
value
=
"
${
join
(
","
,
huaweicloud_lb_loadbalancer_v2
.
this
.
*
.
vip_port_id
)
}
"
value
=
"
${
join
(
","
,
huaweicloud_lb_loadbalancer_v2
.
this
.
*
.
vip_port_id
)
}
"
}
environment/huaweicloud/elb/vars.tf
浏览文件 @
fdcd204e
variable
"loadbalancers"
{
type
=
list
(
map
(
string
))
type
=
list
(
map
(
string
))
description
=
"List of load banlancers"
default
=
[]
}
environment/huaweicloud/internet/internet_temp.tf
浏览文件 @
fdcd204e
resource
"huaweicloud_vpc_eip_v1"
"this"
{
count
=
"
${
length
(
var
.
eips
)
}
"
count
=
"
${
length
(
var
.
eips
)
}
"
publicip
{
type
=
"5_bgp"
}
bandwidth
{
id
=
"
${
lookup
(
var
.
eips
[
count
.
index
],
"bandwidth_id"
,
null
)
}
"
id
=
"
${
lookup
(
var
.
eips
[
count
.
index
],
"bandwidth_id"
,
null
)
}
"
share_type
=
"WHOLE"
}
}
resource
"huaweicloud_vpc_bandwidth_v2"
"this"
{
count
=
"
${
length
(
var
.
bandwidths
)
}
"
name
=
"
${
lookup
(
var
.
bandwidths
[
count
.
index
],
"name"
,
null
)
}
"
size
=
"
${
lookup
(
var
.
bandwidths
[
count
.
index
],
"size"
,
5
)
}
"
count
=
"
${
length
(
var
.
bandwidths
)
}
"
name
=
"
${
lookup
(
var
.
bandwidths
[
count
.
index
],
"name"
,
null
)
}
"
size
=
"
${
lookup
(
var
.
bandwidths
[
count
.
index
],
"size"
,
5
)
}
"
}
environment/huaweicloud/internet/internet_vars.tf
浏览文件 @
fdcd204e
variable
"eips"
{
type
=
list
(
map
(
string
))
type
=
list
(
map
(
string
))
description
=
"List of eips"
default
=
[]
}
variable
"bandwidths"
{
type
=
list
(
map
(
string
))
type
=
list
(
map
(
string
))
description
=
"List of bandwidths"
default
=
[]
default
=
[]
}
environment/huaweicloud/internet/out_puts.tf
浏览文件 @
fdcd204e
output
"this_eip_ids"
{
description
=
"List of IDs of the eips"
value
=
"
${
join
(
","
,
huaweicloud_vpc_eip_v1
.
this
.
*
.
id
)
}
"
value
=
"
${
join
(
","
,
huaweicloud_vpc_eip_v1
.
this
.
*
.
id
)
}
"
}
output
"this_eip_addresses"
{
description
=
"List of address of the eips"
value
=
"
${
join
(
","
,
huaweicloud_vpc_eip_v1
.
this
.
*
.
publicip
.
0
.
ip_address
)
}
"
value
=
"
${
join
(
","
,
huaweicloud_vpc_eip_v1
.
this
.
*
.
publicip
.
0
.
ip_address
)
}
"
}
output
"this_bandwidth_ids"
{
description
=
"List of bandwidth ids"
value
=
"
${
join
(
","
,
huaweicloud_vpc_bandwidth_v2
.
this
.
*
.
id
)
}
"
value
=
"
${
join
(
","
,
huaweicloud_vpc_bandwidth_v2
.
this
.
*
.
id
)
}
"
}
environment/huaweicloud/nat/nat_template.tf
浏览文件 @
fdcd204e
...
...
@@ -10,7 +10,7 @@ resource "huaweicloud_nat_snat_rule_v2" "this" {
count
=
"
${
length
(
var
.
rules
)
}
"
nat_gateway_id
=
"
${
huaweicloud_nat_gateway_v2
.
this
.
id
}
"
network_id
=
"
${
lookup
(
var
.
rules
[
count
.
index
],
"network_id"
,
null
)
}
"
floating_ip_id
=
"
${
lookup
(
var
.
rules
[
count
.
index
],
"eip_id"
,
null
)
}
"
floating_ip_id
=
"
${
lookup
(
var
.
rules
[
count
.
index
],
"eip_id"
,
null
)
}
"
}
environment/huaweicloud/nat/nat_vars.tf
浏览文件 @
fdcd204e
...
...
@@ -22,7 +22,7 @@ variable "network_id" {
}
variable
"rules"
{
type
=
list
(
map
(
string
))
type
=
list
(
map
(
string
))
description
=
"List of rules in the nat"
default
=
[]
}
environment/huaweicloud/network/network_output.tf
浏览文件 @
fdcd204e
output
"this_vpc_id"
{
description
=
"The ID of the VPC"
value
=
"
${
var
.
vpc_id
==
""
?
join
(
""
,
huaweicloud_vpc_v1
.
this
.
*
.
id
)
:
var
.
vpc_id
}
"
value
=
"
${
var
.
vpc_id
==
""
?
join
(
""
,
huaweicloud_vpc_v1
.
this
.
*
.
id
)
:
var
.
vpc_id
}
"
}
output
"this_subnet_ids"
{
description
=
"List of IDs of the Subnets"
value
=
"
${
join
(
","
,
huaweicloud_vpc_subnet_v1
.
this
.
*
.
subnet_id
)
}
"
value
=
"
${
join
(
","
,
huaweicloud_vpc_subnet_v1
.
this
.
*
.
subnet_id
)
}
"
}
output
"this_network_ids"
{
description
=
"List of Network IDs of the Subnets"
value
=
"
${
join
(
","
,
huaweicloud_vpc_subnet_v1
.
this
.
*
.
id
)
}
"
value
=
"
${
join
(
","
,
huaweicloud_vpc_subnet_v1
.
this
.
*
.
id
)
}
"
}
environment/huaweicloud/network/network_template.tf
浏览文件 @
fdcd204e
# Create VPC
resource
"huaweicloud_vpc_v1"
"this"
{
count
=
"
${
var
.
vpc_id
==
""
?
1
:
0
}
"
count
=
"
${
var
.
vpc_id
==
""
?
1
:
0
}
"
name
=
"
${
var
.
name
}
"
cidr
=
"
${
var
.
cidr
}
"
}
...
...
@@ -14,5 +14,5 @@ resource "huaweicloud_vpc_subnet_v1" "this" {
availability_zone
=
"
${
lookup
(
var
.
subnets
[
count
.
index
],
"availability_zone"
,
null
)
}
"
primary_dns
=
"
${
lookup
(
var
.
subnets
[
count
.
index
],
"primary_dns"
,
null
)
}
"
secondary_dns
=
"
${
lookup
(
var
.
subnets
[
count
.
index
],
"secondary_dns"
,
null
)
}
"
vpc_id
=
"
${
var
.
vpc_id
==
""
?
join
(
""
,
huaweicloud_vpc_v1
.
this
.
*
.
id
)
:
var
.
vpc_id
}
"
vpc_id
=
"
${
var
.
vpc_id
==
""
?
join
(
""
,
huaweicloud_vpc_v1
.
this
.
*
.
id
)
:
var
.
vpc_id
}
"
}
environment/huaweicloud/network/network_vars.tf
浏览文件 @
fdcd204e
...
...
@@ -14,7 +14,7 @@ variable "cidr" {
}
variable
"subnets"
{
type
=
list
(
map
(
string
))
type
=
list
(
map
(
string
))
description
=
"List of subnets in the VPC"
default
=
[]
}
environment/huaweicloud/output.tf
浏览文件 @
fdcd204e
output
"cce_clusters"
{
value
=
"
${module
.
cce
.
clusters
}
"
value
=
"
${module
.
cce
.
clusters
}
"
}
output
"cce_users"
{
value
=
"
${module
.
cce
.
users
}
"
value
=
"
${module
.
cce
.
users
}
"
}
output
"exim4_elb_id"
{
value
=
"
${
length
(
split
(
","
,
module
.
elb
.
this_elb_ids
))
>
1
?
split
(
","
,
module
.
elb
.
this_elb_ids
)[
1
]
:
null
}
"
value
=
"
${
length
(
split
(
","
,
module
.
elb
.
this_elb_ids
))
>
1
?
split
(
","
,
module
.
elb
.
this_elb_ids
)[
1
]
:
null
}
"
}
output
"web_elb_id"
{
value
=
"
${
length
(
split
(
","
,
module
.
elb
.
this_elb_ids
))
>
0
?
split
(
","
,
module
.
elb
.
this_elb_ids
)[
0
]
:
null
}
"
output
"web_elb_id"
{
value
=
"
${
length
(
split
(
","
,
module
.
elb
.
this_elb_ids
))
>
0
?
split
(
","
,
module
.
elb
.
this_elb_ids
)[
0
]
:
null
}
"
}
output
"exim4_eip"
{
value
=
"
${
length
(
split
(
","
,
module
.
internet
.
this_eip_addresses
))
>
1
?
split
(
","
,
module
.
internet
.
this_eip_addresses
)[
2
]
:
null
}
"
value
=
"
${
length
(
split
(
","
,
module
.
internet
.
this_eip_addresses
))
>
1
?
split
(
","
,
module
.
internet
.
this_eip_addresses
)[
2
]
:
null
}
"
}
output
"web_eip"
{
value
=
"
${
length
(
split
(
","
,
module
.
internet
.
this_eip_addresses
))
>
0
?
split
(
","
,
module
.
internet
.
this_eip_addresses
)[
1
]
:
null
}
"
value
=
"
${
length
(
split
(
","
,
module
.
internet
.
this_eip_addresses
))
>
0
?
split
(
","
,
module
.
internet
.
this_eip_addresses
)[
1
]
:
null
}
"
}
output
"exim4_domain"
{
value
=
"
${
var
.
sub_domain_mail
}
.
${
var
.
domain
}
"
value
=
"
${
var
.
sub_domain_mail
}
.
${
var
.
domain
}
"
}
output
"web_domain"
{
value
=
"
${
var
.
sub_domain_web
}
.
${
var
.
domain
}
"
value
=
"
${
var
.
sub_domain_web
}
.
${
var
.
domain
}
"
}
output
"dkim_selector"
{
value
=
"
${
var
.
selector
}
"
value
=
"
${
var
.
selector
}
"
}
environment/huaweicloud/resources.tf
浏览文件 @
fdcd204e
module
"network"
{
source
=
"./network/"
source
=
"./network/"
// VPC
name
=
"net-community"
...
...
@@ -18,38 +18,38 @@ module "network" {
module
"cce"
{
source
=
"./cce"
name
=
"cce-community"
name
=
"cce-community"
description
=
"This is cce cluster for community"
vpc_id
=
"
${module
.
network
.
this_vpc_id
}
"
subnet_id
=
"
${
split
(
","
,
module
.
network
.
this_network_ids
)[
0
]
}
"
flavor_id
=
"cce.s1.large"
vpc_id
=
"
${module
.
network
.
this_vpc_id
}
"
subnet_id
=
"
${
split
(
","
,
module
.
network
.
this_network_ids
)[
0
]
}
"
flavor_id
=
"cce.s1.large"
nodes
=
[
{
name
=
"node1"
,
ssh_key
=
"
${
var
.
keypair
}
"
,
az
=
"
${
var
.
az
}
"
,
name
=
"node1"
,
ssh_key
=
"
${
var
.
keypair
}
"
,
az
=
"
${
var
.
az
}
"
,
flavor_id
=
"
${
var
.
node_flavor
}
"
},
{
name
=
"node1"
,
ssh_key
=
"
${
var
.
keypair
}
"
,
az
=
"
${
var
.
az
}
"
,
name
=
"node1"
,
ssh_key
=
"
${
var
.
keypair
}
"
,
az
=
"
${
var
.
az
}
"
,
flavor_id
=
"
${
var
.
node_flavor
}
"
},
{
name
=
"node1"
,
ssh_key
=
"
${
var
.
keypair
}
"
,
az
=
"
${
var
.
az
}
"
,
name
=
"node1"
,
ssh_key
=
"
${
var
.
keypair
}
"
,
az
=
"
${
var
.
az
}
"
,
flavor_id
=
"
${
var
.
node_flavor
}
"
}
]
]
}
module
"internet"
{
source
=
"./internet"
bandwidths
=
[
{
name
=
"bandwidth-mail"
...
...
@@ -59,8 +59,8 @@ module "internet" {
name
=
"bandwidth-website"
size
=
"30"
}
]
]
eips
=
[
{
bandwidth_id
=
"
${
split
(
","
,
module
.
internet
.
this_bandwidth_ids
)[
0
]
}
"
...
...
@@ -73,23 +73,23 @@ module "internet" {
},
{
bandwidth_id
=
"
${
split
(
","
,
module
.
internet
.
this_bandwidth_ids
)[
1
]
}
"
}
}
]
}
module
"nat"
{
source
=
"./nat"
name
=
"nat-community"
name
=
"nat-community"
description
=
"this is a nat gateway to provide the access to internet for node"
spec_code
=
3
router_id
=
"
${module
.
network
.
this_vpc_id
}
"
network_id
=
"
${
split
(
","
,
module
.
network
.
this_network_ids
)[
0
]
}
"
spec_code
=
3
router_id
=
"
${module
.
network
.
this_vpc_id
}
"
network_id
=
"
${
split
(
","
,
module
.
network
.
this_network_ids
)[
0
]
}
"
rules
=
[
{
network_id
=
"
${
split
(
","
,
module
.
network
.
this_network_ids
)[
0
]
}
"
eip_id
=
"
${
split
(
","
,
module
.
internet
.
this_eip_ids
)[
0
]
}
"
eip_id
=
"
${
split
(
","
,
module
.
internet
.
this_eip_ids
)[
0
]
}
"
}
]
}
...
...
@@ -97,78 +97,78 @@ module "nat" {
module
"elb"
{
source
=
"./elb"
loadbalancers
=
[
{
name
=
"elb-web"
name
=
"elb-web"
description
=
"The load balancer of mailman-web"
subnet_id
=
"
${
split
(
","
,
module
.
network
.
this_subnet_ids
)[
0
]
}
"
eip
=
"
${
split
(
","
,
module
.
internet
.
this_eip_addresses
)[
1
]
}
"
subnet_id
=
"
${
split
(
","
,
module
.
network
.
this_subnet_ids
)[
0
]
}
"
eip
=
"
${
split
(
","
,
module
.
internet
.
this_eip_addresses
)[
1
]
}
"
},
{
name
=
"elb-mta"
name
=
"elb-mta"
description
=
"The load balancer of mail MTA"
subnet_id
=
"
${
split
(
","
,
module
.
network
.
this_subnet_ids
)[
0
]
}
"
eip
=
"
${
split
(
","
,
module
.
internet
.
this_eip_addresses
)[
2
]
}
"
subnet_id
=
"
${
split
(
","
,
module
.
network
.
this_subnet_ids
)[
0
]
}
"
eip
=
"
${
split
(
","
,
module
.
internet
.
this_eip_addresses
)[
2
]
}
"
},
{
name
=
"elb-website"
name
=
"elb-website"
description
=
"The load balancer of website"
subnet_id
=
"
${
split
(
","
,
module
.
network
.
this_subnet_ids
)[
0
]
}
"
eip
=
"
${
split
(
","
,
module
.
internet
.
this_eip_addresses
)[
3
]
}
"
subnet_id
=
"
${
split
(
","
,
module
.
network
.
this_subnet_ids
)[
0
]
}
"
eip
=
"
${
split
(
","
,
module
.
internet
.
this_eip_addresses
)[
3
]
}
"
},
]
}
module
"dns"
{
source
=
"./dns"
domain
=
"
${
var
.
domain
}
."
email
=
"
${
var
.
email
}
"
records
=
[
{
domain
=
"
${
var
.
domain
}
."
type
=
"A"
value
=
"
${
split
(
","
,
module
.
internet
.
this_eip_addresses
)[
3
]
}
"
type
=
"A"
value
=
"
${
split
(
","
,
module
.
internet
.
this_eip_addresses
)[
3
]
}
"
},
{
domain
=
"
${
var
.
sub_domain_mail
}
.
${
var
.
domain
}
."
type
=
"A"
value
=
"
${
split
(
","
,
module
.
internet
.
this_eip_addresses
)[
2
]
}
"
type
=
"A"
value
=
"
${
split
(
","
,
module
.
internet
.
this_eip_addresses
)[
2
]
}
"
},
{
domain
=
"
${
var
.
sub_domain_web
}
.
${
var
.
domain
}
."
type
=
"A"
value
=
"
${
split
(
","
,
module
.
internet
.
this_eip_addresses
)[
1
]
}
"
type
=
"A"
value
=
"
${
split
(
","
,
module
.
internet
.
this_eip_addresses
)[
1
]
}
"
},
{
domain
=
"
${
var
.
domain
}
."
type
=
"MX"
value
=
"1
${
var
.
sub_domain_mail
}
.
${
var
.
domain
}
."
type
=
"MX"
value
=
"1
${
var
.
sub_domain_mail
}
.
${
var
.
domain
}
."
},
{
domain
=
"
${
var
.
domain
}
."
type
=
"TXT"
value
=
"
\"
v=spf1 a mx ip4:
${
split
(
","
,
module
.
internet
.
this_eip_addresses
)[
0
]
}
~all
\"
"
type
=
"TXT"
value
=
"
\"
v=spf1 a mx ip4:
${
split
(
","
,
module
.
internet
.
this_eip_addresses
)[
0
]
}
~all
\"
"
},
{
domain
=
"_dmarc.
${
var
.
domain
}
."
type
=
"TXT"
value
=
"
\"
v=DMARC1;p=reject;sp=reject;adkim=r;aspf=r;fo=1;rf=afrf;pct=100;ruf=mailto:
${
var
.
email
}
;ri=86400
\"
"
type
=
"TXT"
value
=
"
\"
v=DMARC1;p=reject;sp=reject;adkim=r;aspf=r;fo=1;rf=afrf;pct=100;ruf=mailto:
${
var
.
email
}
;ri=86400
\"
"
},
{
domain
=
"
${
var
.
selector
}
._domainkey.
${
var
.
domain
}
."
type
=
"TXT"
value
=
"
\"
v=DKIM1;k=rsa;p=
${
var
.
dkim_public_key
}
\"
"
type
=
"TXT"
value
=
"
\"
v=DKIM1;k=rsa;p=
${
var
.
dkim_public_key
}
\"
"
}
]
ptrs
=
[
{
domain
=
"
${
var
.
domain
}
."
ip
=
"
${
split
(
","
,
module
.
internet
.
this_eip_ids
)[
0
]
}
"
domain
=
"
${
var
.
domain
}
."
ip
=
"
${
split
(
","
,
module
.
internet
.
this_eip_ids
)[
0
]
}
"
}
]
}
}
environment/huaweicloud/sg/output.tf
浏览文件 @
fdcd204e
output
"this_security_group_id"
{
description
=
"The ID of the security group"
value
=
"
${
var
.
security_group_id
==
""
?
join
(
""
,
huaweicloud_networking_secgroup_v2
.
this
.
*
.
id
)
:
var
.
security_group_id
}
"
description
=
"The ID of the security group"
value
=
"
${
var
.
security_group_id
==
""
?
join
(
""
,
huaweicloud_networking_secgroup_v2
.
this
.
*
.
id
)
:
var
.
security_group_id
}
"
}
environment/huaweicloud/sg/sg_template.tf
浏览文件 @
fdcd204e
# Create Security Group
resource
"huaweicloud_networking_secgroup_v2"
"this"
{
count
=
"
${
var
.
security_group_id
==
""
?
1
:
0
}
"
count
=
"
${
var
.
security_group_id
==
""
?
1
:
0
}
"
name
=
"
${
var
.
name
}
"
description
=
"
${
var
.
description
}
"
delete_default_rules
=
"
${
var
.
delete_default_rules
}
"
...
...
@@ -8,12 +8,12 @@ resource "huaweicloud_networking_secgroup_v2" "this" {
# Create Security Group Rule
resource
"huaweicloud_networking_secgroup_rule_v2"
"this"
{
count
=
"
${
length
(
var
.
rules
)
}
"
count
=
"
${
length
(
var
.
rules
)
}
"
direction
=
"
${
lookup
(
var
.
rules
[
count
.
index
],
"direction"
)
}
"
ethertype
=
"
${
lookup
(
var
.
rules
[
count
.
index
],
"ethertype"
)
}
"
protocol
=
"
${
lookup
(
var
.
rules
[
count
.
index
],
"protocol"
)
}
"
port_range_min
=
"
${
lookup
(
var
.
rules
[
count
.
index
],
"port_range_min"
)
}
"
port_range_max
=
"
${
lookup
(
var
.
rules
[
count
.
index
],
"port_range_max"
)
}
"
remote_ip_prefix
=
"
${
lookup
(
var
.
rules
[
count
.
index
],
"remote_ip_cidr"
)
}
"
security_group_id
=
"
${
var
.
security_group_id
==
""
?
join
(
""
,
huaweicloud_networking_secgroup_v2
.
this
.
*
.
id
)
:
var
.
security_group_id
}
"
security_group_id
=
"
${
var
.
security_group_id
==
""
?
join
(
""
,
huaweicloud_networking_secgroup_v2
.
this
.
*
.
id
)
:
var
.
security_group_id
}
"
}
environment/huaweicloud/sg/vars.tf
浏览文件 @
fdcd204e
...
...
@@ -20,7 +20,7 @@ variable "delete_default_rules" {
}
variable
"rules"
{
type
=
list
(
map
(
string
))
type
=
list
(
map
(
string
))
description
=
"List of rules in a security group"
default
=
[]
}
environment/huaweicloud/vars.tf
浏览文件 @
fdcd204e
#Required vars
variable
"domain"
{
description
=
"The email domain that will be served on. e.g. example.com"
default
=
"openeuler.org"
description
=
"The email domain that will be served on. e.g. example.com"
default
=
"openeuler.org"
}
variable
"email"
{
description
=
"The admin email of dns domain. e.g. example@gmail.com"
default
=
"freesky.edward@gmail.com"
description
=
"The admin email of dns domain. e.g. example@gmail.com"
default
=
"freesky.edward@gmail.com"
}
variable
"dkim_public_key"
{
description
=
"The DKIM public key, must be rsa more than 1024, 2048 should be plus"
description
=
"The DKIM public key, must be rsa more than 1024, 2048 should be plus"
}
#
...
...
@@ -19,32 +19,32 @@ variable "dkim_public_key" {
## The cluster vars
variable
"keypair"
{
description
=
"The key pair for cce cluster node login."
default
=
"KeyPair-infra"
description
=
"The key pair for cce cluster node login."
default
=
"KeyPair-infra"
}
variable
"az"
{
description
=
"The AZ that system will run on"
default
=
"ap-southeast-1a"
description
=
"The AZ that system will run on"
default
=
"ap-southeast-1a"
}
variable
"node_flavor"
{
description
=
"The default flavor of cce node"
default
=
"s3.xlarge.4"
description
=
"The default flavor of cce node"
default
=
"s3.xlarge.4"
}
## The dns configuation vars
variable
"selector"
{
description
=
"The DKIM hander name"
default
=
"20191010"
description
=
"The DKIM hander name"
default
=
"20191010"
}
variable
"sub_domain_mail"
{
description
=
"The sub domain that exim4 will serve on"
default
=
"mail"
description
=
"The sub domain that exim4 will serve on"
default
=
"mail"
}
variable
"sub_domain_web"
{
description
=
"The sub domain that mailman web will serve on"
default
=
"mailweb"
description
=
"The sub domain that mailman web will serve on"
default
=
"mailweb"
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录