EcsInvocation

class EcsInvocation : KotlinCustomResource

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>

Properties

Link copied to clipboard
val commandId: Output<String>

The ID of the command.

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

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

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val instanceIds: Output<List<String>>

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>>?

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 pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val repeatMode: Output<String>

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 status: Output<String>

The status of the resource.

Link copied to clipboard
val timed: Output<Boolean>

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

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val username: Output<String>

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

Link copied to clipboard

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