All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::APIG::ApiAttachment

Last Updated:Apr 14, 2026

ALIYUN::APIG::ApiAttachment is used to attach an API.

Syntax

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

Properties

Property

Type

Required

Editable

Description

Constraint

HttpApiId

String

Yes

No

The ID of the HTTP API.

None.

Description

String

No

No

The description.

None.

DomainIds

List

No

No

The IDs of the custom domain names.

You can specify up to 10 IDs.

RouteId

String

No

No

The ID of the route.

None.

Return values

Fn::GetAtt

  • RouteId: the ID of the route.

  • HttpApiId: the ID of the HTTP API.

Examples

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