All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::Milvus::Instance

Última atualização: Oct 10, 2026

The ALIYUN::Milvus::Instance type is used to create a Milvus instance.

Syntax

{
  "Type": "ALIYUN::Milvus::Instance",
  "Properties": {
    "Components": List,
    "DbAdminPassword": String,
    "DbVersion": String,
    "InstanceName": String,
    "PaymentType": String,
    "VpcId": String,
    "VSwitchIds": List,
    "ZoneId": String,
    "AiFunction": Boolean,
    "AutoBackup": Boolean,
    "AutoPay": Boolean,
    "AutoRenew": Boolean,
    "BackupRestoreInfo": Map,
    "Configuration": String,
    "Encrypted": Boolean,
    "Ha": Boolean,
    "IsMultiAzStorage": Boolean,
    "KmsKeyId": String,
    "LoadReplicas": Integer,
    "MultiZoneMode": String,
    "PaymentDuration": Integer,
    "PaymentDurationUnit": String,
    "PromotionNo": String,
    "ResourceGroupId": String,
    "Tags": List
  }
}

Properties

Property

Type

Required

Editable

Description

Constraints

Components

List

Yes

No

The component specifications of the instance.

For more information, see Components properties.

DbAdminPassword

String

Yes

No

The database administrator password.

The password must be 8 to 30 characters in length and must contain at least one uppercase letter, one lowercase letter, one digit, and one special character. The supported special characters are @, #, $, %, ^, *, _, +, and -.

DbVersion

String

Yes

No

The database engine version.

None

InstanceName

String

Yes

No

The name of the instance.

None

PaymentType

String

Yes

No

The billing method of the instance.

Valid values:

  • PayAsYouGo

  • Subscription

VpcId

String

Yes

No

The VPC ID.

None

VSwitchIds

List

Yes

No

The vSwitch configuration.

For more information, see VSwitchIds properties.

ZoneId

String

Yes

No

The ID of the primary zone of the instance.

None

AiFunction

Boolean

No

No

Specifies whether to enable the AI function.

None

AutoBackup

Boolean

No

No

Specifies whether to enable automatic backup.

None

AutoPay

Boolean

No

No

Specifies whether to automatically pay for the order.

None

AutoRenew

Boolean

No

No

Specifies whether to enable auto-renewal for the subscription.

None

BackupRestoreInfo

Map

No

No

The backup restoration information.

For more information, see BackupRestoreInfo properties.

Configuration

String

No

No

The instance configuration in YAML format.

None

Encrypted

Boolean

No

No

Specifies whether to enable OSS encryption.

None

Ha

Boolean

No

No

Specifies whether to enable high availability (HA).

None

IsMultiAzStorage

Boolean

No

No

Specifies whether to enable multi-zone storage.

None

KmsKeyId

String

No

No

The ID of the Key Management Service (KMS) key used for encryption.

None

LoadReplicas

Integer

No

No

The number of load replicas.

None

MultiZoneMode

String

No

No

The multi-zone deployment mode.

Valid values:

  • Single: single-zone deployment

  • Two_ha: dual-zone deployment with high availability

  • Two: dual-zone deployment

PaymentDuration

Integer

No

No

The subscription duration.

None

PaymentDurationUnit

String

No

No

The unit of the subscription duration.

Valid values:

  • Month

  • Year

PromotionNo

String

No

No

The promotion number.

None

ResourceGroupId

String

No

No

The resource group ID.

None

Tags

List

No

No

The tags to attach to the Milvus instance.

For more information, see Tags properties.

Components syntax

"Components": [
  {
    "CuNum": Integer,
    "Replica": Integer,
    "Type": String,
    "CuType": String,
    "DiskSizeType": String
  }
]

Components properties

Property

Type

Required

Editable

Description

Constraints

CuNum

Integer

Yes

No

The number of compute units.

None

Replica

Integer

Yes

No

The number of component replicas.

None

Type

String

Yes

No

The component type.

Valid values:

  • proxy

  • mix_coordinator

  • data

  • query

  • standalone

  • index

  • streaming

CuType

String

No

No

The compute unit type.

None

DiskSizeType

String

No

No

The disk size type.

Valid values:

  • Large

  • Normal

BackupRestoreInfo syntax

"BackupRestoreInfo": {
  "BackupId": String,
  "BackupName": String,
  "SourceClusterId": String
}

BackupRestoreInfo properties

Property

Type

Required

Editable

Description

Constraints

BackupId

String

No

No

The backup ID.

None

BackupName

String

No

No

The backup name.

None

SourceClusterId

String

No

No

The source cluster ID.

None

Tags syntax

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

Tags properties

Property

Type

Required

Editable

Description

Constraints

Key

String

Yes

No

The tag key.

None

Value

String

No

No

The tag value.

None

VSwitchIds syntax

"VSwitchIds": [
  {
    "VswId": String,
    "ZoneId": String
  }
]

VSwitchIds properties

Property

Type

Required

Editable

Description

Constraints

VswId

String

Yes

No

The vSwitch ID.

None

ZoneId

String

Yes

No

The zone ID of the vSwitch.

None

Return values

Fn::GetAtt

  • InstanceId: The instance ID.

Examples

Scenario 1: Create a Milvus standalone instance

ROSTemplateFormatVersion: '2015-09-01'
Description:
  zh-cn: 在已有VPC网络下创建一个简单的Milvus单机版实例,使用standalone组件和按量付费模式。
  en: Create a simple Milvus standalone instance in an existing VPC network with standalone component and pay-as-you-go billing.
Parameters:
  ZoneId:
    Type: String
    Label:
      zh-cn: 可用区
      en: Availability Zone
    Description:
      zh-cn: 实例所在的可用区。
      en: The availability zone of the instance.
    AssociationProperty: ALIYUN::ECS::Instance::ZoneId
    AssociationPropertyMetadata:
      AutoSelectFirst: true
  VpcId:
    Type: String
    Label:
      zh-cn: VPC ID
      en: VPC ID
    Description:
      zh-cn: 实例所属的VPC。
      en: The VPC for the instance.
    AssociationProperty: ALIYUN::ECS::VPC::VPCId
  VSwitchId:
    Type: String
    Label:
      zh-cn: 交换机ID
      en: VSwitch ID
    Description:
      zh-cn: 实例所属的交换机。
      en: The VSwitch for the instance.
    AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
    AssociationPropertyMetadata:
      VpcId: ${VpcId}
      ZoneId: ${ZoneId}
  InstanceName:
    Type: String
    Label:
      zh-cn: 实例名称
      en: Instance Name
    Description:
      zh-cn: Milvus实例的名称。
      en: The name of the Milvus instance.
    Default: my-milvus-instance
    MinLength: 1
  DbAdminPassword:
    Type: String
    Label:
      zh-cn: 管理员密码
      en: Admin Password
    Description:
      zh-cn: 数据库管理员密码,8-30个字符,必须包含大写字母、小写字母、数字和特殊字符(@#$%^*_+-)。
      en: Database admin password, 8-30 characters, must contain uppercase, lowercase, digit and special character (@#$%^*_+-).
    NoEcho: true
    MinLength: 8
    MaxLength: 30
Resources:
  MilvusInstance:
    Type: ALIYUN::Milvus::Instance
    Properties:
      InstanceName:
        Ref: InstanceName
      DbAdminPassword:
        Ref: DbAdminPassword
      DbVersion: '2.5'
      PaymentType: PayAsYouGo
      ZoneId:
        Ref: ZoneId
      VpcId:
        Ref: VpcId
      VSwitchIds:
        - VswId:
            Ref: VSwitchId
          ZoneId:
            Ref: ZoneId
      Components:
        - Type: standalone
          CuNum: 2
          Replica: 1
Outputs:
  InstanceId:
    Description:
      zh-cn: Milvus实例ID。
      en: Milvus instance ID.
    Label:
      zh-cn: 实例ID
      en: Instance ID
    Value:
      Fn::GetAtt:
        - MilvusInstance
        - InstanceId
Metadata:
  ALIYUN::ROS::Interface:
    ParameterGroups:
      - Parameters:
          - ZoneId
          - VpcId
          - VSwitchId
          - InstanceName
          - DbAdminPassword
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": {
    "zh-cn": "在已有VPC网络下创建一个简单的Milvus单机版实例,使用standalone组件和按量付费模式。",
    "en": "Create a simple Milvus standalone instance in an existing VPC network with standalone component and pay-as-you-go billing."
  },
  "Parameters": {
    "ZoneId": {
      "Type": "String",
      "Label": {
        "zh-cn": "可用区",
        "en": "Availability Zone"
      },
      "Description": {
        "zh-cn": "实例所在的可用区。",
        "en": "The availability zone of the instance."
      },
      "AssociationProperty": "ALIYUN::ECS::Instance::ZoneId",
      "AssociationPropertyMetadata": {
        "AutoSelectFirst": true
      }
    },
    "VpcId": {
      "Type": "String",
      "Label": {
        "zh-cn": "VPC ID",
        "en": "VPC ID"
      },
      "Description": {
        "zh-cn": "实例所属的VPC。",
        "en": "The VPC for the instance."
      },
      "AssociationProperty": "ALIYUN::ECS::VPC::VPCId"
    },
    "VSwitchId": {
      "Type": "String",
      "Label": {
        "zh-cn": "交换机ID",
        "en": "VSwitch ID"
      },
      "Description": {
        "zh-cn": "实例所属的交换机。",
        "en": "The VSwitch for the instance."
      },
      "AssociationProperty": "ALIYUN::ECS::VSwitch::VSwitchId",
      "AssociationPropertyMetadata": {
        "VpcId": "${VpcId}",
        "ZoneId": "${ZoneId}"
      }
    },
    "InstanceName": {
      "Type": "String",
      "Label": {
        "zh-cn": "实例名称",
        "en": "Instance Name"
      },
      "Description": {
        "zh-cn": "Milvus实例的名称。",
        "en": "The name of the Milvus instance."
      },
      "Default": "my-milvus-instance",
      "MinLength": 1
    },
    "DbAdminPassword": {
      "Type": "String",
      "Label": {
        "zh-cn": "管理员密码",
        "en": "Admin Password"
      },
      "Description": {
        "zh-cn": "数据库管理员密码,8-30个字符,必须包含大写字母、小写字母、数字和特殊字符(@#$%^*_+-)。",
        "en": "Database admin password, 8-30 characters, must contain uppercase, lowercase, digit and special character (@#$%^*_+-)."
      },
      "NoEcho": true,
      "MinLength": 8,
      "MaxLength": 30
    }
  },
  "Resources": {
    "MilvusInstance": {
      "Type": "ALIYUN::Milvus::Instance",
      "Properties": {
        "InstanceName": {
          "Ref": "InstanceName"
        },
        "DbAdminPassword": {
          "Ref": "DbAdminPassword"
        },
        "DbVersion": "2.5",
        "PaymentType": "PayAsYouGo",
        "ZoneId": {
          "Ref": "ZoneId"
        },
        "VpcId": {
          "Ref": "VpcId"
        },
        "VSwitchIds": [
          {
            "VswId": {
              "Ref": "VSwitchId"
            },
            "ZoneId": {
              "Ref": "ZoneId"
            }
          }
        ],
        "Components": [
          {
            "Type": "standalone",
            "CuNum": 2,
            "Replica": 1
          }
        ]
      }
    }
  },
  "Outputs": {
    "InstanceId": {
      "Description": {
        "zh-cn": "Milvus实例ID。",
        "en": "Milvus instance ID."
      },
      "Label": {
        "zh-cn": "实例ID",
        "en": "Instance ID"
      },
      "Value": {
        "Fn::GetAtt": [
          "MilvusInstance",
          "InstanceId"
        ]
      }
    }
  },
  "Metadata": {
    "ALIYUN::ROS::Interface": {
      "ParameterGroups": [
        {
          "Parameters": [
            "ZoneId",
            "VpcId",
            "VSwitchId",
            "InstanceName",
            "DbAdminPassword"
          ]
        }
      ]
    }
  }
}

Scenario 2: Create a multi-component Milvus cluster instance

ROSTemplateFormatVersion: '2015-09-01'
Description:
  zh-cn: 创建VPC网络和多组件Milvus集群实例(proxy、query、data、index、coordinator、streaming),启用高可用和自动备份,实现生产级向量数据库服务。
  en: Create a VPC network and multi-component Milvus cluster instance (proxy, query, data, index, coordinator, streaming) with high availability and auto backup enabled for production-grade vector database service.
Parameters:
  ZoneId:
    Type: String
    Label:
      zh-cn: 可用区
      en: Availability Zone
    Description:
      zh-cn: 实例所在的可用区。
      en: The availability zone of the instance.
    AssociationProperty: ALIYUN::ECS::Instance::ZoneId
    AssociationPropertyMetadata:
      AutoSelectFirst: true
  CommonName:
    Type: String
    Label:
      zh-cn: 资源名称前缀
      en: Resource Name Prefix
    Description:
      zh-cn: 所有资源名称的统一前缀。
      en: Unified name prefix for all resources.
    Default: milvus-cluster
    MinLength: 1
    MaxLength: 50
  DbAdminPassword:
    Type: String
    Label:
      zh-cn: 管理员密码
      en: Admin Password
    Description:
      zh-cn: 数据库管理员密码,8-30个字符,必须包含大写字母、小写字母、数字和特殊字符(@#$%^*_+-)。
      en: Database admin password, 8-30 characters, must contain uppercase, lowercase, digit and special character (@#$%^*_+-).
    NoEcho: true
    MinLength: 8
    MaxLength: 30
  QueryCuNum:
    Type: Number
    Label:
      zh-cn: Query节点CU数量
      en: Query Node CU Count
    Description:
      zh-cn: Query组件的计算单元数量。
      en: The number of compute units for the query component.
    Default: 4
    MinValue: 1
  DataCuNum:
    Type: Number
    Label:
      zh-cn: Data节点CU数量
      en: Data Node CU Count
    Description:
      zh-cn: Data组件的计算单元数量。
      en: The number of compute units for the data component.
    Default: 4
    MinValue: 1
  IndexCuNum:
    Type: Number
    Label:
      zh-cn: Index节点CU数量
      en: Index Node CU Count
    Description:
      zh-cn: Index组件的计算单元数量。
      en: The number of compute units for the index component.
    Default: 2
    MinValue: 1
Resources:
  Vpc:
    Type: ALIYUN::ECS::VPC
    Properties:
      VpcName:
        Fn::Sub: ${CommonName}-vpc
      CidrBlock: 192.168.0.0/16
  VSwitch:
    Type: ALIYUN::ECS::VSwitch
    Properties:
      VSwitchName:
        Fn::Sub: ${CommonName}-vsw
      VpcId:
        Ref: Vpc
      CidrBlock: 192.168.0.0/24
      ZoneId:
        Ref: ZoneId
  MilvusInstance:
    Type: ALIYUN::Milvus::Instance
    DependsOn:
      - Vpc
      - VSwitch
    Properties:
      InstanceName:
        Fn::Sub: ${CommonName}-instance
      DbAdminPassword:
        Ref: DbAdminPassword
      DbVersion: '2.5'
      PaymentType: PayAsYouGo
      ZoneId:
        Ref: ZoneId
      VpcId:
        Ref: Vpc
      VSwitchIds:
        - VswId:
            Ref: VSwitch
          ZoneId:
            Ref: ZoneId
      Ha: true
      AutoBackup: true
      Components:
        - Type: proxy
          CuNum: 2
          Replica: 2
        - Type: query
          CuNum:
            Ref: QueryCuNum
          Replica: 2
        - Type: data
          CuNum:
            Ref: DataCuNum
          Replica: 2
        - Type: index
          CuNum:
            Ref: IndexCuNum
          Replica: 1
        - Type: mix_coordinator
          CuNum: 1
          Replica: 2
        - Type: streaming
          CuNum: 2
          Replica: 2
      Tags:
        - Key: Environment
          Value: Production
        - Key: Team
          Value: AI
        - Key: CreatedBy
          Value: ROS
Outputs:
  InstanceId:
    Description:
      zh-cn: Milvus实例ID。
      en: Milvus instance ID.
    Label:
      zh-cn: 实例ID
      en: Instance ID
    Value:
      Fn::GetAtt:
        - MilvusInstance
        - InstanceId
  VpcId:
    Description:
      zh-cn: VPC ID。
      en: VPC ID.
    Label:
      zh-cn: VPC ID
      en: VPC ID
    Value:
      Ref: Vpc
  VSwitchId:
    Description:
      zh-cn: 交换机ID。
      en: VSwitch ID.
    Label:
      zh-cn: 交换机ID
      en: VSwitch ID
    Value:
      Ref: VSwitch
Metadata:
  ALIYUN::ROS::Interface:
    ParameterGroups:
      - Parameters:
          - ZoneId
          - CommonName
          - DbAdminPassword
      - Parameters:
          - QueryCuNum
          - DataCuNum
          - IndexCuNum
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": {
    "zh-cn": "创建VPC网络和多组件Milvus集群实例(proxy、query、data、index、coordinator、streaming),启用高可用和自动备份,实现生产级向量数据库服务。",
    "en": "Create a VPC network and multi-component Milvus cluster instance (proxy, query, data, index, coordinator, streaming) with high availability and auto backup enabled for production-grade vector database service."
  },
  "Parameters": {
    "ZoneId": {
      "Type": "String",
      "Label": {
        "zh-cn": "可用区",
        "en": "Availability Zone"
      },
      "Description": {
        "zh-cn": "实例所在的可用区。",
        "en": "The availability zone of the instance."
      },
      "AssociationProperty": "ALIYUN::ECS::Instance::ZoneId",
      "AssociationPropertyMetadata": {
        "AutoSelectFirst": true
      }
    },
    "CommonName": {
      "Type": "String",
      "Label": {
        "zh-cn": "资源名称前缀",
        "en": "Resource Name Prefix"
      },
      "Description": {
        "zh-cn": "所有资源名称的统一前缀。",
        "en": "Unified name prefix for all resources."
      },
      "Default": "milvus-cluster",
      "MinLength": 1,
      "MaxLength": 50
    },
    "DbAdminPassword": {
      "Type": "String",
      "Label": {
        "zh-cn": "管理员密码",
        "en": "Admin Password"
      },
      "Description": {
        "zh-cn": "数据库管理员密码,8-30个字符,必须包含大写字母、小写字母、数字和特殊字符(@#$%^*_+-)。",
        "en": "Database admin password, 8-30 characters, must contain uppercase, lowercase, digit and special character (@#$%^*_+-)."
      },
      "NoEcho": true,
      "MinLength": 8,
      "MaxLength": 30
    },
    "QueryCuNum": {
      "Type": "Number",
      "Label": {
        "zh-cn": "Query节点CU数量",
        "en": "Query Node CU Count"
      },
      "Description": {
        "zh-cn": "Query组件的计算单元数量。",
        "en": "The number of compute units for the query component."
      },
      "Default": 4,
      "MinValue": 1
    },
    "DataCuNum": {
      "Type": "Number",
      "Label": {
        "zh-cn": "Data节点CU数量",
        "en": "Data Node CU Count"
      },
      "Description": {
        "zh-cn": "Data组件的计算单元数量。",
        "en": "The number of compute units for the data component."
      },
      "Default": 4,
      "MinValue": 1
    },
    "IndexCuNum": {
      "Type": "Number",
      "Label": {
        "zh-cn": "Index节点CU数量",
        "en": "Index Node CU Count"
      },
      "Description": {
        "zh-cn": "Index组件的计算单元数量。",
        "en": "The number of compute units for the index component."
      },
      "Default": 2,
      "MinValue": 1
    }
  },
  "Resources": {
    "Vpc": {
      "Type": "ALIYUN::ECS::VPC",
      "Properties": {
        "VpcName": {
          "Fn::Sub": "${CommonName}-vpc"
        },
        "CidrBlock": "192.168.0.0/16"
      }
    },
    "VSwitch": {
      "Type": "ALIYUN::ECS::VSwitch",
      "Properties": {
        "VSwitchName": {
          "Fn::Sub": "${CommonName}-vsw"
        },
        "VpcId": {
          "Ref": "Vpc"
        },
        "CidrBlock": "192.168.0.0/24",
        "ZoneId": {
          "Ref": "ZoneId"
        }
      }
    },
    "MilvusInstance": {
      "Type": "ALIYUN::Milvus::Instance",
      "DependsOn": [
        "Vpc",
        "VSwitch"
      ],
      "Properties": {
        "InstanceName": {
          "Fn::Sub": "${CommonName}-instance"
        },
        "DbAdminPassword": {
          "Ref": "DbAdminPassword"
        },
        "DbVersion": "2.5",
        "PaymentType": "PayAsYouGo",
        "ZoneId": {
          "Ref": "ZoneId"
        },
        "VpcId": {
          "Ref": "Vpc"
        },
        "VSwitchIds": [
          {
            "VswId": {
              "Ref": "VSwitch"
            },
            "ZoneId": {
              "Ref": "ZoneId"
            }
          }
        ],
        "Ha": true,
        "AutoBackup": true,
        "Components": [
          {
            "Type": "proxy",
            "CuNum": 2,
            "Replica": 2
          },
          {
            "Type": "query",
            "CuNum": {
              "Ref": "QueryCuNum"
            },
            "Replica": 2
          },
          {
            "Type": "data",
            "CuNum": {
              "Ref": "DataCuNum"
            },
            "Replica": 2
          },
          {
            "Type": "index",
            "CuNum": {
              "Ref": "IndexCuNum"
            },
            "Replica": 1
          },
          {
            "Type": "mix_coordinator",
            "CuNum": 1,
            "Replica": 2
          },
          {
            "Type": "streaming",
            "CuNum": 2,
            "Replica": 2
          }
        ],
        "Tags": [
          {
            "Key": "Environment",
            "Value": "Production"
          },
          {
            "Key": "Team",
            "Value": "AI"
          },
          {
            "Key": "CreatedBy",
            "Value": "ROS"
          }
        ]
      }
    }
  },
  "Outputs": {
    "InstanceId": {
      "Description": {
        "zh-cn": "Milvus实例ID。",
        "en": "Milvus instance ID."
      },
      "Label": {
        "zh-cn": "实例ID",
        "en": "Instance ID"
      },
      "Value": {
        "Fn::GetAtt": [
          "MilvusInstance",
          "InstanceId"
        ]
      }
    },
    "VpcId": {
      "Description": {
        "zh-cn": "VPC ID。",
        "en": "VPC ID."
      },
      "Label": {
        "zh-cn": "VPC ID",
        "en": "VPC ID"
      },
      "Value": {
        "Ref": "Vpc"
      }
    },
    "VSwitchId": {
      "Description": {
        "zh-cn": "交换机ID。",
        "en": "VSwitch ID."
      },
      "Label": {
        "zh-cn": "交换机ID",
        "en": "VSwitch ID"
      },
      "Value": {
        "Ref": "VSwitch"
      }
    }
  },
  "Metadata": {
    "ALIYUN::ROS::Interface": {
      "ParameterGroups": [
        {
          "Parameters": [
            "ZoneId",
            "CommonName",
            "DbAdminPassword"
          ]
        },
        {
          "Parameters": [
            "QueryCuNum",
            "DataCuNum",
            "IndexCuNum"
          ]
        }
      ]
    }
  }
}

Scenario 3: Create an enterprise-level vector database platform

ROSTemplateFormatVersion: '2015-09-01'
Description:
  zh-cn: 创建完整的企业级向量数据库平台,包含多可用区VPC网络、Milvus集群(多组件+多可用区存储+KMS加密+自定义配置+AI函数),实现高可用、安全加密的向量检索服务。
  en: Create a complete enterprise-level vector database platform including multi-AZ VPC network, Milvus cluster with multi-component, multi-AZ storage, KMS encryption, custom configuration and AI function for highly available and securely encrypted vector search service.
Parameters:
  ZoneId:
    Type: String
    Label:
      zh-cn: 主可用区
      en: Primary Availability Zone
    Description:
      zh-cn: 实例所在的主可用区。
      en: The primary availability zone of the instance.
    AssociationProperty: ALIYUN::ECS::Instance::ZoneId
    AssociationPropertyMetadata:
      AutoSelectFirst: true
  ZoneId2:
    Type: String
    Label:
      zh-cn: 备可用区
      en: Secondary Availability Zone
    Description:
      zh-cn: 多可用区部署的备可用区,需与主可用区不同。
      en: The secondary availability zone for multi-AZ deployment. Must be different from the primary zone.
    AssociationProperty: ALIYUN::ECS::Instance::ZoneId
  CommonName:
    Type: String
    Label:
      zh-cn: 资源名称前缀
      en: Resource Name Prefix
    Description:
      zh-cn: 所有资源名称的统一前缀。
      en: Unified name prefix for all resources.
    Default: milvus-platform
    MinLength: 1
    MaxLength: 50
  DbAdminPassword:
    Type: String
    Label:
      zh-cn: 管理员密码
      en: Admin Password
    Description:
      zh-cn: 数据库管理员密码,8-30个字符,必须包含大写字母、小写字母、数字和特殊字符(@#$%^*_+-)。
      en: Database admin password, 8-30 characters, must contain uppercase, lowercase, digit and special character (@#$%^*_+-).
    NoEcho: true
    MinLength: 8
    MaxLength: 30
  DbVersion:
    Type: String
    Label:
      zh-cn: 数据库引擎版本
      en: Database Engine Version
    Description:
      zh-cn: Milvus数据库引擎版本。
      en: The Milvus database engine version.
    Default: '2.5'
  QueryCuNum:
    Type: Number
    Label:
      zh-cn: Query节点CU数量
      en: Query Node CU Count
    Description:
      zh-cn: Query组件的计算单元数量。
      en: The number of compute units for the query component.
    Default: 8
    MinValue: 1
  DataCuNum:
    Type: Number
    Label:
      zh-cn: Data节点CU数量
      en: Data Node CU Count
    Description:
      zh-cn: Data组件的计算单元数量。
      en: The number of compute units for the data component.
    Default: 8
    MinValue: 1
  IndexCuNum:
    Type: Number
    Label:
      zh-cn: Index节点CU数量
      en: Index Node CU Count
    Description:
      zh-cn: Index组件的计算单元数量。
      en: The number of compute units for the index component.
    Default: 4
    MinValue: 1
  ProxyReplica:
    Type: Number
    Label:
      zh-cn: Proxy副本数
      en: Proxy Replica Count
    Description:
      zh-cn: Proxy组件的副本数量。
      en: The number of replicas for the proxy component.
    Default: 2
    MinValue: 1
  QueryReplica:
    Type: Number
    Label:
      zh-cn: Query副本数
      en: Query Replica Count
    Description:
      zh-cn: Query组件的副本数量。
      en: The number of replicas for the query component.
    Default: 2
    MinValue: 1
  LoadReplicas:
    Type: Number
    Label:
      zh-cn: 加载副本数
      en: Load Replicas
    Description:
      zh-cn: 数据加载的副本数量。
      en: The number of load replicas.
    Default: 2
    MinValue: 1
  EnableEncryption:
    Type: String
    Label:
      zh-cn: 是否启用OSS加密
      en: Enable OSS Encryption
    Description:
      zh-cn: 是否为Milvus实例启用OSS存储加密。
      en: Whether to enable OSS storage encryption for the Milvus instance.
    AllowedValues:
      - 'true'
      - 'false'
    Default: 'true'
  EnableAiFunction:
    Type: String
    Label:
      zh-cn: 是否启用AI函数
      en: Enable AI Function
    Description:
      zh-cn: 是否为Milvus实例启用AI函数功能。
      en: Whether to enable AI function for the Milvus instance.
    AllowedValues:
      - 'true'
      - 'false'
    Default: 'true'
Conditions:
  Encrypted:
    Fn::Equals:
      - Ref: EnableEncryption
      - 'true'
  AiFunction:
    Fn::Equals:
      - Ref: EnableAiFunction
      - 'true'
Resources:
  Vpc:
    Type: ALIYUN::ECS::VPC
    Properties:
      VpcName:
        Fn::Sub: ${CommonName}-vpc
      CidrBlock: 172.16.0.0/16
  VSwitchPrimary:
    Type: ALIYUN::ECS::VSwitch
    Properties:
      VSwitchName:
        Fn::Sub: ${CommonName}-vsw-primary
      VpcId:
        Ref: Vpc
      CidrBlock: 172.16.0.0/24
      ZoneId:
        Ref: ZoneId
  VSwitchSecondary:
    Type: ALIYUN::ECS::VSwitch
    Properties:
      VSwitchName:
        Fn::Sub: ${CommonName}-vsw-secondary
      VpcId:
        Ref: Vpc
      CidrBlock: 172.16.1.0/24
      ZoneId:
        Ref: ZoneId2
  MilvusInstance:
    Type: ALIYUN::Milvus::Instance
    DependsOn:
      - Vpc
      - VSwitchPrimary
      - VSwitchSecondary
    Properties:
      InstanceName:
        Fn::Sub: ${CommonName}-instance
      DbAdminPassword:
        Ref: DbAdminPassword
      DbVersion:
        Ref: DbVersion
      PaymentType: PayAsYouGo
      ZoneId:
        Ref: ZoneId
      VpcId:
        Ref: Vpc
      VSwitchIds:
        - VswId:
            Ref: VSwitchPrimary
          ZoneId:
            Ref: ZoneId
        - VswId:
            Ref: VSwitchSecondary
          ZoneId:
            Ref: ZoneId2
      Ha: true
      MultiZoneMode: Two
      IsMultiAzStorage: true
      AutoBackup: true
      Encrypted:
        Ref: EnableEncryption
      AiFunction:
        Ref: EnableAiFunction
      LoadReplicas:
        Ref: LoadReplicas
      Components:
        - Type: proxy
          CuNum: 2
          Replica:
            Ref: ProxyReplica
        - Type: query
          CuNum:
            Ref: QueryCuNum
          Replica:
            Ref: QueryReplica
          DiskSizeType: Large
        - Type: data
          CuNum:
            Ref: DataCuNum
          Replica: 2
        - Type: index
          CuNum:
            Ref: IndexCuNum
          Replica: 2
        - Type: mix_coordinator
          CuNum: 1
          Replica: 2
        - Type: streaming
          CuNum: 4
          Replica: 2
      Configuration: |-
        dataCoord:
          segment:
            maxSize: 1024
            sealProportion: 0.12
        queryCoord:
          balance:
            autoBalance: true
        common:
          security:
            superUsers: root
      Tags:
        - Key: Environment
          Value: Production
        - Key: Team
          Value: AI
        - Key: CreatedBy
          Value: ROS
        - Key: CostCenter
          Value: VectorSearch
        - Key: DataClassification
          Value: Confidential
Outputs:
  InstanceId:
    Description:
      zh-cn: Milvus实例ID。
      en: Milvus instance ID.
    Label:
      zh-cn: 实例ID
      en: Instance ID
    Value:
      Fn::GetAtt:
        - MilvusInstance
        - InstanceId
  VpcId:
    Description:
      zh-cn: VPC ID。
      en: VPC ID.
    Label:
      zh-cn: VPC ID
      en: VPC ID
    Value:
      Ref: Vpc
  VSwitchPrimaryId:
    Description:
      zh-cn: 主可用区交换机ID。
      en: Primary zone VSwitch ID.
    Label:
      zh-cn: 主交换机ID
      en: Primary VSwitch ID
    Value:
      Ref: VSwitchPrimary
  VSwitchSecondaryId:
    Description:
      zh-cn: 备可用区交换机ID。
      en: Secondary zone VSwitch ID.
    Label:
      zh-cn: 备交换机ID
      en: Secondary VSwitch ID
    Value:
      Ref: VSwitchSecondary
Metadata:
  ALIYUN::ROS::Interface:
    ParameterGroups:
      - Parameters:
          - ZoneId
          - ZoneId2
          - CommonName
          - DbAdminPassword
          - DbVersion
      - Parameters:
          - QueryCuNum
          - DataCuNum
          - IndexCuNum
          - ProxyReplica
          - QueryReplica
          - LoadReplicas
      - Parameters:
          - EnableEncryption
          - EnableAiFunction
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": {
    "zh-cn": "创建完整的企业级向量数据库平台,包含多可用区VPC网络、Milvus集群(多组件+多可用区存储+KMS加密+自定义配置+AI函数),实现高可用、安全加密的向量检索服务。",
    "en": "Create a complete enterprise-level vector database platform including multi-AZ VPC network, Milvus cluster with multi-component, multi-AZ storage, KMS encryption, custom configuration and AI function for highly available and securely encrypted vector search service."
  },
  "Parameters": {
    "ZoneId": {
      "Type": "String",
      "Label": {
        "zh-cn": "主可用区",
        "en": "Primary Availability Zone"
      },
      "Description": {
        "zh-cn": "实例所在的主可用区。",
        "en": "The primary availability zone of the instance."
      },
      "AssociationProperty": "ALIYUN::ECS::Instance::ZoneId",
      "AssociationPropertyMetadata": {
        "AutoSelectFirst": true
      }
    },
    "ZoneId2": {
      "Type": "String",
      "Label": {
        "zh-cn": "备可用区",
        "en": "Secondary Availability Zone"
      },
      "Description": {
        "zh-cn": "多可用区部署的备可用区,需与主可用区不同。",
        "en": "The secondary availability zone for multi-AZ deployment. Must be different from the primary zone."
      },
      "AssociationProperty": "ALIYUN::ECS::Instance::ZoneId"
    },
    "CommonName": {
      "Type": "String",
      "Label": {
        "zh-cn": "资源名称前缀",
        "en": "Resource Name Prefix"
      },
      "Description": {
        "zh-cn": "所有资源名称的统一前缀。",
        "en": "Unified name prefix for all resources."
      },
      "Default": "milvus-platform",
      "MinLength": 1,
      "MaxLength": 50
    },
    "DbAdminPassword": {
      "Type": "String",
      "Label": {
        "zh-cn": "管理员密码",
        "en": "Admin Password"
      },
      "Description": {
        "zh-cn": "数据库管理员密码,8-30个字符,必须包含大写字母、小写字母、数字和特殊字符(@#$%^*_+-)。",
        "en": "Database admin password, 8-30 characters, must contain uppercase, lowercase, digit and special character (@#$%^*_+-)."
      },
      "NoEcho": true,
      "MinLength": 8,
      "MaxLength": 30
    },
    "DbVersion": {
      "Type": "String",
      "Label": {
        "zh-cn": "数据库引擎版本",
        "en": "Database Engine Version"
      },
      "Description": {
        "zh-cn": "Milvus数据库引擎版本。",
        "en": "The Milvus database engine version."
      },
      "Default": "2.5"
    },
    "QueryCuNum": {
      "Type": "Number",
      "Label": {
        "zh-cn": "Query节点CU数量",
        "en": "Query Node CU Count"
      },
      "Description": {
        "zh-cn": "Query组件的计算单元数量。",
        "en": "The number of compute units for the query component."
      },
      "Default": 8,
      "MinValue": 1
    },
    "DataCuNum": {
      "Type": "Number",
      "Label": {
        "zh-cn": "Data节点CU数量",
        "en": "Data Node CU Count"
      },
      "Description": {
        "zh-cn": "Data组件的计算单元数量。",
        "en": "The number of compute units for the data component."
      },
      "Default": 8,
      "MinValue": 1
    },
    "IndexCuNum": {
      "Type": "Number",
      "Label": {
        "zh-cn": "Index节点CU数量",
        "en": "Index Node CU Count"
      },
      "Description": {
        "zh-cn": "Index组件的计算单元数量。",
        "en": "The number of compute units for the index component."
      },
      "Default": 4,
      "MinValue": 1
    },
    "ProxyReplica": {
      "Type": "Number",
      "Label": {
        "zh-cn": "Proxy副本数",
        "en": "Proxy Replica Count"
      },
      "Description": {
        "zh-cn": "Proxy组件的副本数量。",
        "en": "The number of replicas for the proxy component."
      },
      "Default": 2,
      "MinValue": 1
    },
    "QueryReplica": {
      "Type": "Number",
      "Label": {
        "zh-cn": "Query副本数",
        "en": "Query Replica Count"
      },
      "Description": {
        "zh-cn": "Query组件的副本数量。",
        "en": "The number of replicas for the query component."
      },
      "Default": 2,
      "MinValue": 1
    },
    "LoadReplicas": {
      "Type": "Number",
      "Label": {
        "zh-cn": "加载副本数",
        "en": "Load Replicas"
      },
      "Description": {
        "zh-cn": "数据加载的副本数量。",
        "en": "The number of load replicas."
      },
      "Default": 2,
      "MinValue": 1
    },
    "EnableEncryption": {
      "Type": "String",
      "Label": {
        "zh-cn": "是否启用OSS加密",
        "en": "Enable OSS Encryption"
      },
      "Description": {
        "zh-cn": "是否为Milvus实例启用OSS存储加密。",
        "en": "Whether to enable OSS storage encryption for the Milvus instance."
      },
      "AllowedValues": [
        "true",
        "false"
      ],
      "Default": "true"
    },
    "EnableAiFunction": {
      "Type": "String",
      "Label": {
        "zh-cn": "是否启用AI函数",
        "en": "Enable AI Function"
      },
      "Description": {
        "zh-cn": "是否为Milvus实例启用AI函数功能。",
        "en": "Whether to enable AI function for the Milvus instance."
      },
      "AllowedValues": [
        "true",
        "false"
      ],
      "Default": "true"
    }
  },
  "Conditions": {
    "Encrypted": {
      "Fn::Equals": [
        {
          "Ref": "EnableEncryption"
        },
        "true"
      ]
    },
    "AiFunction": {
      "Fn::Equals": [
        {
          "Ref": "EnableAiFunction"
        },
        "true"
      ]
    }
  },
  "Resources": {
    "Vpc": {
      "Type": "ALIYUN::ECS::VPC",
      "Properties": {
        "VpcName": {
          "Fn::Sub": "${CommonName}-vpc"
        },
        "CidrBlock": "172.16.0.0/16"
      }
    },
    "VSwitchPrimary": {
      "Type": "ALIYUN::ECS::VSwitch",
      "Properties": {
        "VSwitchName": {
          "Fn::Sub": "${CommonName}-vsw-primary"
        },
        "VpcId": {
          "Ref": "Vpc"
        },
        "CidrBlock": "172.16.0.0/24",
        "ZoneId": {
          "Ref": "ZoneId"
        }
      }
    },
    "VSwitchSecondary": {
      "Type": "ALIYUN::ECS::VSwitch",
      "Properties": {
        "VSwitchName": {
          "Fn::Sub": "${CommonName}-vsw-secondary"
        },
        "VpcId": {
          "Ref": "Vpc"
        },
        "CidrBlock": "172.16.1.0/24",
        "ZoneId": {
          "Ref": "ZoneId2"
        }
      }
    },
    "MilvusInstance": {
      "Type": "ALIYUN::Milvus::Instance",
      "DependsOn": [
        "Vpc",
        "VSwitchPrimary",
        "VSwitchSecondary"
      ],
      "Properties": {
        "InstanceName": {
          "Fn::Sub": "${CommonName}-instance"
        },
        "DbAdminPassword": {
          "Ref": "DbAdminPassword"
        },
        "DbVersion": {
          "Ref": "DbVersion"
        },
        "PaymentType": "PayAsYouGo",
        "ZoneId": {
          "Ref": "ZoneId"
        },
        "VpcId": {
          "Ref": "Vpc"
        },
        "VSwitchIds": [
          {
            "VswId": {
              "Ref": "VSwitchPrimary"
            },
            "ZoneId": {
              "Ref": "ZoneId"
            }
          },
          {
            "VswId": {
              "Ref": "VSwitchSecondary"
            },
            "ZoneId": {
              "Ref": "ZoneId2"
            }
          }
        ],
        "Ha": true,
        "MultiZoneMode": "Two",
        "IsMultiAzStorage": true,
        "AutoBackup": true,
        "Encrypted": {
          "Ref": "EnableEncryption"
        },
        "AiFunction": {
          "Ref": "EnableAiFunction"
        },
        "LoadReplicas": {
          "Ref": "LoadReplicas"
        },
        "Components": [
          {
            "Type": "proxy",
            "CuNum": 2,
            "Replica": {
              "Ref": "ProxyReplica"
            }
          },
          {
            "Type": "query",
            "CuNum": {
              "Ref": "QueryCuNum"
            },
            "Replica": {
              "Ref": "QueryReplica"
            },
            "DiskSizeType": "Large"
          },
          {
            "Type": "data",
            "CuNum": {
              "Ref": "DataCuNum"
            },
            "Replica": 2
          },
          {
            "Type": "index",
            "CuNum": {
              "Ref": "IndexCuNum"
            },
            "Replica": 2
          },
          {
            "Type": "mix_coordinator",
            "CuNum": 1,
            "Replica": 2
          },
          {
            "Type": "streaming",
            "CuNum": 4,
            "Replica": 2
          }
        ],
        "Configuration": "dataCoord:\n  segment:\n    maxSize: 1024\n    sealProportion: 0.12\nqueryCoord:\n  balance:\n    autoBalance: true\ncommon:\n  security:\n    superUsers: root",
        "Tags": [
          {
            "Key": "Environment",
            "Value": "Production"
          },
          {
            "Key": "Team",
            "Value": "AI"
          },
          {
            "Key": "CreatedBy",
            "Value": "ROS"
          },
          {
            "Key": "CostCenter",
            "Value": "VectorSearch"
          },
          {
            "Key": "DataClassification",
            "Value": "Confidential"
          }
        ]
      }
    }
  },
  "Outputs": {
    "InstanceId": {
      "Description": {
        "zh-cn": "Milvus实例ID。",
        "en": "Milvus instance ID."
      },
      "Label": {
        "zh-cn": "实例ID",
        "en": "Instance ID"
      },
      "Value": {
        "Fn::GetAtt": [
          "MilvusInstance",
          "InstanceId"
        ]
      }
    },
    "VpcId": {
      "Description": {
        "zh-cn": "VPC ID。",
        "en": "VPC ID."
      },
      "Label": {
        "zh-cn": "VPC ID",
        "en": "VPC ID"
      },
      "Value": {
        "Ref": "Vpc"
      }
    },
    "VSwitchPrimaryId": {
      "Description": {
        "zh-cn": "主可用区交换机ID。",
        "en": "Primary zone VSwitch ID."
      },
      "Label": {
        "zh-cn": "主交换机ID",
        "en": "Primary VSwitch ID"
      },
      "Value": {
        "Ref": "VSwitchPrimary"
      }
    },
    "VSwitchSecondaryId": {
      "Description": {
        "zh-cn": "备可用区交换机ID。",
        "en": "Secondary zone VSwitch ID."
      },
      "Label": {
        "zh-cn": "备交换机ID",
        "en": "Secondary VSwitch ID"
      },
      "Value": {
        "Ref": "VSwitchSecondary"
      }
    }
  },
  "Metadata": {
    "ALIYUN::ROS::Interface": {
      "ParameterGroups": [
        {
          "Parameters": [
            "ZoneId",
            "ZoneId2",
            "CommonName",
            "DbAdminPassword",
            "DbVersion"
          ]
        },
        {
          "Parameters": [
            "QueryCuNum",
            "DataCuNum",
            "IndexCuNum",
            "ProxyReplica",
            "QueryReplica",
            "LoadReplicas"
          ]
        },
        {
          "Parameters": [
            "EnableEncryption",
            "EnableAiFunction"
          ]
        }
      ]
    }
  }
}