示例
JSON格式{
"ROSTemplateFormatVersion": "2015-09-01",
"Transform": "Aliyun::Serverless-2018-04-03",
"Parameters": {
"CodeUri": {
"Type": "String"
}
},
"Resources": {
"MyService": {
"Type": "Aliyun::Serverless::Service",
"Properties": {},
"MyFunction": {
"Type": "Aliyun::Serverless::Function",
"Properties": {
"Handler": "index.handler",
"CodeUri": {
"Ref": "CodeUri"
},
"Description": "Hello world with python2.7!",
"Runtime": "python2.7",
"Timeout": 300
}
}
}
},
"Outputs": {
"MyServiceId": {
"Value": {
"Fn::GetAtt": [
"MyService",
"ServiceId"
]
}
},
"ServiceName": {
"Value": {
"Fn::GetAtt": [
"MyService",
"ServiceName"
]
}
},
"FunctionName": {
"Value": {
"Fn::GetAtt": [
"MyServiceMyFunction",
"FunctionName"
]
}
},
"FunctionId": {
"Value": {
"Fn::GetAtt": [
"MyServiceMyFunction",
"FunctionId"
]
}
},
"ARN": {
"Value": {
"Fn::GetAtt": [
"MyServiceMyFunction",
"ARN"
]
}
},
"FunctionServiceName": {
"Value": {
"Fn::GetAtt": [
"MyServiceMyFunction",
"ServiceName"
]
}
}
}
}
YAML格式ROSTemplateFormatVersion: '2015-09-01'
Transform: 'Aliyun::Serverless-2018-04-03'
Parameters:
CodeUri:
Type: String
Resources:
MyService:
Type: 'Aliyun::Serverless::Service'
Properties: {}
MyFunction:
Type: 'Aliyun::Serverless::Function'
Properties:
Handler: index.handler
CodeUri:
Ref: CodeUri
Description: Hello world with python2.7!
Runtime: python2.7
Timeout: 300
Outputs:
MyServiceId:
Value:
'Fn::GetAtt':
- MyService
- ServiceId
ServiceName:
Value:
'Fn::GetAtt':
- MyService
- ServiceName
FunctionName:
Value:
'Fn::GetAtt':
- MyServiceMyFunction
- FunctionName
FunctionId:
Value:
'Fn::GetAtt':
- MyServiceMyFunction
- FunctionId
ARN:
Value:
'Fn::GetAtt':
- MyServiceMyFunction
- ARN
FunctionServiceName:
Value:
'Fn::GetAtt':
- MyServiceMyFunction
- ServiceName