1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. ecs
  5. getEcsDeploymentSets
Alibaba Cloud v3.59.0 published on Friday, Jul 12, 2024 by Pulumi

alicloud.ecs.getEcsDeploymentSets

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.59.0 published on Friday, Jul 12, 2024 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);
    
    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)
    
    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
    	})
    }
    
    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),
        };
    });
    
    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()));
        }
    }
    
    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}
    

    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>
    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]
    func GetEcsDeploymentSets(ctx *Context, args *GetEcsDeploymentSetsArgs, opts ...InvokeOption) (*GetEcsDeploymentSetsResult, error)
    func GetEcsDeploymentSetsOutput(ctx *Context, args *GetEcsDeploymentSetsOutputArgs, opts ...InvokeOption) GetEcsDeploymentSetsResultOutput

    > 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)
    }
    public static CompletableFuture<GetEcsDeploymentSetsResult> getEcsDeploymentSets(GetEcsDeploymentSetsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:ecs/getEcsDeploymentSets:getEcsDeploymentSets
      arguments:
        # arguments dictionary

    The following arguments are supported:

    DeploymentSetName string
    The name of the deployment set.
    Ids List<string>
    A list of Deployment Set IDs.
    NameRegex 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 string
    The deployment strategy. Valid values: Availability.
    DeploymentSetName string
    The name of the deployment set.
    Ids []string
    A list of Deployment Set IDs.
    NameRegex 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 string
    The deployment strategy. Valid values: Availability.
    deploymentSetName String
    The name of the deployment set.
    ids List<String>
    A list of Deployment Set IDs.
    nameRegex 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 String
    The deployment strategy. Valid values: Availability.
    deploymentSetName string
    The name of the deployment set.
    ids string[]
    A list of Deployment Set IDs.
    nameRegex 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 string
    The deployment strategy. Valid values: Availability.
    deployment_set_name str
    The name of the deployment set.
    ids Sequence[str]
    A list of Deployment Set IDs.
    name_regex 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 str
    The deployment strategy. Valid values: Availability.
    deploymentSetName String
    The name of the deployment set.
    ids List<String>
    A list of Deployment Set IDs.
    nameRegex 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 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 string
    The time when the deployment set was created.
    DeploymentSetId string
    The ID of the Deployment Set.
    DeploymentSetName string
    The name of the deployment set.
    Description string
    The description of the deployment set.
    Domain string
    The deployment domain.
    Granularity string
    The deployment granularity.
    Id string
    The ID of the Deployment Set.
    InstanceAmount int
    The number of instances in the deployment set.
    InstanceIds List<string>
    The IDs of the instances in the deployment set.
    Strategy string
    The deployment strategy.
    CreateTime string
    The time when the deployment set was created.
    DeploymentSetId string
    The ID of the Deployment Set.
    DeploymentSetName string
    The name of the deployment set.
    Description string
    The description of the deployment set.
    Domain string
    The deployment domain.
    Granularity string
    The deployment granularity.
    Id string
    The ID of the Deployment Set.
    InstanceAmount int
    The number of instances in the deployment set.
    InstanceIds []string
    The IDs of the instances in the deployment set.
    Strategy string
    The deployment strategy.
    createTime String
    The time when the deployment set was created.
    deploymentSetId String
    The ID of the Deployment Set.
    deploymentSetName String
    The name of the deployment set.
    description String
    The description of the deployment set.
    domain String
    The deployment domain.
    granularity String
    The deployment granularity.
    id String
    The ID of the Deployment Set.
    instanceAmount Integer
    The number of instances in the deployment set.
    instanceIds List<String>
    The IDs of the instances in the deployment set.
    strategy String
    The deployment strategy.
    createTime string
    The time when the deployment set was created.
    deploymentSetId string
    The ID of the Deployment Set.
    deploymentSetName string
    The name of the deployment set.
    description string
    The description of the deployment set.
    domain string
    The deployment domain.
    granularity string
    The deployment granularity.
    id string
    The ID of the Deployment Set.
    instanceAmount number
    The number of instances in the deployment set.
    instanceIds string[]
    The IDs of the instances in the deployment set.
    strategy string
    The deployment strategy.
    create_time str
    The time when the deployment set was created.
    deployment_set_id str
    The ID of the Deployment Set.
    deployment_set_name str
    The name of the deployment set.
    description str
    The description of the deployment set.
    domain str
    The deployment domain.
    granularity str
    The deployment granularity.
    id str
    The ID of the Deployment Set.
    instance_amount int
    The number of instances in the deployment set.
    instance_ids Sequence[str]
    The IDs of the instances in the deployment set.
    strategy str
    The deployment strategy.
    createTime String
    The time when the deployment set was created.
    deploymentSetId String
    The ID of the Deployment Set.
    deploymentSetName String
    The name of the deployment set.
    description String
    The description of the deployment set.
    domain String
    The deployment domain.
    granularity String
    The deployment granularity.
    id String
    The ID of the Deployment Set.
    instanceAmount Number
    The number of instances in the deployment set.
    instanceIds List<String>
    The IDs of the instances in the deployment set.
    strategy 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.
    alicloud logo
    Alibaba Cloud v3.59.0 published on Friday, Jul 12, 2024 by Pulumi