テンプレート名
ACS-ECS-BulkyModifyInstanceChargeType:複数のインスタンスの課金方法をバッチで変更します。
テンプレートの説明
複数の Elastic Compute Service (ECS)インスタンスの課金方法を一度に変更します。
テンプレートタイプ
自動化
所有者
Alibaba Cloud
入力パラメーター
パラメーター | 説明 | タイプ | 必須 | デフォルト値 | 制限 |
targets | ターゲットインスタンス | Json | はい | ||
regionId | リージョン ID。 | String | いいえ | {{ ACS::RegionId }} | |
instanceChargeType | ECS インスタンスの新しい課金方法。 | String | いいえ | PostPaid | |
periodUnit | 更新期間の単位。 | String | いいえ | Month | |
period | 更新期間。 | Number | いいえ | 1 | |
includeDataDisks | データディスクを変換するかどうか。 | Boolean | いいえ | False | |
networkChargeType | 新しいネットワーク課金方法。 | String | いいえ | PayByTraffic | |
rateControl | タスク実行の同時実行数 | Json | いいえ | {'Mode': 'Concurrency', 'MaxErrors': 0, 'Concurrency': 10} | |
OOSAssumeRole | CloudOps Orchestration Service (OOS) が担う Resource Access Management (RAM) ロール。 | String | いいえ | "" |
出力パラメーター
なし
テンプレートを実行するために必要な権限ポリシー
{
"Version": "1",
"Statement": [
{
"Action": [
"ecs:DescribeInstances",
"ecs:ModifyInstanceChargeType",
"ecs:ModifyInstanceNetworkSpec"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": [
"oos:GetApplicationGroup"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
詳細
詳細については、GitHub の ACS-ECS-BulkyModifyInstanceChargeType.yml をご参照ください。
テンプレートコンテンツ
FormatVersion: OOS-2019-06-01
Description:
en: 複数のインスタンスの課金方法を変更します。
zh-cn: 複数のインスタンスの課金方法を変更します。
name-en: ACS-ECS-BulkyModifyInstanceChargeType
name-zh-cn: 複数のインスタンスの課金方法を変更
categories:
- instance_manage
Parameters:
regionId:
Type: String
Label:
en: リージョン ID
zh-cn: リージョン ID
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
targets:
Type: Json
Label:
en: ターゲットインスタンス
zh-cn: ターゲットインスタンス
AssociationProperty: Targets
AssociationPropertyMetadata:
ResourceType: ALIYUN::ECS::Instance
RegionId: regionId
instanceChargeType:
Label:
en: インスタンスのターゲット課金方法
zh-cn: インスタンスのターゲット課金方法
Type: String
AllowedValues:
- PostPaid
- PrePaid
Default: PostPaid
periodUnit:
Label:
en: 更新期間の単位
zh-cn: 更新期間の単位
Type: String
AllowedValues:
- Week
- Month
Default: Month
AssociationPropertyMetadata:
Visible:
Condition:
Fn::Not:
Fn::Equals:
- ${instanceChargeType}
- PostPaid
period:
Description:
en: インスタンスの期間。
zh-cn: PeriodUnit が Week の場合、Period の有効値は 1~4 です。PeriodUnit が Month の場合、Period の有効値は 1~12、24、36、48、60 です。
Label:
en: 更新期間
zh-cn: 更新期間
Type: Number
Default: 1
AssociationPropertyMetadata:
Visible:
Condition:
Fn::Not:
Fn::Equals:
- ${instanceChargeType}
- PostPaid
includeDataDisks:
Description:
en: インスタンスにアタッチされているすべての従量課金データディスクの課金方法をサブスクリプションに変更するかどうかを指定します。
zh-cn: インスタンスにアタッチされているすべての従量課金データディスクをサブスクリプションに変換するかどうかを指定します。
Label:
en: データディスクの変換
zh-cn: データディスクの変換
Type: Boolean
Default: false
AssociationPropertyMetadata:
Visible:
Condition:
Fn::Not:
Fn::Equals:
- ${instanceChargeType}
- PostPaid
networkChargeType:
Label:
en: ネットワークのターゲット課金方法
zh-cn: ネットワークのターゲット課金方法
Type: String
AllowedValues:
- PayByBandwidth
- PayByTraffic
- ''
AssociationPropertyMetadata:
ValueLabelMapping:
PayByBandwidth: 帯域幅課金
PayByTraffic: トラフィック課金
'': 課金方法を変更しない
Default: PayByTraffic
rateControl:
Label:
en: タスク実行の同時実行率
zh-cn: タスク実行の同時実行率
Type: Json
AssociationProperty: RateControl
Default:
Mode: Concurrency
MaxErrors: 0
Concurrency: 10
OOSAssumeRole:
Label:
en: OOS が引き受ける RAM ロール
zh-cn: OOS が引き受ける RAM ロール
Type: String
Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: getInstance
Description:
en: ECS インスタンスを取得します。
zh-cn: ECS インスタンスを取得します。
Action: ACS::SelectTargets
Properties:
ResourceType: ALIYUN::ECS::Instance
RegionId: '{{ regionId }}'
Filters:
- '{{ targets }}'
- Name: modifyInstanceChargeType
Description:
en: インスタンスの課金方法を変更します。
zh-cn: インスタンスの課金方法を変更します。
Action: ACS::ECS::ModifyInstanceChargeType
Properties:
regionId: '{{ regionId }}'
instanceId: '{{ ACS::TaskLoopItem }}'
instanceChargeType: '{{ instanceChargeType }}'
networkChargeType: '{{ networkChargeType }}'
period: '{{ period }}'
periodUnit: '{{ periodUnit }}'
includeDataDisks: '{{ includeDataDisks }}'
Loop:
RateControl: '{{ rateControl }}'
Items: '{{ getInstance.Instances.Instance[].InstanceId }}'
Metadata:
ALIYUN::OOS::Interface:
ParameterGroups:
- Parameters:
- instanceChargeType
- period
- periodUnit
- includeDataDisks
- networkChargeType
Label:
default:
zh-cn: 課金方法のパラメーター
en: 課金方法のパラメーター
- Parameters:
- regionId
- targets
Label:
default:
zh-cn: インスタンスの選択
en: ECS インスタンスの選択
- Parameters:
- rateControl
- OOSAssumeRole
Label:
default:
zh-cn: 詳細オプション
en: 詳細オプション