Alibaba Cloud

Pulumi Official
Package maintained by Pulumi
v3.27.0 published on Monday, Aug 8, 2022 by Pulumi

Command

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

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new AliCloud.Ecs.Command("example", new AliCloud.Ecs.CommandArgs
        {
            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{
			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()        
            .commandContent("bHMK")
            .description("For Terraform Test")
            .type("RunShellScript")
            .workingDir("/root")
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

example = alicloud.ecs.Command("example",
    command_content="bHMK",
    description="For Terraform Test",
    type="RunShellScript",
    working_dir="/root")
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const example = new alicloud.ecs.Command("example", {
    commandContent: "bHMK",
    description: "For Terraform Test",
    type: "RunShellScript",
    workingDir: "/root",
});
resources:
  example:
    type: alicloud:ecs:Command
    properties:
      commandContent: bHMK
      description: For Terraform Test
      type: RunShellScript
      workingDir: /root

Create a Command Resource

new Command(name: string, args: CommandArgs, opts?: CustomResourceOptions);
@overload
def Command(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            command_content: Optional[str] = None,
            description: Optional[str] = None,
            enable_parameter: Optional[bool] = None,
            name: Optional[str] = None,
            timeout: Optional[int] = None,
            type: Optional[str] = None,
            working_dir: Optional[str] = None)
@overload
def Command(resource_name: str,
            args: CommandArgs,
            opts: Optional[ResourceOptions] = None)
func NewCommand(ctx *Context, name string, args CommandArgs, opts ...ResourceOption) (*Command, error)
public Command(string name, CommandArgs args, CustomResourceOptions? opts = null)
public Command(String name, CommandArgs args)
public Command(String name, CommandArgs args, CustomResourceOptions options)
type: alicloud:ecs:Command
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args CommandArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args CommandArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args CommandArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args CommandArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args CommandArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Command Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Command resource accepts the following input properties:

CommandContent string

The Base64-encoded content of the command.

Type string

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

Description string

The description of command.

EnableParameter bool

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

Name string

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

Timeout int

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

WorkingDir string

The execution path of the command in the ECS instance.

CommandContent string

The Base64-encoded content of the command.

Type string

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

Description string

The description of command.

EnableParameter bool

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

Name string

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

Timeout int

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

WorkingDir string

The execution path of the command in the ECS instance.

commandContent String

The Base64-encoded content of the command.

type String

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

description String

The description of command.

enableParameter Boolean

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

name String

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

timeout Integer

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

workingDir String

The execution path of the command in the ECS instance.

commandContent string

The Base64-encoded content of the command.

type string

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

description string

The description of command.

enableParameter boolean

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

name string

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

timeout number

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

workingDir string

The execution path of the command in the ECS instance.

command_content str

The Base64-encoded content of the command.

type str

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

description str

The description of command.

enable_parameter bool

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

name str

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

timeout int

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

working_dir str

The execution path of the command in the ECS instance.

commandContent String

The Base64-encoded content of the command.

type String

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

description String

The description of command.

enableParameter Boolean

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

name String

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

timeout Number

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

workingDir String

The execution path of the command in the ECS instance.

Outputs

All input properties are implicitly available as output properties. Additionally, the Command resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up an Existing Command Resource

Get an existing Command resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: CommandState, opts?: CustomResourceOptions): Command
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        command_content: Optional[str] = None,
        description: Optional[str] = None,
        enable_parameter: Optional[bool] = None,
        name: Optional[str] = None,
        timeout: Optional[int] = None,
        type: Optional[str] = None,
        working_dir: Optional[str] = None) -> Command
func GetCommand(ctx *Context, name string, id IDInput, state *CommandState, opts ...ResourceOption) (*Command, error)
public static Command Get(string name, Input<string> id, CommandState? state, CustomResourceOptions? opts = null)
public static Command get(String name, Output<String> id, CommandState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
CommandContent string

The Base64-encoded content of the command.

Description string

The description of command.

EnableParameter bool

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

Name string

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

Timeout int

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

Type string

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

WorkingDir string

The execution path of the command in the ECS instance.

CommandContent string

The Base64-encoded content of the command.

Description string

The description of command.

EnableParameter bool

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

Name string

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

Timeout int

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

Type string

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

WorkingDir string

The execution path of the command in the ECS instance.

commandContent String

The Base64-encoded content of the command.

description String

The description of command.

enableParameter Boolean

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

name String

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

timeout Integer

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

type String

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

workingDir String

The execution path of the command in the ECS instance.

commandContent string

The Base64-encoded content of the command.

description string

The description of command.

enableParameter boolean

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

name string

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

timeout number

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

type string

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

workingDir string

The execution path of the command in the ECS instance.

command_content str

The Base64-encoded content of the command.

description str

The description of command.

enable_parameter bool

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

name str

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

timeout int

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

type str

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

working_dir str

The execution path of the command in the ECS instance.

commandContent String

The Base64-encoded content of the command.

description String

The description of command.

enableParameter Boolean

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

name String

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

timeout Number

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

type String

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

workingDir String

The execution path of the command in the ECS instance.

Import

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

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

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.