ALIYUN::APIG::ApiAttachment类型用于API挂载。
语法
{
"Type": "ALIYUN::APIG::ApiAttachment",
"Properties": {
"HttpApiId": String,
"Description": String,
"DomainIds": List,
"RouteId": String
}
}属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
HttpApiId | String | 是 | 否 | HTTP API ID。 | 无 |
Description | String | 否 | 否 | 描述。 | 无 |
DomainIds | List | 否 | 否 | 用户自定义域名 ID 列表。 | 最多支持输入10组域名 ID。 |
RouteId | String | 否 | 否 | 路由 ID。 | 无 |
返回值
Fn::GetAtt
RouteId:路由 ID。
HttpApiId:路由所属的 HTTP API ID。
示例
ROSTemplateFormatVersion: '2015-09-01'
Parameters: {}
Resources:
ExtensionResource:
Type: ALIYUN::APIG::ApiAttachment
Properties:
HttpApiId: api-csqxxxxx
RouteId: hr-csuxxxxxx
Outputs:
RouteId:
Description: The route ID. When publishing an HTTP API route, it must be passed in.
Value:
Fn::GetAtt:
- ExtensionResource
- RouteId
HttpApiId:
Description: The ID of the HTTP API.
Value:
Fn::GetAtt:
- ExtensionResource
- HttpApiId{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
},
"Resources": {
"ExtensionResource": {
"Type": "ALIYUN::APIG::ApiAttachment",
"Properties": {
"EnvironmentId": "env-csqxxxxx",
"BackendScene": "MultiServiceByRatio",
"HttpApiId": "api-csqxxxxx",
"ServiceConfigs": [
{
"ServiceId": "svc-csqp3xxxxx",
"Weight": 100
}
],
"RouteId": "hr-csuxxxxxx"
}
}
},
"Outputs": {
"EnvironmentId": {
"Description": "The ID of the environment to which the API is to deploy.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"EnvironmentId"
]
}
},
"RouteId": {
"Description": "The route ID. When publishing an HTTP API route, it must be passed in.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"RouteId"
]
}
},
"HttpApiId": {
"Description": "The ID of the HTTP API.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"HttpApiId"
]
}
}
}
} 该文章对您有帮助吗?