getEcsDeploymentSets

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);
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)
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&#46;Apply(getEcsDeploymentSetsResult => getEcsDeploymentSetsResult&#46;Sets[0]?.Id),
["ecsDeploymentSetId2"] = nameRegex&#46;Apply(getEcsDeploymentSetsResult => getEcsDeploymentSetsResult&#46;Sets[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 {
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
})
}
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.sets()[0].id());
final var nameRegex = EcsFunctions.getEcsDeploymentSets(GetEcsDeploymentSetsArgs.builder()
.nameRegex("^my-DeploymentSet")
.build());
ctx.export("ecsDeploymentSetId2", nameRegex.sets()[0].id());
}
}
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}

Return

A collection of values returned by getEcsDeploymentSets.

Parameters

argument

A collection of arguments for invoking getEcsDeploymentSets.


suspend fun getEcsDeploymentSets(deploymentSetName: String? = null, ids: List<String>? = null, nameRegex: String? = null, outputFile: String? = null, strategy: String? = null): GetEcsDeploymentSetsResult

Return

A collection of values returned by getEcsDeploymentSets.

Parameters

deploymentSetName

The name of the deployment set.

ids

A list of Deployment Set IDs.

nameRegex

A regex string to filter results by Deployment Set name.

outputFile

File name where to save data source results (after running pulumi preview).

strategy

The deployment strategy. Valid values: Availability.

See also


Return

A collection of values returned by getEcsDeploymentSets.

Parameters

argument

Builder for com.pulumi.alicloud.ecs.kotlin.inputs.GetEcsDeploymentSetsPlainArgs.

See also