Todos os produtos
Search
Central de documentação

Resource Orchestration Service:ALIYUN::APIG::ApiAttachment

Última atualização: Jun 27, 2026

O recurso ALIYUN::APIG::ApiAttachment associa uma API a um domínio e a uma rota para publicação.

Sintaxe

{
  "Type": "ALIYUN::APIG::ApiAttachment",
  "Properties": {
    "HttpApiId": String,
    "Description": String,
    "DomainIds": List,
    "RouteId": String
  }
}

Propriedades

Propriedade

Tipo

Obrigatória

Editável

Descrição

Restrição

HttpApiId

String

Sim

Não

ID da API HTTP.

Nenhuma.

Description

String

Não

Não

Descrição do anexo da API.

Nenhuma.

DomainIds

List

Não

Não

IDs dos nomes de domínio personalizados.

Especifique até 10 IDs.

RouteId

String

Não

Não

ID da rota.

Nenhuma.

Valores de retorno

Fn::GetAtt

  • RouteId: ID da rota.

  • HttpApiId: ID da API HTTP.

Exemplos

ROSTemplateFormatVersion: '2015-09-01'
Parameters: {}
Resources:
  ExtensionResource:
    Type: ALIYUN::APIG::ApiAttachment
    Properties:
      HttpApiId: api-csqxxxxx
      RouteId: hr-csuxxxxxx
Outputs:
  RouteId:
    Description: The route ID. This ID is required to publish an HTTP API route.
    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"
        ]
      }
    }
  }
}