ACS-ECS-RunShellScript

更新时间:2024-09-05 07:40:19

模板名称

ACS-ECS-RunShellScript 运行shell脚本

立即执行

模板描述

运行shell脚本

模板类型

自动化

所有者

Alibaba Cloud

输入参数

参数名称

描述

类型

是否必填

默认值

约束

参数名称

描述

类型

是否必填

默认值

约束

instanceId

ECS实例

String

commandContent

云助手命令

String

workingDir

ECS实例中运行命令的目录

String

regionId

地域ID

String

{{ ACS::RegionId }}

timeout

最大超时时间,时间单位是秒

Number

600

OOSAssumeRole

OOS扮演的RAM角色

String

“”

输出参数

参数名称

描述

类型

参数名称

描述

类型

commandOutput

String

执行此模板需要的权限策略

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

详情

ACS-ECS-RunShellScript详情

模板内容

FormatVersion: OOS-2019-06-01
Description:
  en: Run shell script.
  zh-cn: 运行shell脚本
  title: ACS-ECS-RunShellScript
  name-zh-cn: 运行shell脚本
  categories:
    - run_command
Parameters:
  regionId:
    Type: String
    Label:
      en: RegionId
      zh-cn: 地域ID
    AssociationProperty: RegionId
    Default: '{{ ACS::RegionId }}'
  instanceId:
    Label:
      en: InstanceId
      zh-cn: ECS实例
    Type: String
    AssociationProperty: ALIYUN::ECS::Instance::InstanceId
    AssociationPropertyMetadata:
      RegionId: regionId
  commandContent:
    Label:
      en: CommandContent
      zh-cn: 云助手命令
    Type: String
    AssociationProperty: Code
  workingDir:
    Label:
      en: WorkingDir
      zh-cn: ECS实例中运行命令的目录
    Type: String
  timeout:
    Label:
      en: Timeout
      zh-cn: 最大超时时间,时间单位是秒
    Type: Number
    Default: 600
  OOSAssumeRole:
    Label:
      en: OOSAssumeRole
      zh-cn: OOS扮演的RAM角色
    Type: String
    Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: runCommand
  Description:
    en: Execute cloud assistant command
    zh-cn: 执行云助手命令
  Action: ACS::ECS::RunCommand
  Properties:
    regionId: '{{ regionId }}'
    commandContent: "{{ commandContent }}"
    instanceId: '{{ instanceId }}'
    commandType: RunShellScript
    workingDir: "{{ workingDir }}"
    timeout: "{{ timeout }}"
  Outputs:
    commandOutput:
      Type: String
      ValueSelector: invocationOutput
Outputs:
  commandOutput:
    Type: String
    Value: '{{ runCommand.commandOutput }}'
Metadata:
  ALIYUN::OOS::Interface:
    ParameterGroups:
      - Parameters:
          - commandContent
          - workingDir
          - timeout
        Label:
          default:
            zh-cn: 执行命令选型
            en: run command options
      - Parameters:
          - regionId
          - instanceId
        Label:
          default:
            zh-cn: 选择实例
            en: Select Ecs Instances
      - Parameters:
          - OOSAssumeRole
        Label:
          default:
            zh-cn: 高级选项
            en: Control Options
  • 本页导读 (1)
  • 模板名称
  • 模板描述
  • 模板类型
  • 所有者
  • 输入参数
  • 输出参数
  • 执行此模板需要的权限策略
  • 详情
AI助理

点击开启售前

在线咨询服务

你好,我是AI助理

可以解答问题、推荐解决方案等