全部產品
Search
文件中心

CloudOps Orchestration Service:ACS-SAE-CreateDemoApp

更新時間:Sep 05, 2024

模板名稱

ACS-SAE-CreateDemoApp 建立SAE應用

立即執行

模板描述

建立SAE應用並為應用綁定SLB

模板類型

自動化

所有者

Alibaba Cloud

輸入參數

參數名稱

描述

類型

是否必填

預設值

約束

applicationInfos

SAE應用資訊

Json

[{'appName': 'appName', 'imageUrl': 'imageUrl'}]

輸出參數

執行此模板需要的權限原則

{
    "Version": "1",
    "Statement": [
        {
            "Action": [
                "sae:BindSlb",
                "sae:CreateApplication",
                "sae:DescribeChangeOrder"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

詳情

ACS-SAE-CreateDemoApp詳情

模板內容

FormatVersion: OOS-2019-06-01
Description:
  en: Create SAE application and bind them to SLB
  zh-cn: 建立SAE應用並為應用綁定SLB
  name-en: ACS-SAE-CreateDemoApp
  name-zh-cn: 建立SAE應用
Parameters:
  applicationInfos:
    Label:
      en: SAEApplicationInfos
      zh-cn: SAE應用資訊
    Type: Json
    Default:
      - appName: appName
        imageUrl: imageUrl
Tasks:
  - Name: createApplications
    Action: 'ACS::SAE::CreateApplication'
    Description:
      en: Create SAE application
      zh-cn: 建立SAE應用
    Properties:
      applicationInfo: '{{ ACS::TaskLoopItem }}'
    Loop:
      Items: '{{ applicationInfos }}'
      RateControl:
        Mode: Concurrency
        MaxErrors: 0
        Concurrency: 3
      Outputs:
        appIds:
          AggregateType: 'Fn::ListJoin'
          AggregateField: appId
    Outputs:
      appId:
        Type: String
        ValueSelector: appId
  - Name: bindSlb
    Action: 'ACS::ExecuteApi'
    Description:
      en: Bind app to SLB
      zh-cn: 為應用綁定SLB
    Properties:
      Service: SAE
      API: BindSlb
      Parameters:
        AppId:
          'Fn::Select':
            - 0
            - '{{ createApplications.appIds }}'
        Internet: '[{"port":80,"targetPort":9999,"protocol":"TCP"}]'
    Outputs:
      ChangeOrderId:
        ValueSelector: .Data.ChangeOrderId
        Type: String
  - Name: describeBindSlbChangeOrder
    Action: 'ACS::WaitFor'
    Description:
      en: Waits for the APP bind to SLB
      zh-cn: 等待應用成功綁定SLB
    Properties:
      Service: SAE
      API: DescribeChangeOrder
      Parameters:
        ChangeOrderId: '{{ bindSlb.ChangeOrderId }}'
      StopRetryValues:
        - 2
        - 3
        - 6
        - 10
      DesiredValues:
        - 2
      PropertySelector: .Data.Status
    DelayType: Constant
    Delay: 6
    Retries: 10