Tous les produits
Search
Centre de documentation

CloudOps Orchestration Service:ACS-ECS-BulkyModifyInstanceAutoRenewAttribute

Dernière mise à jour :Aug 11, 2026

Nom du modèle

Modifie par lot les attributs de renouvellement automatique de plusieurs instances.

Exécuter maintenant

Description du modèle

Modifie par lot les paramètres de renouvellement automatique de plusieurs instances Elastic Compute Service (ECS).

Type de modèle

Automatisé

Propriétaire

Alibaba Cloud

Paramètres d'entrée

|
**Paramètre**
|
**Description**
|
**Type**
|
**Obligatoire**
|
**Valeur par défaut**
|
**Limite**
| | --- | --- | --- | --- | --- | --- | |
targets
|
Instance cible
|
Json
|
Oui
| | | |
duration
|
Période de renouvellement automatique des instances ECS.
|
Number
|
Oui
| | | |
regionId
|
ID de la région.
|
String
|
Non
|
{{ ACS::RegionId }}
| | |
periodUnit
|
Unité de la durée de renouvellement automatique.
|
String
|
Non
|
Month
| | |
autoRenew
|
Active ou désactive le renouvellement automatique pour les instances ECS.
|
Boolean
|
Non
|
False
| | |
renewalStatus
|
Statut de renouvellement automatique des instances ECS.
|
String
|
Non
|
AutoRenewal
| | |
rateControl
|
Taux d'exécution concurrente des tâches
|
Json
|
Non
|
{'Mode': 'Concurrency', 'MaxErrors': 0, 'Concurrency': 10}
| | |
OOSAssumeRole
|
Rôle Resource Access Management (RAM) assumé par CloudOps Orchestration Service (OOS).
|
String
|
Non
|
""
| |

Paramètres de sortie

Aucun

Politique d'autorisation requise pour exécuter le modèle

{
    "Version": "1",
    "Statement": [
        {
            "Action": [
                "ecs:DescribeInstances",
                "ecs:ModifyInstanceAutoRenewAttribute"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "oos:GetApplicationGroup"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

Détails

Pour plus d'informations, consultez le fichier ACS-ECS-BulkyModifyInstanceAutoRenewAttribute.yml sur GitHub.

Contenu du modèle

FormatVersion: OOS-2019-06-01
Description:
  en: Modifies the auto-renewal attributes of instances in batches.
  zh-cn: Modifies the auto-renewal attributes of instances in batches.
  name-en: ACS-ECS-BulkyModifyInstanceAutoRenewAttribute
  name-zh-cn: ACS-ECS-BulkyModifyInstanceAutoRenewAttribute
  categories:
    - instance_manage
Parameters:
  regionId:
    Type: String
    Label:
      en: Region ID
      zh-cn: Region ID
    AssociationProperty: RegionId
    Default: '{{ ACS::RegionId }}'
  targets:
    Type: Json
    Label:
      en: Target Instance
      zh-cn: Target Instance
    AssociationProperty: Targets
    AssociationPropertyMetadata:
      ResourceType: 'ALIYUN::ECS::Instance'
      RegionId: regionId
  periodUnit:
    Label:
      en: Renewal Period Unit
      zh-cn: Renewal Period Unit
    Type: String
    AllowedValues:
      - Month
      - Week
      - Year
    Default: Month
  duration:
    Description:
      en: >-
        When PeriodUnit is set to Year, valid values of Duration are 1, 2, and 3.
        When PeriodUnit is set to Month, valid values of Duration are 1, 2, 3, 6, and 12.
        When PeriodUnit is set to Week, valid values of Duration are 1, 2, 3, and 4.
      zh-cn: >-
        When PeriodUnit is set to Year, valid values of Duration are 1, 2, and 3.
        When PeriodUnit is set to Month, valid values of Duration are 1, 2, 3, 6, and 12.
        When PeriodUnit is set to Week, valid values of Duration are 1, 2, 3, and 4.
    Label:
      en: Renewal Duration
      zh-cn: Renewal Duration
    Type: Number
  autoRenew:
    Label:
      en: Enable Auto-renewal
      zh-cn: Enable Auto-renewal
    Type: Boolean
    Default: false
  renewalStatus:
    Description:
      en: >-
        Valid values:
        AutoRenewal: Auto-renewal is enabled for the instance.
        Normal: Auto-renewal is disabled for the instance.
        NotRenewal: The instance will not be renewed upon expiration. The system no longer sends an expiration reminder, but sends only a non-renewal reminder three days before the expiration date. You can change the value of this parameter from NotRenewal to Normal for an instance, and then manually renew the instance. Alternatively, you can set the RenewalStatus parameter to AutoRenewal.
      zh-cn: >-
        Valid values:
        AutoRenewal: Auto-renewal is enabled for the instance.
        Normal: Auto-renewal is disabled for the instance.
        NotRenewal: The instance will not be renewed upon expiration. The system no longer sends an expiration reminder, but sends only a non-renewal reminder three days before the expiration date. You can change the value of this parameter from NotRenewal to Normal for an instance, and then manually renew the instance. Alternatively, you can set the RenewalStatus parameter to AutoRenewal.
    Label:
      en: Auto-renewal Status
      zh-cn: Auto-renewal Status
    Type: String
    AllowedValues:
      - AutoRenewal
      - Normal
      - NotRenewal
    Default: AutoRenewal
  rateControl:
    Label:
      en: Rate Control
      zh-cn: Rate Control
    Type: Json
    AssociationProperty: RateControl
    Default:
      Mode: Concurrency
      MaxErrors: 0
      Concurrency: 10
  OOSAssumeRole:
    Label:
      en: The RAM role that OOS assumes
      zh-cn: The RAM role that OOS assumes
    Type: String
    Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
  - Name: getInstance
    Description:
      en: Retrieves information about the specified ECS instances.
      zh-cn: Retrieves information about the specified ECS instances.
    Action: 'ACS::SelectTargets'
    Properties:
      ResourceType: 'ALIYUN::ECS::Instance'
      RegionId: '{{ regionId }}'
      Filters:
        - '{{ targets }}'
    Outputs:
      instanceIds:
        Type: List
        ValueSelector: 'Instances.Instance[].InstanceId'
  - Name: modifyInstanceAutoRenewAttribute
    Action: 'ACS::ECS::ModifyInstanceAutoRenewAttribute'
    Description:
      en: Modifies the auto-renewal attributes of an instance.
      zh-cn: Modifies the auto-renewal attributes of an instance.
    Properties:
      regionId: '{{ regionId }}'
      instanceId: '{{ ACS::TaskLoopItem }}'
      duration: '{{ duration }}'
      periodUnit: '{{ periodUnit }}'
      autoRenew: '{{ autoRenew }}'
      renewalStatus: '{{ renewalStatus }}'
    Loop:
      RateControl: '{{ rateControl }}'
      Items: '{{ getInstance.instanceIds }}'
Metadata:
  ALIYUN::OOS::Interface:
    ParameterGroups:
      - Parameters:
          - periodUnit
          - duration
          - autoRenew
          - renewalStatus
        Label:
          default:
            zh-cn: Configure Parameters
            en: Configure Parameters
      - Parameters:
          - regionId
          - targets
        Label:
          default:
            zh-cn: Select ECS Instances
            en: Select ECS Instances
      - Parameters:
          - rateControl
          - OOSAssumeRole
        Label:
          default:
            zh-cn: Advanced Options
            en: Advanced Options