全部产品
Search
文档中心

CloudOps Orchestration Service:ACS-ECS-RunPacker

更新时间:Dec 21, 2025

Nama Template

ACS-ECS-RunPacker memungkinkan Anda menjalankan template Packer.

Eksekusi Sekarang

Deskripsi Template

Menjalankan templat Packer.

Jenis templat

Otomatis

Pemilik

Alibaba Cloud

Parameter Input

Parameter

Deskripsi

Tipe

Diperlukan

Nilai Default

Batasan

targets

Instans tujuan

String

Ya

sourceType

Tipe layanan yang menyimpan file.

String

Ya

sourcePath

Anda harus menentukan URL untuk menyimpan file.

String

Ya

templateFile

Nama template Packer yang akan dijalankan.

String

Ya

regionId

ID wilayah.

String

Tidak

{{ ACS::RegionId }}

tokenInfo

Token yang digunakan untuk mengunduh file.

String

Tidak

mode

Mode penggunaan template.

String

Tidak

build

OOSAssumeRole

Peran Resource Access Management (RAM) yang diasumsikan oleh CloudOps Orchestration Service (OOS).

String

Tidak

""

Parameter Keluaran

Parameter

Deskripsi

Tipe

result

String

Kebijakan Izin yang Diperlukan untuk Menjalankan Template

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

Rincian

Untuk detail selengkapnya, lihat ACS-ECS-RunPacker.

Konten Template

FormatVersion: OOS-2019-06-01
Description:
  en: Run packer template
  zh-cn: Run Packer template
  name-en: ACS-ECS-RunPacker
  name-zh-cn: Run Packer template
  categories:
    - image_manage
Parameters:
  regionId:
    Label:
      en: RegionId
      zh-cn: Region ID
    Type: String
    AssociationProperty: RegionId
    Default: '{{ ACS::RegionId }}'
  targets:
    Type: String
    Label:
      en: TargetInstance
      zh-cn: Target Instance
    AssociationProperty: Targets
    AssociationPropertyMetadata:
      ResourceType: 'ALIYUN::ECS::Instance'
      RegionId: regionId
  sourceType:
    Type: String
    Label:
      en: SourceType
      zh-cn: Type of file storage
    AllowedValues:
      - oss
      - https
      - github
  sourcePath:
    Type: String
    Label:
      en: SourcePath
      zh-cn: The URL of the file to be stored.
  tokenInfo:
    Type: String
    Description:
      en: It is only required when downloading file from GitHub
      zh-cn: This parameter is required only when you download a file from GitHub.
    Label:
      en: TokenInfo
      zh-cn: The token used to download the file.
    Default: ' '
  templateFile:
    Label:
      en: TemplateFile
      zh-cn: The name of the Packer template to be executed.
    Type: String
  mode:
    Type: String
    Label:
      en: Mode
      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: Views the ECS instances
      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: Run packer template
      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 Options
      - Parameters:
          - regionId
          - targets
        Label:
          default:
            zh-cn: Select Instance
            en: Select ECS Instance
      - Parameters:
          - OOSAssumeRole
        Label:
          default:
            zh-cn: Advanced Options
            en: Control Options