模板ID
6DG34M62ELQZW75T
地址:https://bpstudio.console.alibabacloud.com/bpStudio/topo?TemplateId=6DG34M62ELQZW75T
支援地區
杭州、北京、上海、深圳、廣州、成都等
模板架構

參數變數
參數變數類型包括String、Integer、Boolean、Map等,通過variables傳遞相關參數值。
如果未傳遞,則使用預設值。 如果修改模板變數配置,可以參考:模板變數配置
序號 | 變數名稱 | 變數類型 | 預設值 | 描述 |
1 | ${alb-name} | String | prod-alb | NLB執行個體名稱 |
2 | ${alb-network-type} | String | Internet | 網路類型 |
3 | ${instance-tags} | Map | {"createBy":"cadt"} | 資源標籤 |
4 | ${resourcegroupId} | String | 資源群組ID | |
5 | ${cbwp-name} | String | alb-cbwp | 共用頻寬名稱 |
6 | ${cbwp-bandwidth} | Integer | 1 | 頻寬(Mbps) |
7 | ${alb-listener} | String | alb_listener | NLB的監聽 |
8 | ${alb-listener-port} | Integer | 80 | 監聽連接埠 |
9 | ${alb-vservergroup-01} | String | alb_servergroup | 虛擬伺服器組 |
10 | ${alb-sg-backend-port} | List<Map> | [{"backend_port":"80","weight":100}] | 伺服器組連接埠配置 |
命令列調試
YAML檔案傳參配置樣本(預設VPC、交換器、共用頻寬均為新建立):
template_id: 6DG34M62ELQZW75T
area_id: "cn-hangzhou"
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:
${alb-name}: "ali-prod-alb"
${alb-network-type}: "Internet"
# 私網:Intranet,公網:Internet
${cbwp-name}: "ali-alb-cbwp"
${cbwp-bandwidth}: "1"
# 頻寬預設1Mbps,自動將NLB添加到共用頻寬
${alb-listener}: "listener_HTTP_80"
${alb-listener-port}: "80"
${alb-vservergroup-01}: "SG_HTTP_01"
${alb-sg-backend-port}: "[{\"backend_port\":\"80\",\"weight\":\"100\"}]"
${instance-tags}: "{\"env\":\"test\",\"createBy\":\"cadt\"}"
#${resourcegroupId}: "rg-ac*****y"
configuration:
enableMonitor: "0"
enableReport: "0"
output:
alb:
- Address
- Port
eip:
- IpAddress
- RegionId
gateway:
-EcrId備忘說明:
1、如果更換地區,替換area_id的欄位,如杭州"cn-hangzhou",替換為上海“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