ACS-RDS-BulkyModifyDBInstanceSpec

更新时间:
复制 MD 格式

Template name

ACS-RDS-BulkyModifyDBInstanceSpec: Modifies ApsaraDB for RDS instance specifications.

Execute Now

Description

Modifies ApsaraDB for RDS instance specifications. Note:

  • Specification changes may involve data migration, followed by a switchover that causes a ~30-second connection interruption. Ensure your application supports automatic reconnection.

  • Instance type changes trigger an automatic restart at the selected switchover time. No manual intervention is required.

  • Expanding storage within the same cloud disk type takes effect immediately without service impact. Expanding a local disk or changing the storage type causes a brief connection interruption and can be scheduled during the maintenance window.

  • During a connection interruption, most database, account, and network operations are unavailable. Perform specification changes during off-peak hours.

  • The disk space of the primary instance must be less than or equal to the disk space of its read-only instances.

Template type

Automation

Owner

Alibaba Cloud

Input parameters

Parameter

Description

Type

Required

Default

Constraints

regionId

The region ID.

String

Yes

targets

The target instances.

Json

Yes

dBInstanceStorageType

The instance storage type.

String

Yes

dBInstanceClass

The target instance type.

String

Yes

dBInstanceStorage

The target storage space in GB.

Number

Yes

effectiveTime

When the specification change takes effect.

String

No

Immediate

direction

The specification change direction.

String

No

Up

rateControl

The concurrency rate.

Json

No

'{'Mode': 'Concurrency', 'MaxErrors': 0, 'Concurrency': 10}'

OOSAssumeRole

The RAM role assumed by OOS.

String

No

""

Output parameters

None.

Required permissions

{
    "Version": "1",
    "Statement": [
        {
            "Action": [
                "rds:DescribeDBInstanceAttribute",
                "rds:DescribeDBInstances",
                "rds:ModifyDBInstanceSpec"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "oos:GetApplicationGroup"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

Details

ACS-RDS-BulkyModifyDBInstanceSpec

Template content

FormatVersion: OOS-2019-06-01
Description:
  name-en: ACS-RDS-BulkyModifyDBInstanceSpec
  name-zh-cn: 修改RDS实例的配置
  en: |-
    <div><p>Modifies the specifications of ApsaraDB for RDS instances. Note the following:</p>
    <ul>
    <li>Changing the specifications of an ApsaraDB for RDS instance may involve underlying data migration. After the migration, a switchover occurs, causing a transient connection interruption of about 30 seconds. Ensure that your application has an automatic reconnection mechanism.</li>
    <li>When you change the instance type, the instance is automatically restarted based on the selected switchover time. No manual intervention is required.</li>
    <li>Expanding the storage capacity of a cloud disk of the same storage type does not affect your services and occurs immediately, bypassing the maintenance window. Expanding a local disk or a cloud disk to a different storage type causes a transient connection interruption. You can choose to perform the switchover during the maintenance window.</li>
    <li>During a transient connection interruption, you cannot perform most operations related to databases, accounts, and networks. We recommend performing specification changes during off-peak hours.</li>
    <li>The disk space of the primary instance must be less than or equal to the disk space of its read-only instances.</li>
    </ul>
    </div>
  zh-cn: |-
    <div><p>修改RDS实例的配置,变更提醒:</p>
      <ul>
        <li>RDS变更配置可能涉及底层数据迁移,请您耐心等待。在迁移完成后会进行切换,切换时会出现30秒左右的闪断,请确保应用具备重连机制。</li>
        <li>变更实例规格过程会根据您选择的切换时间自动重启实例,无需手动操作。</li>
        <li>云盘同存储类型的扩容业务无感,变配后会将立即执行,不会等待运维窗口;本地盘及不同类型云盘扩容业务会出现闪断,可选择运维窗口切换。</li>
        <li>闪断过程中,与数据库、账号、网络等相关的大部分操作都无法执行,因此请尽量在业务低峰期执行变配操作。</li>
        <li>主实例磁盘空间须小于等于只读实例磁盘空间</li>
      </ul>
    </div>
Parameters:
  regionId:
    Label:
      en: Region ID
      zh-cn: 地域ID
    Type: String
    AssociationProperty: ALIYUN::ECS::RegionId
  targets:
    Type: Json
    Label:
      en: Target Instances
      zh-cn: 目标实例
    AssociationProperty: Targets
    AssociationPropertyMetadata:
      ResourceType: ALIYUN::RDS::Instance
      RegionId: regionId
      Status: Running
  dBInstanceStorageType:
    Type: String
    Label:
      en: Instance Storage Type
      zh-cn: 实例储存类型
    Description:
      en: |-
        <div><p>The instance storage type. Valid values:</p>
            <ul>
                <li><strong>local_ssd</strong>: local SSD</li>
                <li><strong>cloud_essd</strong>: ESSD PL1 cloud disk</li>
                <li><strong>cloud_essd2</strong>: ESSD PL2 cloud disk</li>
                <li><strong>cloud_essd3</strong>: ESSD PL3 cloud disk</li>
                <li><strong>general_essd</strong>: General-purpose cloud disk</li>
            </ul>
        </div>
      zh-cn: |-
        <div><p>实例储存类型,取值:</p>
            <ul>
                <li><strong>local_ssd</strong>:本地 SSD 盘</li>
                <li><strong>cloud_essd</strong>:ESSD PL1 云盘</li>
                <li><strong>cloud_essd2</strong>:ESSD PL2 云盘</li>
                <li><strong>cloud_essd3</strong>:ESSD PL3 云盘</li>
                <li><strong>general_essd</strong>:通用云盘</li>
            </ul>
        </div>
    AllowedValues:
      - local_ssd
      - cloud_essd
      - cloud_essd2
      - cloud_essd3
      - general_essd
  dBInstanceClass:
    Type: String
    Label:
      en: Target Instance Type
      zh-cn: 目标实例规格
    AssociationProperty: ALIYUN::RDS::Instance::InstanceType
    AssociationPropertyMetadata:
      DBInstanceStorageType: ${dBInstanceStorageType}
  dBInstanceStorage:
    Type: Number
    Label:
      en: Target Storage Space
      zh-cn: 目标存储空间大小
    Description:
      en: The storage space in GB. The value must be specified in increments of 5.
      zh-cn: 单位:GB,每 5GB 进行递增
  effectiveTime:
    Type: String
    Label:
      en: Effective Time
      zh-cn: 变更生效时间
    Description:
      en: |-
        <div><p>The time when the specifications change takes effect.</p>
          <ul>
            <li><strong>Immediate</strong>: The change takes effect immediately.</li>
            <li><strong>MaintainTime</strong>: The change takes effect during the maintenance window.</li>
          </ul>
        </div>
      zh-cn: |-
        <div><p>配置变更生效时间:</p>
          <ul>
            <li><strong>Immediate</strong>:配置变更生效立即生效。</li>
            <li><strong>MaintainTime</strong>:配置变更生效于维护时间段。</li>
          </ul>
        </div>
    AllowedValues:
      - Immediate
      - MaintainTime
    Default: Immediate
  direction:
    Type: String
    Label:
      en: Direction
      zh-cn: 实例变配类型
    Description:
      en: If you change only the instance storage type, such as changing an SSD cloud disk to an ESSD cloud disk, leave this parameter empty.
      zh-cn: 如果仅变更 DBInstanceStorageType 参数,例如将 SSD 云盘变更为 ESSD 云盘,则此参数留空。
    AllowedValues:
      - Up
      - Down
      - TempUpgrade
      - Serverless
    Default: Up
  rateControl:
    Label:
      en: Concurrency Rate
      zh-cn: 任务执行的并发比率
    Type: Json
    AssociationProperty: RateControl
    Default:
      Mode: Concurrency
      MaxErrors: 0
      Concurrency: 10
  OOSAssumeRole:
    Label:
      en: OOSAssumeRole
      zh-cn: OOS扮演的RAM角色
    Type: String
    Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
  - Name: getInstance
    Description:
      en: Gets information about the specified ApsaraDB for RDS instances.
      zh-cn: 获取RDS实例
    Action: ACS::SelectTargets
    Properties:
      ResourceType: ALIYUN::RDS::Instance
      RegionId: '{{ regionId }}'
      Filters:
        - '{{ targets }}'
    Outputs:
      instanceIds:
        Type: List
        ValueSelector: Instances.Instance[].InstanceId
  - Name: modifyDBInstanceSpec
    Action: ACS::RDS::ModifyDBInstanceSpec
    Description:
      en: Modifies the specifications of the ApsaraDB for RDS instances.
      zh-cn: 变更RDS实例
    Properties:
      regionId: '{{ regionId }}'
      dBInstanceId: '{{ ACS::TaskLoopItem }}'
      dBInstanceClass: '{{ dBInstanceClass }}'
      dBInstanceStorage: '{{ dBInstanceStorage }}'
      dBInstanceStorageType: '{{ dBInstanceStorageType }}'
      effectiveTime: '{{ effectiveTime }}'
      direction: '{{ direction }}'
    Loop:
      RateControl: '{{ rateControl }}'
      Items: '{{ getInstance.instanceIds }}'
Metadata:
  ALIYUN::OOS::Interface:
    ParameterGroups:
      - Parameters:
          - regionId
          - targets
        Label:
          default:
            zh-cn: 选择实例
            en: Select Instances
      - Parameters:
          - dBInstanceStorageType
          - dBInstanceClass
          - dBInstanceStorage
          - effectiveTime
          - direction
        Label:
          default:
            zh-cn: 配置参数
            en: Configure Parameters
      - Parameters:
          - rateControl
          - OOSAssumeRole
        Label:
          default:
            zh-cn: 高级选项
            en: Advanced Options