1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. ecs
  5. getCommands
Alibaba Cloud v3.57.0 published on Saturday, Jun 15, 2024 by Pulumi

alicloud.ecs.getCommands

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.0 published on Saturday, Jun 15, 2024 by Pulumi

    This data source provides the Ecs Commands of the current Alibaba Cloud user.

    NOTE: Available in v1.116.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const example = alicloud.ecs.getCommands({
        ids: ["E2RY53-xxxx"],
        nameRegex: "tf-testAcc",
    });
    export const firstEcsCommandId = example.then(example => example.commands?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    example = alicloud.ecs.get_commands(ids=["E2RY53-xxxx"],
        name_regex="tf-testAcc")
    pulumi.export("firstEcsCommandId", example.commands[0].id)
    
    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 {
    		example, err := ecs.GetCommands(ctx, &ecs.GetCommandsArgs{
    			Ids: []string{
    				"E2RY53-xxxx",
    			},
    			NameRegex: pulumi.StringRef("tf-testAcc"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("firstEcsCommandId", example.Commands[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = AliCloud.Ecs.GetCommands.Invoke(new()
        {
            Ids = new[]
            {
                "E2RY53-xxxx",
            },
            NameRegex = "tf-testAcc",
        });
    
        return new Dictionary<string, object?>
        {
            ["firstEcsCommandId"] = example.Apply(getCommandsResult => getCommandsResult.Commands[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ecs.EcsFunctions;
    import com.pulumi.alicloud.ecs.inputs.GetCommandsArgs;
    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) {
            final var example = EcsFunctions.getCommands(GetCommandsArgs.builder()
                .ids("E2RY53-xxxx")
                .nameRegex("tf-testAcc")
                .build());
    
            ctx.export("firstEcsCommandId", example.applyValue(getCommandsResult -> getCommandsResult.commands()[0].id()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: alicloud:ecs:getCommands
          Arguments:
            ids:
              - E2RY53-xxxx
            nameRegex: tf-testAcc
    outputs:
      firstEcsCommandId: ${example.commands[0].id}
    

    Using getCommands

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getCommands(args: GetCommandsArgs, opts?: InvokeOptions): Promise<GetCommandsResult>
    function getCommandsOutput(args: GetCommandsOutputArgs, opts?: InvokeOptions): Output<GetCommandsResult>
    def get_commands(command_provider: Optional[str] = None,
                     content_encoding: Optional[str] = None,
                     description: Optional[str] = None,
                     ids: Optional[Sequence[str]] = None,
                     name: Optional[str] = None,
                     name_regex: Optional[str] = None,
                     output_file: Optional[str] = None,
                     type: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetCommandsResult
    def get_commands_output(command_provider: Optional[pulumi.Input[str]] = None,
                     content_encoding: Optional[pulumi.Input[str]] = None,
                     description: Optional[pulumi.Input[str]] = None,
                     ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                     name: Optional[pulumi.Input[str]] = None,
                     name_regex: Optional[pulumi.Input[str]] = None,
                     output_file: Optional[pulumi.Input[str]] = None,
                     type: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetCommandsResult]
    func GetCommands(ctx *Context, args *GetCommandsArgs, opts ...InvokeOption) (*GetCommandsResult, error)
    func GetCommandsOutput(ctx *Context, args *GetCommandsOutputArgs, opts ...InvokeOption) GetCommandsResultOutput

    > Note: This function is named GetCommands in the Go SDK.

    public static class GetCommands 
    {
        public static Task<GetCommandsResult> InvokeAsync(GetCommandsArgs args, InvokeOptions? opts = null)
        public static Output<GetCommandsResult> Invoke(GetCommandsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetCommandsResult> getCommands(GetCommandsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:ecs/getCommands:getCommands
      arguments:
        # arguments dictionary

    The following arguments are supported:

    CommandProvider string
    Public order provider.
    ContentEncoding string
    The Base64-encoded content of the command.
    Description string
    The description of command.
    Ids List<string>
    A list of Command IDs.
    Name string
    The name of the command.
    NameRegex string
    A regex string to filter results by Command name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Type string
    The command type. Valid Values: RunBatScript, RunPowerShellScript and RunShellScript.
    CommandProvider string
    Public order provider.
    ContentEncoding string
    The Base64-encoded content of the command.
    Description string
    The description of command.
    Ids []string
    A list of Command IDs.
    Name string
    The name of the command.
    NameRegex string
    A regex string to filter results by Command name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Type string
    The command type. Valid Values: RunBatScript, RunPowerShellScript and RunShellScript.
    commandProvider String
    Public order provider.
    contentEncoding String
    The Base64-encoded content of the command.
    description String
    The description of command.
    ids List<String>
    A list of Command IDs.
    name String
    The name of the command.
    nameRegex String
    A regex string to filter results by Command name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    type String
    The command type. Valid Values: RunBatScript, RunPowerShellScript and RunShellScript.
    commandProvider string
    Public order provider.
    contentEncoding string
    The Base64-encoded content of the command.
    description string
    The description of command.
    ids string[]
    A list of Command IDs.
    name string
    The name of the command.
    nameRegex string
    A regex string to filter results by Command name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    type string
    The command type. Valid Values: RunBatScript, RunPowerShellScript and RunShellScript.
    command_provider str
    Public order provider.
    content_encoding str
    The Base64-encoded content of the command.
    description str
    The description of command.
    ids Sequence[str]
    A list of Command IDs.
    name str
    The name of the command.
    name_regex str
    A regex string to filter results by Command name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    type str
    The command type. Valid Values: RunBatScript, RunPowerShellScript and RunShellScript.
    commandProvider String
    Public order provider.
    contentEncoding String
    The Base64-encoded content of the command.
    description String
    The description of command.
    ids List<String>
    A list of Command IDs.
    name String
    The name of the command.
    nameRegex String
    A regex string to filter results by Command name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    type String
    The command type. Valid Values: RunBatScript, RunPowerShellScript and RunShellScript.

    getCommands Result

    The following output properties are available:

    Commands List<Pulumi.AliCloud.Ecs.Outputs.GetCommandsCommand>
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    CommandProvider string
    ContentEncoding string
    Description string
    Name string
    NameRegex string
    OutputFile string
    Type string
    Commands []GetCommandsCommand
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    CommandProvider string
    ContentEncoding string
    Description string
    Name string
    NameRegex string
    OutputFile string
    Type string
    commands List<GetCommandsCommand>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    commandProvider String
    contentEncoding String
    description String
    name String
    nameRegex String
    outputFile String
    type String
    commands GetCommandsCommand[]
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    commandProvider string
    contentEncoding string
    description string
    name string
    nameRegex string
    outputFile string
    type string
    commands Sequence[GetCommandsCommand]
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    command_provider str
    content_encoding str
    description str
    name str
    name_regex str
    output_file str
    type str
    commands List<Property Map>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    commandProvider String
    contentEncoding String
    description String
    name String
    nameRegex String
    outputFile String
    type String

    Supporting Types

    GetCommandsCommand

    CommandContent string
    The Base64-encoded content of the command.
    CommandId string
    The ID of the Command.
    Description string
    The description of command.
    EnableParameter bool
    Specifies whether to use custom parameters in the command to be created.
    Id string
    The ID of the Command.
    Name string
    The name of the command
    ParameterNames List<string>
    A list of custom parameter names which are parsed from the command content specified when the command was being created.
    Timeout int
    The timeout period that is specified for the command to be run on ECS instances.
    Type string
    The command type.
    WorkingDir string
    The execution path of the command in the ECS instance.
    CommandContent string
    The Base64-encoded content of the command.
    CommandId string
    The ID of the Command.
    Description string
    The description of command.
    EnableParameter bool
    Specifies whether to use custom parameters in the command to be created.
    Id string
    The ID of the Command.
    Name string
    The name of the command
    ParameterNames []string
    A list of custom parameter names which are parsed from the command content specified when the command was being created.
    Timeout int
    The timeout period that is specified for the command to be run on ECS instances.
    Type string
    The command type.
    WorkingDir string
    The execution path of the command in the ECS instance.
    commandContent String
    The Base64-encoded content of the command.
    commandId String
    The ID of the Command.
    description String
    The description of command.
    enableParameter Boolean
    Specifies whether to use custom parameters in the command to be created.
    id String
    The ID of the Command.
    name String
    The name of the command
    parameterNames List<String>
    A list of custom parameter names which are parsed from the command content specified when the command was being created.
    timeout Integer
    The timeout period that is specified for the command to be run on ECS instances.
    type String
    The command type.
    workingDir String
    The execution path of the command in the ECS instance.
    commandContent string
    The Base64-encoded content of the command.
    commandId string
    The ID of the Command.
    description string
    The description of command.
    enableParameter boolean
    Specifies whether to use custom parameters in the command to be created.
    id string
    The ID of the Command.
    name string
    The name of the command
    parameterNames string[]
    A list of custom parameter names which are parsed from the command content specified when the command was being created.
    timeout number
    The timeout period that is specified for the command to be run on ECS instances.
    type string
    The command type.
    workingDir string
    The execution path of the command in the ECS instance.
    command_content str
    The Base64-encoded content of the command.
    command_id str
    The ID of the Command.
    description str
    The description of command.
    enable_parameter bool
    Specifies whether to use custom parameters in the command to be created.
    id str
    The ID of the Command.
    name str
    The name of the command
    parameter_names Sequence[str]
    A list of custom parameter names which are parsed from the command content specified when the command was being created.
    timeout int
    The timeout period that is specified for the command to be run on ECS instances.
    type str
    The command type.
    working_dir str
    The execution path of the command in the ECS instance.
    commandContent String
    The Base64-encoded content of the command.
    commandId String
    The ID of the Command.
    description String
    The description of command.
    enableParameter Boolean
    Specifies whether to use custom parameters in the command to be created.
    id String
    The ID of the Command.
    name String
    The name of the command
    parameterNames List<String>
    A list of custom parameter names which are parsed from the command content specified when the command was being created.
    timeout Number
    The timeout period that is specified for the command to be run on ECS instances.
    type String
    The command type.
    workingDir String
    The execution path of the command in the ECS instance.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.57.0 published on Saturday, Jun 15, 2024 by Pulumi