1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. ecs
  5. getEcsDeploymentSets
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.ecs.getEcsDeploymentSets

Explore with Pulumi AI

Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

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

NOTE: Available in v1.140.0+.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const ids = alicloud.ecs.getEcsDeploymentSets({
    ids: ["example_id"],
});
export const ecsDeploymentSetId1 = ids.then(ids => ids.sets?.[0]?.id);
const nameRegex = alicloud.ecs.getEcsDeploymentSets({
    nameRegex: "^my-DeploymentSet",
});
export const ecsDeploymentSetId2 = nameRegex.then(nameRegex => nameRegex.sets?.[0]?.id);
Copy
import pulumi
import pulumi_alicloud as alicloud

ids = alicloud.ecs.get_ecs_deployment_sets(ids=["example_id"])
pulumi.export("ecsDeploymentSetId1", ids.sets[0].id)
name_regex = alicloud.ecs.get_ecs_deployment_sets(name_regex="^my-DeploymentSet")
pulumi.export("ecsDeploymentSetId2", name_regex.sets[0].id)
Copy
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 {
		ids, err := ecs.GetEcsDeploymentSets(ctx, &ecs.GetEcsDeploymentSetsArgs{
			Ids: []string{
				"example_id",
			},
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("ecsDeploymentSetId1", ids.Sets[0].Id)
		nameRegex, err := ecs.GetEcsDeploymentSets(ctx, &ecs.GetEcsDeploymentSetsArgs{
			NameRegex: pulumi.StringRef("^my-DeploymentSet"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("ecsDeploymentSetId2", nameRegex.Sets[0].Id)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var ids = AliCloud.Ecs.GetEcsDeploymentSets.Invoke(new()
    {
        Ids = new[]
        {
            "example_id",
        },
    });

    var nameRegex = AliCloud.Ecs.GetEcsDeploymentSets.Invoke(new()
    {
        NameRegex = "^my-DeploymentSet",
    });

    return new Dictionary<string, object?>
    {
        ["ecsDeploymentSetId1"] = ids.Apply(getEcsDeploymentSetsResult => getEcsDeploymentSetsResult.Sets[0]?.Id),
        ["ecsDeploymentSetId2"] = nameRegex.Apply(getEcsDeploymentSetsResult => getEcsDeploymentSetsResult.Sets[0]?.Id),
    };
});
Copy
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.GetEcsDeploymentSetsArgs;
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 ids = EcsFunctions.getEcsDeploymentSets(GetEcsDeploymentSetsArgs.builder()
            .ids("example_id")
            .build());

        ctx.export("ecsDeploymentSetId1", ids.applyValue(getEcsDeploymentSetsResult -> getEcsDeploymentSetsResult.sets()[0].id()));
        final var nameRegex = EcsFunctions.getEcsDeploymentSets(GetEcsDeploymentSetsArgs.builder()
            .nameRegex("^my-DeploymentSet")
            .build());

        ctx.export("ecsDeploymentSetId2", nameRegex.applyValue(getEcsDeploymentSetsResult -> getEcsDeploymentSetsResult.sets()[0].id()));
    }
}
Copy
variables:
  ids:
    fn::invoke:
      function: alicloud:ecs:getEcsDeploymentSets
      arguments:
        ids:
          - example_id
  nameRegex:
    fn::invoke:
      function: alicloud:ecs:getEcsDeploymentSets
      arguments:
        nameRegex: ^my-DeploymentSet
outputs:
  ecsDeploymentSetId1: ${ids.sets[0].id}
  ecsDeploymentSetId2: ${nameRegex.sets[0].id}
Copy

Using getEcsDeploymentSets

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 getEcsDeploymentSets(args: GetEcsDeploymentSetsArgs, opts?: InvokeOptions): Promise<GetEcsDeploymentSetsResult>
function getEcsDeploymentSetsOutput(args: GetEcsDeploymentSetsOutputArgs, opts?: InvokeOptions): Output<GetEcsDeploymentSetsResult>
Copy
def get_ecs_deployment_sets(deployment_set_name: Optional[str] = None,
                            ids: Optional[Sequence[str]] = None,
                            name_regex: Optional[str] = None,
                            output_file: Optional[str] = None,
                            strategy: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetEcsDeploymentSetsResult
def get_ecs_deployment_sets_output(deployment_set_name: Optional[pulumi.Input[str]] = None,
                            ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                            name_regex: Optional[pulumi.Input[str]] = None,
                            output_file: Optional[pulumi.Input[str]] = None,
                            strategy: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetEcsDeploymentSetsResult]
Copy
func GetEcsDeploymentSets(ctx *Context, args *GetEcsDeploymentSetsArgs, opts ...InvokeOption) (*GetEcsDeploymentSetsResult, error)
func GetEcsDeploymentSetsOutput(ctx *Context, args *GetEcsDeploymentSetsOutputArgs, opts ...InvokeOption) GetEcsDeploymentSetsResultOutput
Copy

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

public static class GetEcsDeploymentSets 
{
    public static Task<GetEcsDeploymentSetsResult> InvokeAsync(GetEcsDeploymentSetsArgs args, InvokeOptions? opts = null)
    public static Output<GetEcsDeploymentSetsResult> Invoke(GetEcsDeploymentSetsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetEcsDeploymentSetsResult> getEcsDeploymentSets(GetEcsDeploymentSetsArgs args, InvokeOptions options)
public static Output<GetEcsDeploymentSetsResult> getEcsDeploymentSets(GetEcsDeploymentSetsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:ecs/getEcsDeploymentSets:getEcsDeploymentSets
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

DeploymentSetName Changes to this property will trigger replacement. string
The name of the deployment set.
Ids Changes to this property will trigger replacement. List<string>
A list of Deployment Set IDs.
NameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Deployment Set name.
OutputFile string
File name where to save data source results (after running pulumi preview).
Strategy Changes to this property will trigger replacement. string
The deployment strategy. Valid values: Availability.
DeploymentSetName Changes to this property will trigger replacement. string
The name of the deployment set.
Ids Changes to this property will trigger replacement. []string
A list of Deployment Set IDs.
NameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Deployment Set name.
OutputFile string
File name where to save data source results (after running pulumi preview).
Strategy Changes to this property will trigger replacement. string
The deployment strategy. Valid values: Availability.
deploymentSetName Changes to this property will trigger replacement. String
The name of the deployment set.
ids Changes to this property will trigger replacement. List<String>
A list of Deployment Set IDs.
nameRegex Changes to this property will trigger replacement. String
A regex string to filter results by Deployment Set name.
outputFile String
File name where to save data source results (after running pulumi preview).
strategy Changes to this property will trigger replacement. String
The deployment strategy. Valid values: Availability.
deploymentSetName Changes to this property will trigger replacement. string
The name of the deployment set.
ids Changes to this property will trigger replacement. string[]
A list of Deployment Set IDs.
nameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Deployment Set name.
outputFile string
File name where to save data source results (after running pulumi preview).
strategy Changes to this property will trigger replacement. string
The deployment strategy. Valid values: Availability.
deployment_set_name Changes to this property will trigger replacement. str
The name of the deployment set.
ids Changes to this property will trigger replacement. Sequence[str]
A list of Deployment Set IDs.
name_regex Changes to this property will trigger replacement. str
A regex string to filter results by Deployment Set name.
output_file str
File name where to save data source results (after running pulumi preview).
strategy Changes to this property will trigger replacement. str
The deployment strategy. Valid values: Availability.
deploymentSetName Changes to this property will trigger replacement. String
The name of the deployment set.
ids Changes to this property will trigger replacement. List<String>
A list of Deployment Set IDs.
nameRegex Changes to this property will trigger replacement. String
A regex string to filter results by Deployment Set name.
outputFile String
File name where to save data source results (after running pulumi preview).
strategy Changes to this property will trigger replacement. String
The deployment strategy. Valid values: Availability.

getEcsDeploymentSets Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Ids List<string>
Names List<string>
Sets List<Pulumi.AliCloud.Ecs.Outputs.GetEcsDeploymentSetsSet>
DeploymentSetName string
NameRegex string
OutputFile string
Strategy string
Id string
The provider-assigned unique ID for this managed resource.
Ids []string
Names []string
Sets []GetEcsDeploymentSetsSet
DeploymentSetName string
NameRegex string
OutputFile string
Strategy string
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
names List<String>
sets List<GetEcsDeploymentSetsSet>
deploymentSetName String
nameRegex String
outputFile String
strategy String
id string
The provider-assigned unique ID for this managed resource.
ids string[]
names string[]
sets GetEcsDeploymentSetsSet[]
deploymentSetName string
nameRegex string
outputFile string
strategy string
id str
The provider-assigned unique ID for this managed resource.
ids Sequence[str]
names Sequence[str]
sets Sequence[GetEcsDeploymentSetsSet]
deployment_set_name str
name_regex str
output_file str
strategy str
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
names List<String>
sets List<Property Map>
deploymentSetName String
nameRegex String
outputFile String
strategy String

Supporting Types

GetEcsDeploymentSetsSet

CreateTime This property is required. string
The time when the deployment set was created.
DeploymentSetId This property is required. string
The ID of the Deployment Set.
DeploymentSetName This property is required. string
The name of the deployment set.
Description This property is required. string
The description of the deployment set.
Domain This property is required. string
The deployment domain.
Granularity This property is required. string
The deployment granularity.
Id This property is required. string
The ID of the Deployment Set.
InstanceAmount This property is required. int
The number of instances in the deployment set.
InstanceIds This property is required. List<string>
The IDs of the instances in the deployment set.
Strategy This property is required. string
The deployment strategy.
CreateTime This property is required. string
The time when the deployment set was created.
DeploymentSetId This property is required. string
The ID of the Deployment Set.
DeploymentSetName This property is required. string
The name of the deployment set.
Description This property is required. string
The description of the deployment set.
Domain This property is required. string
The deployment domain.
Granularity This property is required. string
The deployment granularity.
Id This property is required. string
The ID of the Deployment Set.
InstanceAmount This property is required. int
The number of instances in the deployment set.
InstanceIds This property is required. []string
The IDs of the instances in the deployment set.
Strategy This property is required. string
The deployment strategy.
createTime This property is required. String
The time when the deployment set was created.
deploymentSetId This property is required. String
The ID of the Deployment Set.
deploymentSetName This property is required. String
The name of the deployment set.
description This property is required. String
The description of the deployment set.
domain This property is required. String
The deployment domain.
granularity This property is required. String
The deployment granularity.
id This property is required. String
The ID of the Deployment Set.
instanceAmount This property is required. Integer
The number of instances in the deployment set.
instanceIds This property is required. List<String>
The IDs of the instances in the deployment set.
strategy This property is required. String
The deployment strategy.
createTime This property is required. string
The time when the deployment set was created.
deploymentSetId This property is required. string
The ID of the Deployment Set.
deploymentSetName This property is required. string
The name of the deployment set.
description This property is required. string
The description of the deployment set.
domain This property is required. string
The deployment domain.
granularity This property is required. string
The deployment granularity.
id This property is required. string
The ID of the Deployment Set.
instanceAmount This property is required. number
The number of instances in the deployment set.
instanceIds This property is required. string[]
The IDs of the instances in the deployment set.
strategy This property is required. string
The deployment strategy.
create_time This property is required. str
The time when the deployment set was created.
deployment_set_id This property is required. str
The ID of the Deployment Set.
deployment_set_name This property is required. str
The name of the deployment set.
description This property is required. str
The description of the deployment set.
domain This property is required. str
The deployment domain.
granularity This property is required. str
The deployment granularity.
id This property is required. str
The ID of the Deployment Set.
instance_amount This property is required. int
The number of instances in the deployment set.
instance_ids This property is required. Sequence[str]
The IDs of the instances in the deployment set.
strategy This property is required. str
The deployment strategy.
createTime This property is required. String
The time when the deployment set was created.
deploymentSetId This property is required. String
The ID of the Deployment Set.
deploymentSetName This property is required. String
The name of the deployment set.
description This property is required. String
The description of the deployment set.
domain This property is required. String
The deployment domain.
granularity This property is required. String
The deployment granularity.
id This property is required. String
The ID of the Deployment Set.
instanceAmount This property is required. Number
The number of instances in the deployment set.
instanceIds This property is required. List<String>
The IDs of the instances in the deployment set.
strategy This property is required. String
The deployment strategy.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi