全部产品
Search
文档中心

资源编排:ALIYUN::POLARDB::Application

更新时间:Feb 26, 2026

ALIYUN::POLARDB::Application类型用于创建PolarDB应用。

语法

{
  "Type": "ALIYUN::POLARDB::Application",
  "Properties": {
    "Architecture": String,
    "ApplicationType": String,
    "DBClusterId": String,
    "AutoCreatePolarFs": Boolean,
    "Components": List,
    "Description": String,
    "Period": Integer,
    "PayType": String,
    "PolarFSInstanceId": String,
    "SecurityGroupId": String,
    "SecurityIPList": String,
    "VSwitchId": String,
    "VpcId": String,
    "ZoneId": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

Architecture

String

CPU 架构。

取值:

  • x86

ApplicationType

String

应用类型。

取值:

  • supabase: 若创建托管 Supabase 应用,请传入此值

  • raycluster: 若创建托管 Ray Cluster 应用,请传入此值

DBClusterId

String

应用依赖的 PolarDB 实例 ID。

AutoCreatePolarFs

Boolean

是否自动创建冷存版 PolarFs。

取值:

  • false(默认):不自动创建。

  • true:自动创建。

Components

List

用户自定义的应用子组件列表。

更多信息,请参考Components属性

Description

String

应用描述。

Period

Integer

包年包月类型。

PayType

String

付费类型。

取值:

  • Postpaid:按量付费

  • Prepaid:包年包月

PolarFSInstanceId

String

PolarFS 冷存版/高性能版实例 ID。

默认为空,若传入则将相应存储挂载到应用中

目前仅如下应用支持

  • supabase

  • raycluster

SecurityGroupId

String

安全组ID。

SecurityIPList

String

应用子组件的白名单 IP 地址。

VSwitchId

String

交换机。

VpcId

String

专有网络。

ZoneId

String

可用区。

Components语法

"Components": [
  {
    "SecurityGroups": String,
    "ComponentType": String,
    "SecurityIPType": String,
    "SecurityIPList": String,
    "ComponentReplica": String,
    "SecurityIPArrayName": String,
    "ScaleMin": Integer,
    "ScaleMax": Integer,
    "ComponentMaxReplica": Integer,
    "ComponentClass": String
  }
]

Components属性

属性名称

类型

必须

允许更新

描述

约束

ComponentClass

String

应用子组件的规格。

ComponentMaxReplica

Integer

同一规格应用子组件的最大数量。

默认等于 ComponentReplica。

  • 仅 raycluster 支持该参数

ComponentReplica

String

应用子组件的副本数量。

默认为 1。

ComponentType

String

应用子组件的类型。

对于 supabase,取值范围为

  • gateway

  • backend

对于 raycluster,取值范围为

  • head

  • worker

  • gpuworker

ScaleMax

Integer

组件的最大副本数。

ScaleMin

Integer

组件的最小副本数。

SecurityGroups

String

应用子组件的安全组列表。

SecurityIPArrayName

String

应用子组件白名单 IP 地址组的名称。

默认为 default。

SecurityIPList

String

应用子组件的白名单 IP 地址。

SecurityIPType

String

应用子组件的白名单 IP 的类型,

默认为 ipv4。

返回值

Fn::GetAtt

ApplicationId:应用 ID

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  Architecture:
    Type: String
    Description:
      en: The architecture of the application. This parameter is required.
    AllowedValues:
      - x86
    Required: true
  ZoneId:
    AssociationProperty: ZoneId
    Type: String
    Description:
      en: The ID of the zone.
    Required: false
  SecurityGroupId:
    AssociationPropertyMetadata:
      VpcId: ${VpcId}
    AssociationProperty: ALIYUN::ECS::SecurityGroup::SecurityGroupId
    Type: String
    Description:
      en: The ID of the security group.
    Required: false
  VSwitchId:
    AssociationPropertyMetadata:
      VpcId: ${VpcId}
      ZoneId: ${ZoneId}
    AssociationProperty: ALIYUN::VPC::VSwitch::VSwitchId
    Type: String
    Description:
      en: The ID of the VSwitch.
    Required: false
  DBClusterId:
    Type: String
    Description:
      en: The ID of the database cluster.
    Required: true
  ApplicationType:
    Type: String
    Description:
      en: The type of the application. This parameter is required.
    AllowedValues:
      - supabase
      - raycluster
    Required: true
  VpcId:
    AssociationProperty: ALIYUN::ECS::VPC::VPCId
    Type: String
    Description:
      en: The ID of the VPC.
    Required: false
Resources:
  Application:
    Type: ALIYUN::POLARDB::Application
    Properties:
      Architecture:
        Ref: Architecture
      ZoneId:
        Ref: ZoneId
      SecurityGroupId:
        Ref: SecurityGroupId
      VSwitchId:
        Ref: VSwitchId
      DBClusterId:
        Ref: DBClusterId
      ApplicationType:
        Ref: ApplicationType
      VpcId:
        Ref: VpcId
Outputs:
  ApplicationId:
    Description: The ID of the application.
    Value:
      Fn::GetAtt:
        - Application
        - ApplicationId
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "Architecture": {
      "Type": "String",
      "Description": {
        "en": "The architecture of the application. This parameter is required."
      },
      "AllowedValues": [
        "x86"
      ],
      "Required": true
    },
    "ZoneId": {
      "AssociationProperty": "ZoneId",
      "Type": "String",
      "Description": {
        "en": "The ID of the zone."
      },
      "Required": false
    },
    "SecurityGroupId": {
      "AssociationPropertyMetadata": {
        "VpcId": "${VpcId}"
      },
      "AssociationProperty": "ALIYUN::ECS::SecurityGroup::SecurityGroupId",
      "Type": "String",
      "Description": {
        "en": "The ID of the security group."
      },
      "Required": false
    },
    "VSwitchId": {
      "AssociationPropertyMetadata": {
        "VpcId": "${VpcId}",
        "ZoneId": "${ZoneId}"
      },
      "AssociationProperty": "ALIYUN::VPC::VSwitch::VSwitchId",
      "Type": "String",
      "Description": {
        "en": "The ID of the VSwitch."
      },
      "Required": false
    },
    "DBClusterId": {
      "Type": "String",
      "Description": {
        "en": "The ID of the database cluster."
      },
      "Required": true
    },
    "ApplicationType": {
      "Type": "String",
      "Description": {
        "en": "The type of the application. This parameter is required."
      },
      "AllowedValues": [
        "supabase",
        "raycluster"
      ],
      "Required": true
    },
    "VpcId": {
      "AssociationProperty": "ALIYUN::ECS::VPC::VPCId",
      "Type": "String",
      "Description": {
        "en": "The ID of the VPC."
      },
      "Required": false
    }
  },
  "Resources": {
    "Application": {
      "Type": "ALIYUN::POLARDB::Application",
      "Properties": {
        "Architecture": {
          "Ref": "Architecture"
        },
        "ZoneId": {
          "Ref": "ZoneId"
        },
        "SecurityGroupId": {
          "Ref": "SecurityGroupId"
        },
        "VSwitchId": {
          "Ref": "VSwitchId"
        },
        "DBClusterId": {
          "Ref": "DBClusterId"
        },
        "ApplicationType": {
          "Ref": "ApplicationType"
        },
        "VpcId": {
          "Ref": "VpcId"
        }
      }
    }
  },
  "Outputs": {
    "ApplicationId": {
      "Description": "The ID of the application.",
      "Value": {
        "Fn::GetAtt": [
          "Application",
          "ApplicationId"
        ]
      }
    }
  }
}