CommandArgs

data class CommandArgs(val commandContent: Output<String>? = null, val description: Output<String>? = null, val enableParameter: Output<Boolean>? = null, val name: Output<String>? = null, val timeout: Output<Int>? = null, val type: Output<String>? = null, val workingDir: Output<String>? = null) : ConvertibleToJava<CommandArgs>

Provides a ECS Command resource. For information about ECS Command and how to use it, see What is Command.

NOTE: Available in v1.116.0+.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const example = new alicloud.ecs.Command("example", {
name: "tf-testAcc",
commandContent: "bHMK",
description: "For Terraform Test",
type: "RunShellScript",
workingDir: "/root",
});
import pulumi
import pulumi_alicloud as alicloud
example = alicloud.ecs.Command("example",
name="tf-testAcc",
command_content="bHMK",
description="For Terraform Test",
type="RunShellScript",
working_dir="/root")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var example = new AliCloud.Ecs.Command("example", new()
{
Name = "tf-testAcc",
CommandContent = "bHMK",
Description = "For Terraform Test",
Type = "RunShellScript",
WorkingDir = "/root",
});
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ecs.NewCommand(ctx, "example", &ecs.CommandArgs{
Name: pulumi.String("tf-testAcc"),
CommandContent: pulumi.String("bHMK"),
Description: pulumi.String("For Terraform Test"),
Type: pulumi.String("RunShellScript"),
WorkingDir: pulumi.String("/root"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.ecs.Command;
import com.pulumi.alicloud.ecs.CommandArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Command("example", CommandArgs.builder()
.name("tf-testAcc")
.commandContent("bHMK")
.description("For Terraform Test")
.type("RunShellScript")
.workingDir("/root")
.build());
}
}
resources:
example:
type: alicloud:ecs:Command
properties:
name: tf-testAcc
commandContent: bHMK
description: For Terraform Test
type: RunShellScript
workingDir: /root

Import

ECS Command can be imported using the id, e.g.

$ pulumi import alicloud:ecs/command:Command example <id>

Constructors

Link copied to clipboard
constructor(commandContent: Output<String>? = null, description: Output<String>? = null, enableParameter: Output<Boolean>? = null, name: Output<String>? = null, timeout: Output<Int>? = null, type: Output<String>? = null, workingDir: Output<String>? = null)

Properties

Link copied to clipboard
val commandContent: Output<String>? = null

The Base64-encoded content of the command.

Link copied to clipboard
val description: Output<String>? = null

The description of command.

Link copied to clipboard
val enableParameter: Output<Boolean>? = null

Specifies whether to use custom parameters in the command to be created. Default to: false.

Link copied to clipboard
val name: Output<String>? = null

The name of the command, which supports all character sets. It can be up to 128 characters in length.

Link copied to clipboard
val timeout: Output<Int>? = null

The timeout period that is specified for the command to be run on ECS instances. Unit: seconds. Default to: 60.

Link copied to clipboard
val type: Output<String>? = null

The command type. Valid Values: RunBatScript, RunPowerShellScript and RunShellScript.

Link copied to clipboard
val workingDir: Output<String>? = null

The execution path of the command in the ECS instance.

Functions

Link copied to clipboard
open override fun toJava(): CommandArgs