全部產品
Search
文件中心

CloudOps Orchestration Service:ACS-BssOpenApi-EnableAutoRenewal

更新時間:Sep 06, 2024

模板名稱

ACS-BssOpenApi-EnableAutoRenewal 開啟資源自動續約

立即執行

模板描述

開啟資源自動續約

模板類型

自動化

所有者

Alibaba Cloud

輸入參數

參數名稱

描述

類型

是否必填

預設值

約束

resourceIds

資源ID列表

List

renewalPeriodUnit

續約時間單位

String

renewalPeriod

續約時間長度

Number

productCode

產品代碼

String

OOSAssumeRole

OOS扮演的RAM角色

String

regionId

地區ID

String

{{ ACS::RegionId }}

輸出參數

執行此模板需要的權限原則

{
    "Version": "1",
    "Statement": [
        {
            "Action": [
                "bssopenapi:SetRenewal"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

詳情

ACS-BssOpenApi-EnableAutoRenewal詳情

模板內容

FormatVersion: OOS-2019-06-01
Description:
  en: Enable resource auto renew
  zh-cn: 開啟資源自動續約
  name-en: ACS-BssOpenApi-EnableAutoRenewal
  name-zh-cn: 開啟資源自動續約
Parameters:
  regionId:
    Label:
      en: RegionId
      zh-cn: 地區ID
    Type: String
    AssociationProperty: RegionId
    Default: '{{ ACS::RegionId }}'
  resourceIds:
    Label:
      en: ResourceIds
      zh-cn: 資源ID列表
    Type: List
  renewalPeriodUnit:
    Label:
      en: RenewalPeriodUnit
      zh-cn: 續約時間單位
    Type: String
    AllowedValues:
      - M
      - Y
  renewalPeriod:
    Label:
      en: RenewalPeriod
      zh-cn: 續約時間長度
    Type: Number
    AllowedValues:
      - 1
      - 2
      - 3
      - 6
      - 12
  productCode:
    Label:
      en: Product code
      zh-cn: 產品代碼
    Type: String
    AllowedValues:
      - ACS::Bastionhost::Instance
      - ACS::CBWP::CommonBandwidthPackage
      - ACS::ECS::Instance
      - ACS::EIP::EipAddress
      - ACS::MongoDB::DBInstance
      - ACS::Redis::DBInstance
      - ACS::ADB::DBCluster
      - ACS::RDS::DBInstance
      - ACS::PolarDB::DBCluster
      - ACS::SLB::LoadBalancer
      - ACS::DdosCoo::Instance
      - ACS::CEN::CenBandwidthPackage
  OOSAssumeRole:
    Label:
      en: OOSAssumeRole
      zh-cn: OOS扮演的RAM角色
    Type: String
RamRole: '{{ OOSAssumeRole }}'
Tasks:
  - Name: ModifyInstanceRenewAttribute
    Action: ACS::ExecuteAPI
    Description:
      en: Modify renew attribute of instance
      zh-cn: 修改執行個體自動續約屬性
    Properties:
      Service: BssOpenApi
      API: SetRenewal
      Parameters:
        RegionId: '{{ regionId }}'
        InstanceIDs:
          Fn::Join:
            - ','
            - '{{ resourceIds }}'
        RenewalStatus: 'AutoRenewal'
        RenewalPeriod: '{{ renewalPeriod }}'
        RenewalPeriodUnit: '{{ renewalPeriodUnit }}'
        ProductCode:
          Fn::Select:
            - '{{ productCode }}'
            - ACS::CBWP::CommonBandwidthPackage: cbwp
              ACS::Bastionhost::Instance: bastionhost
              ACS::ECS::Instance: ecs
              ACS::EIP::EipAddress: eip
              ACS::MongoDB::DBInstance: dds
              ACS::Redis::DBInstance: redisa
              ACS::ADB::DBCluster: ads
              ACS::RDS::DBInstance: rds
              ACS::PolarDB::DBCluster: polardb
              ACS::SLB::LoadBalancer: slb
              ACS::DdosCoo::Instance: ddos
              ACS::CEN::CenBandwidthPackage: cbn
        ProductType:
          Fn::Select:
            - '{{ productCode }}'
            - ACS::CBWP::CommonBandwidthPackage: ''
              ACS::Bastionhost::Instance: bastionhost
              ACS::ECS::Instance: ''
              ACS::EIP::EipAddress: ''
              ACS::MongoDB::DBInstance: ''
              ACS::Redis::DBInstance: ''
              ACS::ADB::DBCluster: ''
              ACS::RDS::DBInstance: rds
              ACS::PolarDB::DBCluster: online
              ACS::SLB::LoadBalancer: ''
              ACS::DdosCoo::Instance: 'ddoscoo'
              ACS::CEN::CenBandwidthPackage: 'cbn_bwp_pre'
Metadata:
  ALIYUN::OOS::Interface:
    ParameterGroups:
      - Parameters:
          - regionId
          - productCode
          - resourceIds
        Label:
          default:
            zh-cn: 選擇資源
            en: Select Resource
      - Parameters:
          - renewalPeriodUnit
          - renewalPeriod
        Label:
          default:
            zh-cn: 設定續約參數
            en: Configure Parameters
      - Parameters:
          - OOSAssumeRole
        Label:
          default:
            zh-cn: 進階選項
            en: Control Options