ALIYUN::APIG::ApiAttachment

更新时间:
复制为 MD 格式

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"
        ]
      }
    }
  }
}