Template name
ACS-SAE-CreateDemoApp
Template description
Creates a Serverless App Engine (SAE) application and binds a Server Load Balancer (SLB) instance to the application.
Template type
Automated
Owner
Alibaba Cloud
Input parameters
Parameter | Description | Type | Required | Default value | Limit |
applicationInfos | The information about the SAE application. | Json | No | [{'appName': 'appName', 'imageUrl': 'imageUrl'}] |
Output parameters
None
Permission policy that is required to execute the template
{
"Version": "1",
"Statement": [
{
"Action": [
"sae:BindSlb",
"sae:CreateApplication",
"sae:DescribeChangeOrder"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
References
For more information, see ACS-SAE-CreateDemoApp at GitHub.
Template content
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