All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::APIG::Gateway

Last Updated:Sep 09, 2025

ALIYUN::APIG::Gateway is used to create a Cloud-native API Gateway.

Syntax

{
  "Type": "ALIYUN::APIG::Gateway",
  "Properties": {
    "PaymentType": String,
    "Spec": String,
    "ZoneConfig": Map,
    "GatewayName": String,
    "LogConfig": Map,
    "NetworkAccessConfig": Map,
    "VSwitch": Map,
    "Vpc": Map,
    "Tags": List,
    "GatewayType": String,
    "ResourceGroupId": String,
    "Period": Integer,
    "PeriodUnit": String
  }
}

Properties

Property name

Type

Required

Editable

Description

Constraint

GatewayName

String

Yes

Yes

The name of the gateway.

None

PaymentType

String

Yes

Yes

The billing method.

Valid values:

  • PayAsYouGo

  • Subscription

Spec

String

Yes

No

The specification of the gateway.

None

ZoneConfig

Map

Yes

No

The zone configurations.

For more information, refer to ZoneConfig property.

GatewayType

String

No

No

The type of the gateway.

Valid values:

  • API: API Gateway

  • AI: AI Gateway

LogConfig

Map

No

No

The log configurations.

For more information, refer to LogConfig property.

NetworkAccessConfig

Map

Yes

No

The network configurations.

For more information, refer to NetworkAccessConfig property.

ResourceGroupId

String

No

Yes

The resource group ID.

None

Period

Integer

No

Yes

Purchase period for subscription gateway.

When PeriodUnit is set to Month, the value ranges from 1 to 9.

When PeriodUnit is set to Year, the value can be 1, 2, or 3.

This parameter is only valid when updating PaymentType from PayAsYouGo to Subscription.

PeriodUnit

String

No

Yes

Purchase period unit for subscription gateway.

Valid values:

  • Month

  • Year

VSwitch

Map

No

No

The vSwitch configurations of the instance.

For more information, refer to VSwitch properties.

Vpc

Map

No

No

The virtual private cloud (VPC) configurations of the instance.

For more information, refer to Vpc properties.

Tags

List

No

Yes

The tags.

You can specify up to 20 tags.

For more information, refer to Tags properties.

NetworkAccessConfig syntax

"NetworkAccessConfig": {
  "Type": String
}

NetworkAccessConfig property

Property name

Type

Required

Editable

Description

Constraint

Type

String

Yes

No

The type of network access.

Valid values:

  • Internet

  • Intranet

  • InternetAndIntranet

VSwitch syntax

"VSwitch": {
  "VSwitchId": String,
  "Name": String
}

VSwitch properties

Property name

Type

Required

Editable

Description

Constraint

VSwitchId

String

Yes

No

The ID of the vSwitch.

None

Name

String

No

No

The name of the vSwitch.

None

ZoneConfig syntax

"ZoneConfig": {
  "SelectOption": String
}

ZoneConfig property

Property name

Type

Required

Editable

Description

Constraint

SelectOption

String

Yes

No

The option for selecting the zone.

Valid values:

  • Auto

  • Manual

Vpc syntax

"Vpc": {
  "VpcId": String,
  "Name": String
}

Vpc properties

Property name

Type

Required

Editable

Description

Constraint

VpcId

String

Yes

No

The ID of the virtual private cloud (VPC).

None

Name

String

No

No

The name of the VPC gateway.

None

LogConfig syntax

"LogConfig": {
  "Sls": Map
}

LogConfig property

Property name

Type

Required

Editable

Description

Constraint

Sls

Map

No

No

The Simple Log Service (SLS) configurations.

None

Sls syntax

"Sls": {
  "Enable": Boolean
}

Sls property

Property name

Type

Required

Editable

Description

Constraint

Enable

Boolean

No

No

Specifies whether to enable the SLS configurations.

None

Tags syntax

"Tags" : [
  {
    "Value" : String,
    "Key" : String
  }
]

Tags properties

Property name

Type

Required

Editable

Description

Constraint

Key

String

Yes

No

The tag key.

The tag key must be 1 to 128 characters in length and cannot start with aliyun or acs:. It cannot contain http:// or https://.

Value

String

No

No

The tag value.

The tag value must be 0 to 128 characters in length and cannot start with aliyun or acs:. It cannot contain http:// or https://.

Return value

Fn::GetAtt

  • CreateTime: The creation timestamp in milliseconds.

  • Vpc: The VPC of the instance.

  • LoadBalancers: The ingress IP addresses of the instance.

  • SecurityGroup: The security group of the instance.

  • GatewayId: The ID of the instance.

  • Zones: The zone configurations of the instance.

  • VSwitch: The vSwitch configurations of the instance.

  • Version: The version of the instance.

  • UpdateTime: The update timestamp in milliseconds.

  • PaymentType: The billing method.

  • GatewayName: The name of the instance.

  • ExpireTime: The expiration timestamp of the subscription in milliseconds.

  • Spec: The instance type.

  • Environments: The environments to which the API is published.

  • ResourceGroupId: The ID of the resource group.

  • GatewayType: The type of the instance.

  • Tags: The tags.

Examples

ROSTemplateFormatVersion: '2015-09-01'
Metadata:
  ALIYUN::ROS::Interface:
    ParameterGroups:
      - Parameters:
          - Vpc
          - ZoneConfig
          - VSwitch
        Label:
          default:
            en: Network Configuration
      - Parameters:
          - PaymentType
          - Spec
        Label:
          default:
            en: Gateway Configuration
Parameters:
  VSwitch:
    AssociationPropertyMetadata:
      Parameters:
        VSwitchId:
          AssociationPropertyMetadata:
            VpcId: ${Vpc.VpcId}
          AssociationProperty: ALIYUN::VPC::VSwitch::VSwitchId
          Type: String
          Description:
            en: The ID of the VSwitch.
          Required: true
        Name:
          Type: String
          Description:
            en: The name of the VSwitch.
          Required: false
    Type: Json
    Description:
      en: The virtual switch associated with the Gateway.
    Required: false
  ZoneConfig:
    AssociationPropertyMetadata:
      Parameters:
        SelectOption:
          Type: String
          Description:
            en: |-
              Availability Zone Options. Valid values:
              * Auto
              * Manual
          AllowedValues:
            - Auto
            - Manual
          Required: true
    Type: Json
    Description:
      en: Availability Zone Configuration.
    Required: true
  Vpc:
    AssociationPropertyMetadata:
      Parameters:
        VpcId:
          AssociationProperty: ALIYUN::ECS::VPC::VPCId
          Type: String
          Description:
            en: The VPC network ID.
          Required: true
        Name:
          Type: String
          Description:
            en: The name of the VPC gateway.
          Required: false
    Type: Json
    Description:
      en: The VPC associated with the Gateway.
    Required: false
  PaymentType:
    AssociationProperty: InstanceChargeType
    Type: String
    Description:
      en: |-
        The payment type of the gateway. Valid values:
        * PayAsYouGo
        * Subscription
    AllowedValues:
      - PayAsYouGo
      - Subscription
    Required: true
    Default: PayAsYouGo
  Spec:
    Type: String
    Description:
      en: Gateway instance specifications.
    Required: true
    Default: apigw.small.x1
Resources:
  ExtensionResource:
    Type: ALIYUN::APIG::Gateway
    Properties:
      VSwitch:
        Ref: VSwitch
      ZoneConfig:
        Ref: ZoneConfig
      Vpc:
        Ref: Vpc
      PaymentType:
        Ref: PaymentType
      Spec:
        Ref: Spec
Outputs:
  CreateTime:
    Description: 'The creation timestamp. Unit: milliseconds.'
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - CreateTime
  Vpc:
    Description: The VPC associated with the Gateway.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Vpc
  LoadBalancers:
    Description: The list of Gateway ingress addresses.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - LoadBalancers
  SecurityGroup:
    Description: The Security Group of the Gateway.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - SecurityGroup
  GatewayId:
    Description: The ID of the Gateway.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - GatewayId
  Zones:
    Description: The List of zones associated with the Gateway.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Zones
  VSwitch:
    Description: The virtual switch associated with the Gateway.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - VSwitch
  Version:
    Description: The gateway version.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Version
  UpdateTime:
    Description: 'Update the timestamp. Unit: milliseconds.'
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - UpdateTime
  PaymentType:
    Description: The payment type of the gateway.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - PaymentType
  GatewayName:
    Description: The name of the resource.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - GatewayName
  ExpireTime:
    Description: 'Package year and package month expiration timestamp. Unit: milliseconds.'
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ExpireTime
  Spec:
    Description: Gateway instance specifications.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Spec
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Metadata": {
    "ALIYUN::ROS::Interface": {
      "ParameterGroups": [
        {
          "Parameters": [
            "Vpc",
            "ZoneConfig",
            "VSwitch"
          ],
          "Label": {
            "default": {
              "en": "Network Configuration"
            }
          }
        },
        {
          "Parameters": [
            "PaymentType",
            "Spec"
          ],
          "Label": {
            "default": {
              "en": "Gateway Configuration"
            }
          }
        }
      ]
    }
  },
  "Parameters": {
    "VSwitch": {
      "AssociationPropertyMetadata": {
        "Parameters": {
          "VSwitchId": {
            "AssociationPropertyMetadata": {
              "VpcId": "${Vpc.VpcId}"
            },
            "AssociationProperty": "ALIYUN::VPC::VSwitch::VSwitchId",
            "Type": "String",
            "Description": {
              "en": "The ID of the VSwitch."
            },
            "Required": true
          },
          "Name": {
            "Type": "String",
            "Description": {
              "en": "The name of the VSwitch."
            },
            "Required": false
          }
        }
      },
      "Type": "Json",
      "Description": {
        "en": "The virtual switch associated with the Gateway."
      },
      "Required": false
    },
    "ZoneConfig": {
      "AssociationPropertyMetadata": {
        "Parameters": {
          "SelectOption": {
            "Type": "String",
            "Description": {
              "en": "Availability Zone Options. Valid values:\n* Auto\n* Manual"
            },
            "AllowedValues": [
              "Auto",
              "Manual"
            ],
            "Required": true
          }
        }
      },
      "Type": "Json",
      "Description": {
        "en": "Availability Zone Configuration."
      },
      "Required": true
    },
    "Vpc": {
      "AssociationPropertyMetadata": {
        "Parameters": {
          "VpcId": {
            "AssociationProperty": "ALIYUN::ECS::VPC::VPCId",
            "Type": "String",
            "Description": {
              "en": "The VPC network ID."
            },
            "Required": true
          },
          "Name": {
            "Type": "String",
            "Description": {
              "en": "The name of the VPC gateway."
            },
            "Required": false
          }
        }
      },
      "Type": "Json",
      "Description": {
        "en": "The VPC associated with the Gateway."
      },
      "Required": false
    },
    "PaymentType": {
      "AssociationProperty": "InstanceChargeType",
      "Type": "String",
      "Description": {
        "en": "The payment type of the gateway. Valid values:\n* PayAsYouGo\n* Subscription"
      },
      "AllowedValues": [
        "PayAsYouGo",
        "Subscription"
      ],
      "Required": true,
      "Default": "PayAsYouGo"
    },
    "Spec": {
      "Type": "String",
      "Description": {
        "en": "Gateway instance specifications."
      },
      "Required": true,
      "Default":"apigw.small.x1"
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::APIG::Gateway",
      "Properties": {
        "VSwitch": {
          "Ref": "VSwitch"
        },
        "ZoneConfig": {
          "Ref": "ZoneConfig"
        },
        "Vpc": {
          "Ref": "Vpc"
        },
        "PaymentType": {
          "Ref": "PaymentType"
        },
        "Spec": {
          "Ref": "Spec"
        }
      }
    }
  },
  "Outputs": {
    "CreateTime": {
      "Description": "The creation timestamp. Unit: milliseconds.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "CreateTime"
        ]
      }
    },
    "Vpc": {
      "Description": "The VPC associated with the Gateway.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Vpc"
        ]
      }
    },
    "LoadBalancers": {
      "Description": "The list of Gateway ingress addresses.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "LoadBalancers"
        ]
      }
    },
    "SecurityGroup": {
      "Description": "The Security Group of the Gateway.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "SecurityGroup"
        ]
      }
    },
    "GatewayId": {
      "Description": "The ID of the Gateway.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "GatewayId"
        ]
      }
    },
    "Zones": {
      "Description": "The List of zones associated with the Gateway.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Zones"
        ]
      }
    },
    "VSwitch": {
      "Description": "The virtual switch associated with the Gateway.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "VSwitch"
        ]
      }
    },
    "Version": {
      "Description": "The gateway version.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Version"
        ]
      }
    },
    "UpdateTime": {
      "Description": "Update the timestamp. Unit: milliseconds.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "UpdateTime"
        ]
      }
    },
    "PaymentType": {
      "Description": "The payment type of the gateway.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "PaymentType"
        ]
      }
    },
    "GatewayName": {
      "Description": "The name of the resource.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "GatewayName"
        ]
      }
    },
    "ExpireTime": {
      "Description": "Package year and package month expiration timestamp. Unit: milliseconds.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ExpireTime"
        ]
      }
    },
    "Spec": {
      "Description": "Gateway instance specifications.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Spec"
        ]
      }
    }
  }
}