テンプレート名
ACS-SAE-CreateDemoApp
テンプレートの説明
Serverless App Engine (SAE) アプリケーションを作成し、Server Load Balancer (SLB) インスタンスをアプリケーションにバインドします。
テンプレートタイプ
自動
所有者
Alibaba Cloud
入力パラメーター
パラメーター | 説明 | タイプ | 必須 | デフォルト値 | 制限 |
applicationInfos | SAE アプリケーションの情報。 | JSON | いいえ | [{'appName': 'appName', 'imageUrl': 'imageUrl'}] |
出力パラメーター
なし
テンプレートを実行するために必要な権限ポリシー
{
"Version": "1",
"Statement": [
{
"Action": [
"sae:BindSlb",
"sae:CreateApplication",
"sae:DescribeChangeOrder"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
参照
詳細については、GitHub の ACS-SAE-CreateDemoApp をご参照ください。
テンプレートコンテンツ
FormatVersion: OOS-2019-06-01
Description:
en: Create SAE application and bind them to SLB
name-en: ACS-SAE-CreateDemoApp
Parameters:
applicationInfos:
Label:
en: SAEApplicationInfos
Type: Json
Default:
- appName: appName
imageUrl: imageUrl
Tasks:
- Name: createApplications
Action: 'ACS::SAE::CreateApplication'
Description:
en: Create SAE application
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
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
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