すべてのプロダクト
Search
ドキュメントセンター

CloudOps Orchestration Service:ACS-ECS-RunInstancesWithApproval

最終更新日:Jun 23, 2026

テンプレート名

ACS-ECS-RunInstancesWithApproval:承認を得て Elastic Compute Service (ECS) インスタンスを作成します。

今すぐ実行

テンプレートの説明

承認を得て ECS インスタンスを作成します。

テンプレートの種類

オートメーション

所有者

Alibaba Cloud

入力パラメーター

パラメーター名

説明

タイプ

必須

デフォルト値

制約

accessToken

DingTalk のアクセス トークンです。

String

はい

正規表現 [A-Za-z0-9]* に一致する必要があります。

imageId

イメージ ID です。

String

はい

instanceType

インスタンスタイプです。

String

はい

正規表現 ecs\.[A-Za-z0-9\.\-]* に一致する必要があります。

securityGroupId

セキュリティグループ ID です。

String

はい

vSwitchId

vSwitch ID です。

String

はい

amount

作成する ECS インスタンスの数です。

Number

いいえ

1

OOSAssumeRole

Operation Orchestration Service (OOS) がテンプレートを実行する際に引き受ける RAM ロールです。

String

いいえ

""

出力パラメーター

パラメーター名

説明

タイプ

instanceId

作成された最初の ECS インスタンスの ID です。

String

必要なアクセスポリシー

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

詳細

詳細については、「ACS-ECS-RunInstancesWithApproval の詳細」をご参照ください。

テンプレートの内容

FormatVersion: OOS-2019-06-01
Description:
  ja: 承認を得て 1 つ以上の ECS インスタンスを作成します
  name-ja: ACS-ECS-RunInstancesWithApproval
  categories:
    - cost_manage
Parameters:
  accessToken:
    Label:
      ja: アクセス トークン
    Type: String
    AllowedPattern: '[A-Za-z0-9]*'
  imageId:
    Label:
      ja: イメージ ID
    Type: String
    AssociationProperty: 'ALIYUN::ECS::Image::ImageId'
  instanceType:
    Label:
      ja: インスタンスタイプ
    Type: String
    AssociationProperty: 'ALIYUN::ECS::Instance::InstanceType'
    AllowedPattern: ecs\.[A-Za-z0-9\.\-]*
  securityGroupId:
    Label:
      ja: セキュリティグループ ID
    Type: String
    AssociationProperty: 'ALIYUN::ECS::SecurityGroup::SecurityGroupId'
  vSwitchId:
    Label:
      ja: vSwitch ID
    Type: String
    AssociationProperty: 'ALIYUN::VPC::VSwitch::VSwitchId'
    AssociationPropertyMetadata:
      Filters:
        - SecurityGroupId: securityGroupId
  amount:
    Label:
      ja: インスタンス数
    Type: Number
    Default: 1
  OOSAssumeRole:
    Label:
      ja: OOS が引き受ける RAM ロール
    Type: String
    Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: approvalForRunInstances
  Action: ACS::Approve
  Description:
    ja: ECS インスタンスを起動するための承認
  Properties:
    NotifyType: WebHook
    WebHook:
      URI: https://oapi.dingtalk.com/robot/send?access_token={{ accessToken }}
      Headers:
        Content-Type: application/json
      Content:
        msgtype: text
        text:
          content: The ECS instances will be created
- Name: runInstances
  Action: ACS::ECS::RunInstances
  Description:
    ja: 1 つ以上の ECS インスタンスを作成します
  Properties:
    imageId: '{{ imageId }}'
    instanceType: '{{ instanceType }}'
    securityGroupId: '{{ securityGroupId }}'
    vSwitchId: '{{ vSwitchId }}'
    amount: '{{ amount }}'
  Outputs:
    instanceId:
      ValueSelector: instanceIds[0]
      Type: String
Outputs:
  instanceId:
    Type: String
    Value: '{{ runInstances.instanceId }}'
Metadata:
  ALIYUN::OOS::Interface:
    ParameterGroups:
      - Parameters:
          - accessToken
        Label:
          default:
            ja: DingTalk アクセス トークン
      - Parameters:
          - imageId
          - instanceType
          - securityGroupId
          - vSwitchId
          - amount
        Label:
          default:
            ja: インスタンス作成オプション
      - Parameters:
          - OOSAssumeRole
        Label:
          default:
            ja: 高度なオプション