Template name
ACS-FC-InvokeFunction
Template description
Executes a function and returns the function result.
Template type
Automated
Owner
Alibaba Cloud
Input parameters
Parameter | Description | Type | Required | Default value | Limit |
serviceName | The service name. | String | Yes | ||
functionName | The function name. | String | Yes | ||
regionId | The region ID. | String | No | {{ ACS::RegionId }} | |
parameters | The function parameters. | String | No | "" | |
OOSAssumeRole | The RAM role that is assumed by CloudOps Orchestration Service (OOS). | String | No | "" |
Output parameters
Parameter | Description | Type |
invokeData | String |
Permission policy that is required to execute the template
{
"Version": "1",
"Statement": [
{
"Action": [
"fc:InvokeFunction"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
References
For more information, see ACS-FC-InvokeFunction.yml at GitHub.
Template content
FormatVersion: OOS-2019-06-01
Description:
en: Invoke the function and return the result
name-en: ACS-FC-InvokeFunction
Parameters:
regionId:
Type: String
Label:
en: RegionId
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
serviceName:
Label:
en: ServiceName
Type: String
AssociationProperty: ALIYUN::FC::Service::ServiceName
AssociationPropertyMetadata:
RegionId: regionId
functionName:
Label:
en: FunctionName
Type: String
AssociationProperty: ALIYUN::FC::Function::FunctionName
AssociationPropertyMetadata:
RegionId: regionId
ServiceName: serviceName
parameters:
Label:
en: Parameters
Type: String
Default: ''
OOSAssumeRole:
Label:
en: OOSAssumeRole
Type: String
Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: invokeFunction
Action: ACS::FC::InvokeFunction
Description:
en: Invoke the function
Properties:
functionName: '{{ functionName }}'
serviceName: '{{ serviceName }}'
invocationType: Sync
regionId: '{{ regionId }}'
event: '{{ parameters }}'
Outputs:
invokeData:
Type: String
ValueSelector: data
Outputs:
invokeData:
Type: String
Value: '{{ invokeFunction.invokeData }}'