1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. ros
  5. getStackInstances
Alibaba Cloud v3.52.1 published on Thursday, Apr 4, 2024 by Pulumi

alicloud.ros.getStackInstances

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.52.1 published on Thursday, Apr 4, 2024 by Pulumi

    This data source provides the Ros Stack Instances of the current Alibaba Cloud user.

    NOTE: Available in v1.145.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ids = alicloud.ros.getStackInstances({
        stackGroupName: "example_value",
        ids: [
            "example_value-1",
            "example_value-2",
        ],
        enableDetails: true,
    });
    export const rosStackInstanceId1 = ids.then(ids => ids.instances?.[0]?.id);
    const status = alicloud.ros.getStackInstances({
        stackGroupName: "example_value",
        status: "CURRENT",
        enableDetails: true,
    });
    export const rosStackInstanceId2 = status.then(status => status.instances?.[0]?.id);
    const regionId = alicloud.ros.getStackInstances({
        stackGroupName: "example_value",
        stackInstanceRegionId: "example_value",
        enableDetails: true,
    });
    export const rosStackInstanceId3 = regionId.then(regionId => regionId.instances?.[0]?.id);
    const accountId = alicloud.ros.getStackInstances({
        stackGroupName: "example_value",
        stackInstanceAccountId: "example_value",
        enableDetails: true,
    });
    export const rosStackInstanceId4 = accountId.then(accountId => accountId.instances?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.ros.get_stack_instances(stack_group_name="example_value",
        ids=[
            "example_value-1",
            "example_value-2",
        ],
        enable_details=True)
    pulumi.export("rosStackInstanceId1", ids.instances[0].id)
    status = alicloud.ros.get_stack_instances(stack_group_name="example_value",
        status="CURRENT",
        enable_details=True)
    pulumi.export("rosStackInstanceId2", status.instances[0].id)
    region_id = alicloud.ros.get_stack_instances(stack_group_name="example_value",
        stack_instance_region_id="example_value",
        enable_details=True)
    pulumi.export("rosStackInstanceId3", region_id.instances[0].id)
    account_id = alicloud.ros.get_stack_instances(stack_group_name="example_value",
        stack_instance_account_id="example_value",
        enable_details=True)
    pulumi.export("rosStackInstanceId4", account_id.instances[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ros"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		ids, err := ros.GetStackInstances(ctx, &ros.GetStackInstancesArgs{
    			StackGroupName: "example_value",
    			Ids: []string{
    				"example_value-1",
    				"example_value-2",
    			},
    			EnableDetails: pulumi.BoolRef(true),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("rosStackInstanceId1", ids.Instances[0].Id)
    		status, err := ros.GetStackInstances(ctx, &ros.GetStackInstancesArgs{
    			StackGroupName: "example_value",
    			Status:         pulumi.StringRef("CURRENT"),
    			EnableDetails:  pulumi.BoolRef(true),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("rosStackInstanceId2", status.Instances[0].Id)
    		regionId, err := ros.GetStackInstances(ctx, &ros.GetStackInstancesArgs{
    			StackGroupName:        "example_value",
    			StackInstanceRegionId: pulumi.StringRef("example_value"),
    			EnableDetails:         pulumi.BoolRef(true),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("rosStackInstanceId3", regionId.Instances[0].Id)
    		accountId, err := ros.GetStackInstances(ctx, &ros.GetStackInstancesArgs{
    			StackGroupName:         "example_value",
    			StackInstanceAccountId: pulumi.StringRef("example_value"),
    			EnableDetails:          pulumi.BoolRef(true),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("rosStackInstanceId4", accountId.Instances[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ids = AliCloud.Ros.GetStackInstances.Invoke(new()
        {
            StackGroupName = "example_value",
            Ids = new[]
            {
                "example_value-1",
                "example_value-2",
            },
            EnableDetails = true,
        });
    
        var status = AliCloud.Ros.GetStackInstances.Invoke(new()
        {
            StackGroupName = "example_value",
            Status = "CURRENT",
            EnableDetails = true,
        });
    
        var regionId = AliCloud.Ros.GetStackInstances.Invoke(new()
        {
            StackGroupName = "example_value",
            StackInstanceRegionId = "example_value",
            EnableDetails = true,
        });
    
        var accountId = AliCloud.Ros.GetStackInstances.Invoke(new()
        {
            StackGroupName = "example_value",
            StackInstanceAccountId = "example_value",
            EnableDetails = true,
        });
    
        return new Dictionary<string, object?>
        {
            ["rosStackInstanceId1"] = ids.Apply(getStackInstancesResult => getStackInstancesResult.Instances[0]?.Id),
            ["rosStackInstanceId2"] = status.Apply(getStackInstancesResult => getStackInstancesResult.Instances[0]?.Id),
            ["rosStackInstanceId3"] = regionId.Apply(getStackInstancesResult => getStackInstancesResult.Instances[0]?.Id),
            ["rosStackInstanceId4"] = accountId.Apply(getStackInstancesResult => getStackInstancesResult.Instances[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ros.RosFunctions;
    import com.pulumi.alicloud.ros.inputs.GetStackInstancesArgs;
    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 = RosFunctions.getStackInstances(GetStackInstancesArgs.builder()
                .stackGroupName("example_value")
                .ids(            
                    "example_value-1",
                    "example_value-2")
                .enableDetails(true)
                .build());
    
            ctx.export("rosStackInstanceId1", ids.applyValue(getStackInstancesResult -> getStackInstancesResult.instances()[0].id()));
            final var status = RosFunctions.getStackInstances(GetStackInstancesArgs.builder()
                .stackGroupName("example_value")
                .status("CURRENT")
                .enableDetails(true)
                .build());
    
            ctx.export("rosStackInstanceId2", status.applyValue(getStackInstancesResult -> getStackInstancesResult.instances()[0].id()));
            final var regionId = RosFunctions.getStackInstances(GetStackInstancesArgs.builder()
                .stackGroupName("example_value")
                .stackInstanceRegionId("example_value")
                .enableDetails(true)
                .build());
    
            ctx.export("rosStackInstanceId3", regionId.applyValue(getStackInstancesResult -> getStackInstancesResult.instances()[0].id()));
            final var accountId = RosFunctions.getStackInstances(GetStackInstancesArgs.builder()
                .stackGroupName("example_value")
                .stackInstanceAccountId("example_value")
                .enableDetails(true)
                .build());
    
            ctx.export("rosStackInstanceId4", accountId.applyValue(getStackInstancesResult -> getStackInstancesResult.instances()[0].id()));
        }
    }
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:ros:getStackInstances
          Arguments:
            stackGroupName: example_value
            ids:
              - example_value-1
              - example_value-2
            enableDetails: true
      status:
        fn::invoke:
          Function: alicloud:ros:getStackInstances
          Arguments:
            stackGroupName: example_value
            status: CURRENT
            enableDetails: true
      regionId:
        fn::invoke:
          Function: alicloud:ros:getStackInstances
          Arguments:
            stackGroupName: example_value
            stackInstanceRegionId: example_value
            enableDetails: true
      accountId:
        fn::invoke:
          Function: alicloud:ros:getStackInstances
          Arguments:
            stackGroupName: example_value
            stackInstanceAccountId: example_value
            enableDetails: true
    outputs:
      rosStackInstanceId1: ${ids.instances[0].id}
      rosStackInstanceId2: ${status.instances[0].id}
      rosStackInstanceId3: ${regionId.instances[0].id}
      rosStackInstanceId4: ${accountId.instances[0].id}
    

    Using getStackInstances

    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 getStackInstances(args: GetStackInstancesArgs, opts?: InvokeOptions): Promise<GetStackInstancesResult>
    function getStackInstancesOutput(args: GetStackInstancesOutputArgs, opts?: InvokeOptions): Output<GetStackInstancesResult>
    def get_stack_instances(enable_details: Optional[bool] = None,
                            ids: Optional[Sequence[str]] = None,
                            output_file: Optional[str] = None,
                            stack_group_name: Optional[str] = None,
                            stack_instance_account_id: Optional[str] = None,
                            stack_instance_region_id: Optional[str] = None,
                            status: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetStackInstancesResult
    def get_stack_instances_output(enable_details: Optional[pulumi.Input[bool]] = None,
                            ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                            output_file: Optional[pulumi.Input[str]] = None,
                            stack_group_name: Optional[pulumi.Input[str]] = None,
                            stack_instance_account_id: Optional[pulumi.Input[str]] = None,
                            stack_instance_region_id: Optional[pulumi.Input[str]] = None,
                            status: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetStackInstancesResult]
    func GetStackInstances(ctx *Context, args *GetStackInstancesArgs, opts ...InvokeOption) (*GetStackInstancesResult, error)
    func GetStackInstancesOutput(ctx *Context, args *GetStackInstancesOutputArgs, opts ...InvokeOption) GetStackInstancesResultOutput

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

    public static class GetStackInstances 
    {
        public static Task<GetStackInstancesResult> InvokeAsync(GetStackInstancesArgs args, InvokeOptions? opts = null)
        public static Output<GetStackInstancesResult> Invoke(GetStackInstancesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetStackInstancesResult> getStackInstances(GetStackInstancesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:ros/getStackInstances:getStackInstances
      arguments:
        # arguments dictionary

    The following arguments are supported:

    StackGroupName string
    The name of the stack group.
    EnableDetails bool
    Default to false. Set it to true can output more details about resource attributes.
    Ids List<string>
    A list of Stack Instance IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    StackInstanceAccountId string
    The account to which the stack instance belongs.
    StackInstanceRegionId string
    The region of the stack instance.
    Status string
    The status of the stack instance. Valid values: CURRENT or OUTDATED.
    StackGroupName string
    The name of the stack group.
    EnableDetails bool
    Default to false. Set it to true can output more details about resource attributes.
    Ids []string
    A list of Stack Instance IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    StackInstanceAccountId string
    The account to which the stack instance belongs.
    StackInstanceRegionId string
    The region of the stack instance.
    Status string
    The status of the stack instance. Valid values: CURRENT or OUTDATED.
    stackGroupName String
    The name of the stack group.
    enableDetails Boolean
    Default to false. Set it to true can output more details about resource attributes.
    ids List<String>
    A list of Stack Instance IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    stackInstanceAccountId String
    The account to which the stack instance belongs.
    stackInstanceRegionId String
    The region of the stack instance.
    status String
    The status of the stack instance. Valid values: CURRENT or OUTDATED.
    stackGroupName string
    The name of the stack group.
    enableDetails boolean
    Default to false. Set it to true can output more details about resource attributes.
    ids string[]
    A list of Stack Instance IDs.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    stackInstanceAccountId string
    The account to which the stack instance belongs.
    stackInstanceRegionId string
    The region of the stack instance.
    status string
    The status of the stack instance. Valid values: CURRENT or OUTDATED.
    stack_group_name str
    The name of the stack group.
    enable_details bool
    Default to false. Set it to true can output more details about resource attributes.
    ids Sequence[str]
    A list of Stack Instance IDs.
    output_file str
    File name where to save data source results (after running pulumi preview).
    stack_instance_account_id str
    The account to which the stack instance belongs.
    stack_instance_region_id str
    The region of the stack instance.
    status str
    The status of the stack instance. Valid values: CURRENT or OUTDATED.
    stackGroupName String
    The name of the stack group.
    enableDetails Boolean
    Default to false. Set it to true can output more details about resource attributes.
    ids List<String>
    A list of Stack Instance IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    stackInstanceAccountId String
    The account to which the stack instance belongs.
    stackInstanceRegionId String
    The region of the stack instance.
    status String
    The status of the stack instance. Valid values: CURRENT or OUTDATED.

    getStackInstances Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Instances List<Pulumi.AliCloud.Ros.Outputs.GetStackInstancesInstance>
    StackGroupName string
    EnableDetails bool
    OutputFile string
    StackInstanceAccountId string
    StackInstanceRegionId string
    Status string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Instances []GetStackInstancesInstance
    StackGroupName string
    EnableDetails bool
    OutputFile string
    StackInstanceAccountId string
    StackInstanceRegionId string
    Status string
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    instances List<GetStackInstancesInstance>
    stackGroupName String
    enableDetails Boolean
    outputFile String
    stackInstanceAccountId String
    stackInstanceRegionId String
    status String
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    instances GetStackInstancesInstance[]
    stackGroupName string
    enableDetails boolean
    outputFile string
    stackInstanceAccountId string
    stackInstanceRegionId string
    status string
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    instances Sequence[GetStackInstancesInstance]
    stack_group_name str
    enable_details bool
    output_file str
    stack_instance_account_id str
    stack_instance_region_id str
    status str
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    instances List<Property Map>
    stackGroupName String
    enableDetails Boolean
    outputFile String
    stackInstanceAccountId String
    stackInstanceRegionId String
    status String

    Supporting Types

    GetStackInstancesInstance

    Id string
    The ID of the Stack Instance. The value formats as <stack_group_name>:<stack_instance_account_id>:<stack_instance_region_id>.
    ParameterOverrides List<Pulumi.AliCloud.Ros.Inputs.GetStackInstancesInstanceParameterOverride>
    ParameterOverrides.
    StackGroupId string
    The ID of the stack group.
    StackGroupName string
    The name of the stack group.
    StackId string
    The ID of the stack corresponding to the stack instance.
    StackInstanceAccountId string
    The account to which the stack instance belongs.
    StackInstanceRegionId string
    The region of the stack instance.
    Status string
    The status of the stack instance. Valid values: CURRENT or OUTDATED.
    StatusReason string
    The reason why the stack is in its current state.
    Id string
    The ID of the Stack Instance. The value formats as <stack_group_name>:<stack_instance_account_id>:<stack_instance_region_id>.
    ParameterOverrides []GetStackInstancesInstanceParameterOverride
    ParameterOverrides.
    StackGroupId string
    The ID of the stack group.
    StackGroupName string
    The name of the stack group.
    StackId string
    The ID of the stack corresponding to the stack instance.
    StackInstanceAccountId string
    The account to which the stack instance belongs.
    StackInstanceRegionId string
    The region of the stack instance.
    Status string
    The status of the stack instance. Valid values: CURRENT or OUTDATED.
    StatusReason string
    The reason why the stack is in its current state.
    id String
    The ID of the Stack Instance. The value formats as <stack_group_name>:<stack_instance_account_id>:<stack_instance_region_id>.
    parameterOverrides List<GetStackInstancesInstanceParameterOverride>
    ParameterOverrides.
    stackGroupId String
    The ID of the stack group.
    stackGroupName String
    The name of the stack group.
    stackId String
    The ID of the stack corresponding to the stack instance.
    stackInstanceAccountId String
    The account to which the stack instance belongs.
    stackInstanceRegionId String
    The region of the stack instance.
    status String
    The status of the stack instance. Valid values: CURRENT or OUTDATED.
    statusReason String
    The reason why the stack is in its current state.
    id string
    The ID of the Stack Instance. The value formats as <stack_group_name>:<stack_instance_account_id>:<stack_instance_region_id>.
    parameterOverrides GetStackInstancesInstanceParameterOverride[]
    ParameterOverrides.
    stackGroupId string
    The ID of the stack group.
    stackGroupName string
    The name of the stack group.
    stackId string
    The ID of the stack corresponding to the stack instance.
    stackInstanceAccountId string
    The account to which the stack instance belongs.
    stackInstanceRegionId string
    The region of the stack instance.
    status string
    The status of the stack instance. Valid values: CURRENT or OUTDATED.
    statusReason string
    The reason why the stack is in its current state.
    id str
    The ID of the Stack Instance. The value formats as <stack_group_name>:<stack_instance_account_id>:<stack_instance_region_id>.
    parameter_overrides Sequence[GetStackInstancesInstanceParameterOverride]
    ParameterOverrides.
    stack_group_id str
    The ID of the stack group.
    stack_group_name str
    The name of the stack group.
    stack_id str
    The ID of the stack corresponding to the stack instance.
    stack_instance_account_id str
    The account to which the stack instance belongs.
    stack_instance_region_id str
    The region of the stack instance.
    status str
    The status of the stack instance. Valid values: CURRENT or OUTDATED.
    status_reason str
    The reason why the stack is in its current state.
    id String
    The ID of the Stack Instance. The value formats as <stack_group_name>:<stack_instance_account_id>:<stack_instance_region_id>.
    parameterOverrides List<Property Map>
    ParameterOverrides.
    stackGroupId String
    The ID of the stack group.
    stackGroupName String
    The name of the stack group.
    stackId String
    The ID of the stack corresponding to the stack instance.
    stackInstanceAccountId String
    The account to which the stack instance belongs.
    stackInstanceRegionId String
    The region of the stack instance.
    status String
    The status of the stack instance. Valid values: CURRENT or OUTDATED.
    statusReason String
    The reason why the stack is in its current state.

    GetStackInstancesInstanceParameterOverride

    ParameterKey string
    The key of override parameter.
    ParameterValue string
    The value of override parameter.
    ParameterKey string
    The key of override parameter.
    ParameterValue string
    The value of override parameter.
    parameterKey String
    The key of override parameter.
    parameterValue String
    The value of override parameter.
    parameterKey string
    The key of override parameter.
    parameterValue string
    The value of override parameter.
    parameter_key str
    The key of override parameter.
    parameter_value str
    The value of override parameter.
    parameterKey String
    The key of override parameter.
    parameterValue String
    The value of override parameter.

    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.52.1 published on Thursday, Apr 4, 2024 by Pulumi