模板ID
SX4CLB1IH4FYNAGH
地址:https://bpstudio.console.aliyun.com/bpStudio/topo?TemplateId=SX4CLB1IH4FYNAGH
支持地域
杭州、北京、上海、深圳、广州、成都等
模板架构
参数变量
参数变量类型包括String、Integer、Boolean、Map等,通过variables传递相关参数值。
如果未传递,则使用默认值。 如果修改模板变量配置,可以参考:模板变量配置
序号 | 变量名称 | 变量类型 | 默认值 | 描述 |
1 | ${nlb-name} | String | nlb | NLB实例名称 |
2 | ${nlb-network-type} | String | Internet | 网络类型 |
3 | ${instance-tags} | Map | {"createBy":"cadt"} | 资源标签 |
4 | ${cbwp-name} | String | cbwp | 共享带宽名称 |
5 | ${cbwp-bandwidth} | Integer | 1 | 带宽(Mbps) |
6 | ${nlb-listener} | String | nlb_listener_80 | NLB的监听 |
7 | ${nlb-listener-port} | Integer | 80 | 监听端口 |
8 | ${nlb-vservergroup-01} | String | nlb_servergroup | 虚拟服务器组 |
9 | ${nlb-sg-backend-port} | List<Map> | [{"backend_port":"80","weight":100}] | 服务器组端口配置 |
10 | ${ecs-01-type} | String | ecs.c6.large | ECS01的实例规格 |
11 | ${ecs-01-name} | String | ecs-test-01 | ECS01的实例/主机名称 |
12 | ${ecs-01-password} | String | Test1234 | ECS01的密码 |
13 | ${ecs-01-num} | Integer | 1 | ECS01的实例数量 |
14 | ${ecs-01-type} | String | ecs.c6.large | ECS02的实例规格 |
15 | ${ecs-01-name} | String | ecs-test-02 | ECS02的实例/主机名称 |
16 | ${ecs-01-password} | String | Test1234 | ECS02的密码 |
17 | ${ecs-02-num} | Integer | 1 | ECS02的实例数量 |
命令行调试
YAML文件传参配置示例(默认VPC、交换机、共享带宽、NLB、ECS均为新创建):
template_id: SX4CLB1IH4FYNAGH
area_id: "cn-beijing"
instances:
# - node_type: vpc
# node_name: vpc-01
# id: vpc-bp**********ws
# - node_type: vswitch
# node_name: vswitch-01
# id: vsw-bp**********0ex
# - node_type: vswitch
# node_name: vswitch-02
# id: vsw-bp**********1ek
# 默认新建VPC和交换机,已注释对应参数。复用现有VPC和交换机时,取消注释,替换对应的实例ID
variables:
${nlb-name}: "ali-prod-nlb"
${nlb-network-type}: "Intranet"
# 私网:Intranet,公网:Internet
${cbwp-name}: "ali-nlb-cbwp"
${cbwp-bandwidth}: "1"
# 带宽默认1Mbps,自动将NLB添加到共享带宽
${nlb-listener}: "listener_TCP_80"
${nlb-listener-port}: "80"
${nlb-vservergroup-01}: "SG_TCP_01"
${nlb-sg-backend-port}: "[{\"backend_port\":\"80\",\"weight\":\"100\"}]"
${ecs-01-type}: "ecs.c6.large"
${ecs-01-num}: "1"
${ecs-01-name}: "ecs-test-01"
${ecs-01-password}: "Test1234"
${ecs-02-type}: "ecs.c6.large"
${ecs-02-num}: "1"
${ecs-02-name}: "ecs-test-02"
${ecs-02-password}: "Test1234"
${instance-tags}: "{\"env\":\"test\",\"createBy\":\"cadt\"}"
#${resourcegroupId}: "rg-ac*****y"
configuration:
enableMonitor: "0"
enableReport: "0"
output:
nlb:
- Address
- Port
ecs:
- Private_ip
备注说明:
1、如果更换地域,替换area_id的字段,如北京"cn-beijing",替换为上海“cn-shanghai”
ID可以参考:地域和可用区
2、如果需要替换模板中的已保有实例,比如使用存量的VPC、交换机等。可以替换对应的instances的ID字段。
instances:
- node_type: vpc
node_name: vpc-01
id: vpc-bp**********ws
- node_type: vswitch
node_name: vswitch-01
id: vsw-bp**********0ex
- node_type: vswitch
node_name: vswitch-02
id: vsw-bp**********1ek