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

CloudOps Orchestration Service:ACS-ECS-RunPacker

最終更新日:Dec 21, 2025

テンプレート名

ACS-ECS-RunPacker を使用して Packer テンプレートを実行できます。

今すぐ実行

テンプレートの説明

Packer テンプレートを実行します

テンプレートタイプ

自動化

所有者

Alibaba Cloud

入力パラメーター

パラメーター

説明

種類

必須

デフォルト値

制限

targets

ターゲットインスタンス

String

はい

sourceType

ファイルを保存するサービスの種類。

String

はい

sourcePath

ファイルを格納するための URL を指定する必要があります。

String

はい

templateFile

実行するPacker テンプレートの名前。

String

はい

regionId

リージョン ID 。

String

いいえ

{{ ACS::RegionId }}

tokenInfo

ファイルをダウンロードするために使用されるトークン。

String

いいえ

mode

テンプレートを使用するモード。

String

いいえ

build

OOSAssumeRole

CloudOps Orchestration Service ( OOS ) によってアシュームされるResource Access Management ( RAM ) ロール。

String

いいえ

""

出力パラメーター

パラメーター

説明

種類

result

String

テンプレートの実行に必要な権限ポリシー

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

詳細

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

テンプレートコンテンツ

FormatVersion: OOS-2019-06-01
Description:
  en: Packer テンプレートを実行します
  zh-cn: Run Packer template
  name-en: ACS-ECS-RunPacker
  name-zh-cn: Run Packer template
  categories:
    - イメージ管理
Parameters:
  regionId:
    Label:
      en: リージョン ID
      zh-cn: Region ID
    Type: String
    AssociationProperty: RegionId
    Default: '{{ ACS::RegionId }}'
  targets:
    Type: String
    Label:
      en: ターゲットインスタンス
      zh-cn: Target Instance
    AssociationProperty: Targets
    AssociationPropertyMetadata:
      ResourceType: 'ALIYUN::ECS::Instance'
      RegionId: regionId
  sourceType:
    Type: String
    Label:
      en: ソースタイプ
      zh-cn: Type of file storage
    AllowedValues:
      - oss
      - https
      - github
  sourcePath:
    Type: String
    Label:
      en: ソースパス
      zh-cn: The URL of the file to be stored.
  tokenInfo:
    Type: String
    Description:
      en: GitHub からファイルをダウンロードする場合にのみ必要です
      zh-cn: This parameter is required only when you download a file from GitHub.
    Label:
      en: トークン情報
      zh-cn: The token used to download the file.
    Default: ' '
  templateFile:
    Label:
      en: テンプレートファイル
      zh-cn: The name of the Packer template to be executed.
    Type: String
  mode:
    Type: String
    Label:
      en: モード
      zh-cn: The mode in which to use the template.
    AllowedValues:
      - validate
      - fix
      - build
    Default: build
  OOSAssumeRole:
    Label:
      en: OOSAssumeRole
      zh-cn: The RAM role to be assumed by OOS.
    Type: String
    Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
  - Name: getInstance
    Description:
      en: ECS インスタンスを表示します
      zh-cn: Retrieves ECS instances.
    Action: ACS::SelectTargets
    Properties:
      ResourceType: ALIYUN::ECS::Instance
      RegionId: '{{ regionId }}'
      Filters:
        - '{{ targets }}'
    Outputs:
      instanceId:
        Type: String
        ValueSelector: Instances.Instance[].InstanceId
  - Name: runPacker
    Action: 'ACS::ECS::RunPacker'
    Description:
      en: Packer テンプレートを実行します
      zh-cn: Runs the Packer template.
    Properties:
      regionId: '{{ regionId }}'
      instanceId: '{{ getInstance.instanceId }}'
      sourceType: '{{ sourceType }}'
      sourcePath: '{{ sourcePath }}'
      tokenInfo: '{{ tokenInfo }}'
      templateFile: '{{ templateFile }}'
      mode: '{{ mode }}'
    Outputs:
      commandOutput:
        Type: String
        ValueSelector: commandOutput
Outputs:
  result:
    Type: String
    Value: '{{ runPacker.commandOutput }}'
Metadata:
  ALIYUN::OOS::Interface:
    ParameterGroups:
      - Parameters:
          - sourceType
          - sourcePath
          - tokenInfo
          - templateFile
          - mode
        Label:
          default:
            zh-cn: Parameter Settings
            en: パラメーターオプション
      - Parameters:
          - regionId
          - targets
        Label:
          default:
            zh-cn: Select Instance
            en: ECS インスタンスの選択
      - Parameters:
          - OOSAssumeRole
        Label:
          default:
            zh-cn: Advanced Options
            en: 制御オプション