ALIYUN::Flink::InstanceV2

ALIYUN::Flink::InstanceV2类型用于创建新版flink全托管工作空间。

语法

{
  "Type": "ALIYUN::Flink::InstanceV2",
  "Properties": {
    "ChargeType": String,
    "InstanceName": String,
    "Storage": Map,
    "VpcId": String,
    "VSwitchIds": List,
    "AutoRenew": Boolean,
    "Duration": Integer,
    "PricingCycle": String,
    "PromotionCode": String,
    "ResourceSpec": Map,
    "UsePromotionCode": Boolean
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

ChargeType

String

付费类型。

取值如下:

  • POST:按量付费

  • PRE:包年包月

InstanceName

String

工作空间名称。

以小写英文字母开头,包含小写字母、数字、中划线,且不能用中划线结尾。

Storage

Map

存储参数。

更多信息,请参考Storage属性

VpcId

String

专有网络 VPC ID。

VSwitchIds

List

虚拟交换机 ID 组。

最多支持配置150组虚拟交换机。

AutoRenew

Boolean

是否自动续费。

取值:

  • true:自动续费

  • false:不自动续费(默认)

Duration

Integer

订购周期数量。

当 ChargeType 设置为 PRE(预付费)时,必须填写 duration 参数。

  • 如果 PricingCycle 为 Month(月),有效范围是:1、2、3、6、7、8、9、12、24、36

  • 如果 PricingCycle 为 Year(年),有效范围是:1 到 3(即 1 年、2 年、3 年)

说明

当 ChargeType 配置为 PRE 时,Duration 参数必填

PricingCycle

String

指定预付费实例为包年或包月类型。

取值范围如下:

  • year:年

  • month:月

说明

当 ChargeType 配置为 PRE 时,PricingCycle 参数必填

PromotionCode

String

优惠券 code。

ResourceSpec

Map

资源规格。

更多信息,请参考ResourceSpec属性

说明

当 ChargeType 配置为 PRE 时,ResourceSpec 参数必填

UsePromotionCode

Boolean

是否使用优惠券。

Storage语法

"Storage": {
  "FullyManaged": Boolean,
  "Oss": Map
}

Storage属性

属性名称

类型

必须

允许更新

描述

约束

FullyManaged

Boolean

是否选择全托管存储。

全托管存储和绑定 oss bucket 的方式仅能选择一种。

  • true:使用。

  • false:不使用。

Oss

Map

OSS 存储。

更多信息,请参考Oss属性

Oss语法

"Oss": {
  "Bucket": String
}

Oss属性

属性名称

类型

必须

允许更新

描述

约束

Bucket

String

绑定 OSS 的 Bucket 名称。

ResourceSpec语法

"ResourceSpec": {
  "Cpu": Integer,
  "MemoryGB": Integer
}

ResourceSpec属性

属性名称

类型

必须

允许更新

描述

约束

Cpu

Integer

CPU 数量。

说明

在包年包月的工作空间下,CPU 数量必填。在按量付费的工作空间下,可以不用填写 CPU 数量。- 创建的目标项目空间的 CPU 数量要小于工作空间中剩余 CPU 数量(工作空间购买的总 CPU 数量减去其他项目空间已分配 CPU 数量),否则会报错。

MemoryGB

Integer

内存大小。

说明

内存大小必须为 CPU 数量的 4 倍。

返回值

Fn::GetAtt

  • InstanceId:实例 id。

  • WorkspaceId:工作空间 ID。

  • OrderId:订单 id

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  InstanceName:
    Type: String
    Description:
      en: The name of instance.
    AllowedPattern: ^[a-z][a-z0-9-]{1,60}
    Required: true
  Storage:
    AssociationPropertyMetadata:
      Parameters:
        FullyManaged:
          Type: Boolean
          Description:
            en: Whether the storage is fully managed.
          Required: false
        Oss:
          AssociationPropertyMetadata:
            Parameters:
              Bucket:
                Type: String
                Description:
                  en: OSS bucket name.
                Required: true
          Type: Json
          Description:
            en: The OSS storage config
          Required: false
    Type: Json
    Description:
      en: |-
        Resource specifications.
        When ChargeType is configured as PRE, the resource specification parameters must be filled.
    Required: true
  VpcId:
    AssociationProperty: ALIYUN::ECS::VPC::VPCId
    Type: String
    Description:
      en: VPC ID.
    Required: true
  VSwitchIds:
    Type: Json
    Description:
      en: Virtual switch ID.
    Required: true
    MinLength: 1
    MaxLength: 150
  ChargeType:
    Type: String
    Description:
      en: |-
        The payment type, the value of the value is as follows:
        POST: pay as you go.
        PRE: subscription.
    AllowedValues:
      - PayAsYouGo
      - Subscription
    Required: true
  ResourceSpec:
    AssociationPropertyMetadata:
      Parameters:
        Cpu:
          Type: Number
          Description:
            en: CPU number.
          Required: false
        MemoryGB:
          Type: Number
          Description:
            en: |-
              memory size.The unit is GB.
              It shows that the amount of memory must be 4 times the number of CPUs.
          Required: false
    Type: Json
    Description:
      en: |-
        Resource specifications.
        When ChargeType is configured as PRE, the resource specification parameters must be filled.
    Required: false
Resources:
  InstanceV2:
    Type: ALIYUN::Flink::InstanceV2
    Properties:
      InstanceName:
        Ref: InstanceName
      Storage:
        Ref: Storage
      VpcId:
        Ref: VpcId
      VSwitchIds:
        Ref: VSwitchIds
      ChargeType:
        Ref: ChargeType
      ResourceSpec:
        Ref: ResourceSpec
Outputs:
  InstanceId:
    Description: Instance ID.
    Value:
      Fn::GetAtt:
        - InstanceV2
        - InstanceId
  WorkspaceId:
    Description: Workspace ID.
    Value:
      Fn::GetAtt:
        - InstanceV2
        - WorkspaceId
  OrderId:
    Description: Order information.
    Value:
      Fn::GetAtt:
        - InstanceV2
        - OrderId
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "InstanceName": {
      "Type": "String",
      "Description": {
        "en": "The name of instance."
      },
      "AllowedPattern": "^[a-z][a-z0-9-]{1,60}",
      "Required": true
    },
    "Storage": {
      "AssociationPropertyMetadata": {
        "Parameters": {
          "FullyManaged": {
            "Type": "Boolean",
            "Description": {
              "en": "Whether the storage is fully managed."
            },
            "Required": false
          },
          "Oss": {
            "AssociationPropertyMetadata": {
              "Parameters": {
                "Bucket": {
                  "Type": "String",
                  "Description": {
                    "en": "OSS bucket name."
                  },
                  "Required": true
                }
              }
            },
            "Type": "Json",
            "Description": {
              "en": "The OSS storage config"
            },
            "Required": false
          }
        }
      },
      "Type": "Json",
      "Description": {
        "en": "Resource specifications.\nWhen ChargeType is configured as PRE, the resource specification parameters must be filled."
      },
      "Required": true
    },
    "VpcId": {
      "AssociationProperty": "ALIYUN::ECS::VPC::VPCId",
      "Type": "String",
      "Description": {
        "en": "VPC ID."
      },
      "Required": true
    },
    "VSwitchIds": {
      "Type": "Json",
      "Description": {
        "en": "Virtual switch ID."
      },
      "Required": true,
      "MinLength": 1,
      "MaxLength": 150
    },
    "ChargeType": {
      "Type": "String",
      "Description": {
        "en": "The payment type, the value of the value is as follows:\nPOST: pay as you go.\nPRE: subscription."
      },
      "AllowedValues": [
        "PayAsYouGo",
        "Subscription"
      ],
      "Required": true
    },
    "ResourceSpec": {
      "AssociationPropertyMetadata": {
        "Parameters": {
          "Cpu": {
            "Type": "Number",
            "Description": {
              "en": "CPU number."
            },
            "Required": false
          },
          "MemoryGB": {
            "Type": "Number",
            "Description": {
              "en": "memory size.The unit is GB.\nIt shows that the amount of memory must be 4 times the number of CPUs."
            },
            "Required": false
          }
        }
      },
      "Type": "Json",
      "Description": {
        "en": "Resource specifications.\nWhen ChargeType is configured as PRE, the resource specification parameters must be filled."
      },
      "Required": false
    }
  },
  "Resources": {
    "InstanceV2": {
      "Type": "ALIYUN::Flink::InstanceV2",
      "Properties": {
        "InstanceName": {
          "Ref": "InstanceName"
        },
        "Storage": {
          "Ref": "Storage"
        },
        "VpcId": {
          "Ref": "VpcId"
        },
        "VSwitchIds": {
          "Ref": "VSwitchIds"
        },
        "ChargeType": {
          "Ref": "ChargeType"
        },
        "ResourceSpec": {
          "Ref": "ResourceSpec"
        }
      }
    }
  },
  "Outputs": {
    "InstanceId": {
      "Description": "Instance ID.",
      "Value": {
        "Fn::GetAtt": [
          "InstanceV2",
          "InstanceId"
        ]
      }
    },
    "WorkspaceId": {
      "Description": "Workspace ID.",
      "Value": {
        "Fn::GetAtt": [
          "InstanceV2",
          "WorkspaceId"
        ]
      }
    },
    "OrderId": {
      "Description": "Order information.",
      "Value": {
        "Fn::GetAtt": [
          "InstanceV2",
          "OrderId"
        ]
      }
    }
  }
}