Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi
alicloud.ecs.getCommands
Explore with Pulumi AI
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:
- Command
Provider string - Public order provider.
- Content
Encoding 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.
- Name
Regex string - A regex string to filter results by Command name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Type string
- The command type. Valid Values:
RunBatScript
,RunPowerShellScript
andRunShellScript
.
- Command
Provider string - Public order provider.
- Content
Encoding 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.
- Name
Regex string - A regex string to filter results by Command name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Type string
- The command type. Valid Values:
RunBatScript
,RunPowerShellScript
andRunShellScript
.
- command
Provider String - Public order provider.
- content
Encoding 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.
- name
Regex String - A regex string to filter results by Command name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - type String
- The command type. Valid Values:
RunBatScript
,RunPowerShellScript
andRunShellScript
.
- command
Provider string - Public order provider.
- content
Encoding 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.
- name
Regex string - A regex string to filter results by Command name.
- output
File string - File name where to save data source results (after running
pulumi preview
). - type string
- The command type. Valid Values:
RunBatScript
,RunPowerShellScript
andRunShellScript
.
- 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
andRunShellScript
.
- command
Provider String - Public order provider.
- content
Encoding 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.
- name
Regex String - A regex string to filter results by Command name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - type String
- The command type. Valid Values:
RunBatScript
,RunPowerShellScript
andRunShellScript
.
getCommands Result
The following output properties are available:
- Commands
List<Pulumi.
Ali Cloud. Ecs. Outputs. Get Commands Command> - Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Names List<string>
- Command
Provider string - Content
Encoding string - Description string
- Name string
- Name
Regex string - Output
File string - Type string
- Commands
[]Get
Commands Command - Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Names []string
- Command
Provider string - Content
Encoding string - Description string
- Name string
- Name
Regex string - Output
File string - Type string
- commands
List<Get
Commands Command> - id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- command
Provider String - content
Encoding String - description String
- name String
- name
Regex String - output
File String - type String
- commands
Get
Commands Command[] - id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- names string[]
- command
Provider string - content
Encoding string - description string
- name string
- name
Regex string - output
File string - type string
- commands
Sequence[Get
Commands Command] - 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>
- command
Provider String - content
Encoding String - description String
- name String
- name
Regex String - output
File String - type String
Supporting Types
GetCommandsCommand
- Command
Content string - The Base64-encoded content of the command.
- Command
Id string - The ID of the Command.
- Description string
- The description of command.
- Enable
Parameter 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
- Parameter
Names 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.
- Working
Dir string - The execution path of the command in the ECS instance.
- Command
Content string - The Base64-encoded content of the command.
- Command
Id string - The ID of the Command.
- Description string
- The description of command.
- Enable
Parameter 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
- Parameter
Names []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.
- Working
Dir string - The execution path of the command in the ECS instance.
- command
Content String - The Base64-encoded content of the command.
- command
Id String - The ID of the Command.
- description String
- The description of command.
- enable
Parameter 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
- parameter
Names 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.
- working
Dir String - The execution path of the command in the ECS instance.
- command
Content string - The Base64-encoded content of the command.
- command
Id string - The ID of the Command.
- description string
- The description of command.
- enable
Parameter 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
- parameter
Names 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.
- working
Dir 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.
- command
Content String - The Base64-encoded content of the command.
- command
Id String - The ID of the Command.
- description String
- The description of command.
- enable
Parameter 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
- parameter
Names 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.
- working
Dir 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.