EcsInvocationArgs

data class EcsInvocationArgs(val commandId: Output<String>? = null, val frequency: Output<String>? = null, val instanceIds: Output<List<String>>? = null, val parameters: Output<Map<String, Any>>? = null, val repeatMode: Output<String>? = null, val timed: Output<Boolean>? = null, val username: Output<String>? = null, val windowsPasswordName: Output<String>? = null) : ConvertibleToJava<EcsInvocationArgs>

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

NOTE: Available in v1.168.0+.

Example Usage

Basic Usage

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 com.pulumi.alicloud.ecs.EcsFunctions;
import com.pulumi.alicloud.ecs.inputs.GetInstancesArgs;
import com.pulumi.alicloud.ecs.EcsInvocation;
import com.pulumi.alicloud.ecs.EcsInvocationArgs;
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 defaultCommand = new Command("defaultCommand", CommandArgs.builder()
.commandContent("bHMK")
.description("terraform-example")
.type("RunShellScript")
.workingDir("/root")
.build());
final var defaultInstances = EcsFunctions.getInstances(GetInstancesArgs.builder()
.status("Running")
.build());
var defaultEcsInvocation = new EcsInvocation("defaultEcsInvocation", EcsInvocationArgs.builder()
.commandId(defaultCommand.id())
.instanceIds(defaultInstances.applyValue(getInstancesResult -> getInstancesResult.ids()[0]))
.build());
}
}

Import

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

$ pulumi import alicloud:ecs/ecsInvocation:EcsInvocation example <id>

Constructors

Link copied to clipboard
fun EcsInvocationArgs(commandId: Output<String>? = null, frequency: Output<String>? = null, instanceIds: Output<List<String>>? = null, parameters: Output<Map<String, Any>>? = null, repeatMode: Output<String>? = null, timed: Output<Boolean>? = null, username: Output<String>? = null, windowsPasswordName: Output<String>? = null)

Functions

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

Properties

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

The ID of the command.

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

The schedule on which the recurring execution of the command takes place. Take note of the following items:

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

The list of instances to execute the command. You can specify up to 50 instance IDs.

Link copied to clipboard
val parameters: Output<Map<String, Any>>? = null

The key-value pairs of custom parameters to be passed in when the custom parameter feature is enabled. Number of custom parameters: 0 to 10.

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

Specifies how to run the command. Valid values: Once, Period, NextRebootOnly, EveryReboot. Default value: When timed is set to false and Frequency is not specified, the default value of repeat_mode is Once. When Timed is set to true and Frequency is specified, period is used as the value of RepeatMode regardless of whether repeat_mode is specified.

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

Specifies whether to periodically run the command. Default value: false.

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

The username that is used to run the command on the ECS instance.

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

The name of the password used to run the command on a Windows instance.