テンプレート名
ACS-ECS-BulkyModifyInstanceChargeTypeSpecifiedInstanceTypeFamilies:指定されたインスタンスファミリー内のインスタンスの課金方法を一括で変更します
テンプレートの説明
インスタンスタイプが特定のインスタンスファミリーに属する複数の Elastic Compute Service (ECS) インスタンスの課金方法を変更します。
テンプレートタイプ
自動化
所有者
Alibaba Cloud
入力パラメーター
パラメーター | 説明 | タイプ | 必須 | デフォルト値 | 制限 |
targets | ターゲットインスタンス。 | Json | はい | ||
instanceTypeFamilies | インスタンスファミリー。 | リスト | はい | ||
regionId | リージョン ID。 | 文字列 | いいえ | {{ ACS::RegionId }} | |
instanceChargeType | インスタンスの新しい課金方法。 | 文字列 | いいえ | PostPaid | |
networkChargeType | ネットワークの新しい課金方法。 | 文字列 | いいえ | PayByTraffic | |
rateControl | タスク実行の同時実行率。 | Json | いいえ | {'Mode': 'Concurrency', 'MaxErrors': 0, 'Concurrency': 10} | |
OOSAssumeRole | Operation Orchestration Service (OOS) が引き受ける Resource Access Management (RAM) ロール。 | 文字列 | いいえ | "" |
出力パラメーター
なし
テンプレートを実行するために必要な権限ポリシー
{
"Version": "1",
"Statement": [
{
"Action": [
"ecs:DescribeInstances",
"ecs:ModifyInstanceChargeType",
"ecs:ModifyInstanceNetworkSpec"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": [
"oos:GetApplicationGroup"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
詳細
詳細については、GitHub の ACS-ECS-BulkyModifyInstanceChargeTypeSpecifiedInstanceTypeFamilies.yml をご参照ください。
テンプレートコンテンツ
FormatVersion: OOS-2019-06-01
Description:
en: >-
Batch modifies the billing method of instances in specified instance
families.
zh-cn: 批量修改指定实例规格族下实例的计费方式
name-en: ACS-ECS-BulkyModifyInstanceChargeTypeSpecifiedInstanceTypeFamilies
name-zh-cn: 批量修改指定实例规格族下实例的计费方式
categories:
- instance_manage
Parameters:
regionId:
Label:
en: Region ID
zh-cn: 地域ID
Type: String
Description:
en: The ID of the region.
zh-cn: 地域ID。
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
targets:
Label:
en: Target Instances
zh-cn: 目标实例
Type: Json
AssociationProperty: Targets
AssociationPropertyMetadata:
ResourceType: 'ALIYUN::ECS::Instance'
RegionId: regionId
instanceChargeType:
Label:
en: Instance Billing Method
zh-cn: 实例计费方式
Description:
en: The target billing method for the instances.
zh-cn: 实例需要修改的目标计费方式。
Type: String
AllowedValues:
- PostPaid
- PrePaid
Default: PostPaid
networkChargeType:
Label:
en: Network Billing Method
zh-cn: 网络计费方式
Description:
en: The target billing method for the network.
zh-cn: 网络需要修改的目标计费方式。
Type: String
AllowedValues:
- PayByBandwidth
- PayByTraffic
Default: PayByTraffic
instanceTypeFamilies:
Label:
en: Instance Families
zh-cn: 实例规格族
Description:
en: >-
The instance families of the instances whose billing method you want to change.
zh-cn: 要修改付费方式的ECS实例对应的实例规格族
Type: List
rateControl:
Label:
en: Rate Control
zh-cn: 任务执行的并发比率
Description:
en: The rate control settings.
zh-cn: 任务执行的并发比率。
Type: Json
AssociationProperty: RateControl
Default:
Mode: Concurrency
MaxErrors: 0
Concurrency: 10
OOSAssumeRole:
Label:
en: OOS Assume Role
zh-cn: OOS扮演的RAM角色
Description:
en: The RAM role that OOS assumes.
zh-cn: OOS扮演的RAM角色。
Type: String
Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: getInstance
Description:
en: Gets the ECS instances.
zh-cn: 获取ECS实例。
Action: 'ACS::SelectTargets'
Properties:
ResourceType: 'ALIYUN::ECS::Instance'
RegionId: '{{ regionId }}'
Filters:
- '{{ targets }}'
Outputs:
instanceIds:
Type: List
ValueSelector: 'Instances.Instance[].InstanceId'
- Name: modifyInstanceChargeTypeByInstanceTypeFamily
Description:
en: Modifies the billing method of instances in the specified instance families.
zh-cn: 修改指定例规格族下实例的计费方式。
Action: 'ACS::ECS::ModifyInstanceChargeTypeSpecifiedInstanceTypeFamilies'
Properties:
regionId: '{{ regionId }}'
instanceId: '{{ ACS::TaskLoopItem }}'
instanceChargeType: '{{ instanceChargeType }}'
networkChargeType: '{{ networkChargeType }}'
instanceTypeFamilies: '{{ instanceTypeFamilies }}'
Loop:
RateControl: '{{ rateControl }}'
Items: '{{ getInstance.instanceIds }}'