ALIYUN::FC::Alias is used to create an Alias.
Syntax
{
"Type": "ALIYUN::FC::Alias",
"Properties": {
"Description": String,
"VersionId": String,
"ServiceName": String,
"AliasName": String,
"AdditionalVersion": String,
"AdditionalWeight": Integer
}
}
Properties
Parameter | Type | Required | Editable | Description | Constraint |
---|---|---|---|---|---|
Description | String | Not supported | Supported | The description of the alias. | The description must be 1 to 256 characters in length. |
VersionId | String | Not supported | Supported | The ID of the version. | None |
ServiceName | String | Yes | Not supported | Service name | None |
AliasName | String | Yes | Yes | Alias | It must be 1 to 128 characters in length and can start with a letter or underscore (_). |
AdditionalVersion | String | Not supported | Supported | Canary version | The version cannot be the same as the primary key version. |
AdditionalWeight | Integer | Not supported | Supported | Canary version weight | Valid values: 0 to 100. |
Return value
Fn::GetAtt
- Version ID: The version ID.
- ServiceName: The name of the function Compute Service.
- AliasName: The alias.
Examples
JSON
format
{
"ROSTemplateFormatVersion": "2015-09-01",
"Resources": {
"Alias": {
"Type": "ALIYUN::FC::Alias",
"Properties": {
"AdditionalVersion": {
"Ref": "AdditionalVersion"
},
"Description": {
"Ref": "Description"
},
"VersionId": {
"Ref": "VersionId"
},
"ServiceName": {
"Ref": "ServiceName"
},
"AliasName": {
"Ref": "AliasName"
},
"AdditionalWeight": {
"Ref": "AdditionalWeight"
}
}
}
},
"Parameters": {
"AdditionalVersion": {
"Type": "String",
"Description": "Additional version"
},
"Description": {
"Type": "String",
"Description": "Version description"
},
"VersionId": {
"Type": "String",
"Description": "Version ID"
},
"ServiceName": {
"MinLength": 1,
"Type": "String",
"Description": "Service name",
"MaxLength": 128
},
"AliasName": {
"Type": "String",
"Description": "Alias name"
},
"AdditionalWeight": {
"Type": "Number",
"Description": "Traffic weight of additional version. From 0 to 100.",
"MaxValue": 100,
"MinValue": 0
}
},
"Outputs": {
"VersionId": {
"Description": "The version ID",
"Value": {
"Fn::GetAtt": [
"Alias",
"VersionId"
]
}
},
"ServiceName": {
"Description": "The service name",
"Value": {
"Fn::GetAtt": [
"Alias",
"ServiceName"
]
}
},
"AliasName": {
"Description": "The alias name",
"Value": {
"Fn::GetAtt": [
"Alias",
"AliasName"
]
}
}
}
}
YAML
format
ROSTemplateFormatVersion: '2015-09-01'
Resources:
Alias:
Type: 'ALIYUN::FC::Alias'
Properties:
AdditionalVersion:
Ref: AdditionalVersion
Description:
Ref: Description
VersionId:
Ref: VersionId
ServiceName:
Ref: ServiceName
AliasName:
Ref: AliasName
AdditionalWeight:
Ref: AdditionalWeight
Parameters:
AdditionalVersion:
Type: String
Description: Additional version
Description:
Type: String
Description: Version description
VersionId:
Type: String
Description: Version ID
ServiceName:
MinLength: 1
Type: String
Description: Service name
MaxLength: 128
AliasName:
Type: String
Description: Alias name
AdditionalWeight:
Type: Number
Description: Traffic weight of additional version. From 0 to 100.
MaxValue: 100
MinValue: 0
Outputs:
VersionId:
Description: The version ID
Value:
'Fn::GetAtt':
-Alias
-VersionId
ServiceName:
Description: The service name
Value:
'Fn::GetAtt':
-Alias
-ServiceName
AliasName:
Description: The alias name
Value:
'Fn::GetAtt':
-Alias
-AliasName