1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. ecs
  5. getEcsStorageCapacityUnits
Alibaba Cloud v3.54.0 published on Wednesday, Apr 24, 2024 by Pulumi

alicloud.ecs.getEcsStorageCapacityUnits

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.54.0 published on Wednesday, Apr 24, 2024 by Pulumi

    This data source provides the Ecs Storage Capacity Units of the current Alibaba Cloud user.

    NOTE: Available in v1.155.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ids = alicloud.ecs.getEcsStorageCapacityUnits({});
    export const ecsStorageCapacityUnitId1 = ids.then(ids => ids.units?.[0]?.id);
    const nameRegex = alicloud.ecs.getEcsStorageCapacityUnits({
        nameRegex: "^my-StorageCapacityUnit",
    });
    export const ecsStorageCapacityUnitId2 = nameRegex.then(nameRegex => nameRegex.units?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.ecs.get_ecs_storage_capacity_units()
    pulumi.export("ecsStorageCapacityUnitId1", ids.units[0].id)
    name_regex = alicloud.ecs.get_ecs_storage_capacity_units(name_regex="^my-StorageCapacityUnit")
    pulumi.export("ecsStorageCapacityUnitId2", name_regex.units[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.GetEcsStorageCapacityUnits(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("ecsStorageCapacityUnitId1", ids.Units[0].Id)
    		nameRegex, err := ecs.GetEcsStorageCapacityUnits(ctx, &ecs.GetEcsStorageCapacityUnitsArgs{
    			NameRegex: pulumi.StringRef("^my-StorageCapacityUnit"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("ecsStorageCapacityUnitId2", nameRegex.Units[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.GetEcsStorageCapacityUnits.Invoke();
    
        var nameRegex = AliCloud.Ecs.GetEcsStorageCapacityUnits.Invoke(new()
        {
            NameRegex = "^my-StorageCapacityUnit",
        });
    
        return new Dictionary<string, object?>
        {
            ["ecsStorageCapacityUnitId1"] = ids.Apply(getEcsStorageCapacityUnitsResult => getEcsStorageCapacityUnitsResult.Units[0]?.Id),
            ["ecsStorageCapacityUnitId2"] = nameRegex.Apply(getEcsStorageCapacityUnitsResult => getEcsStorageCapacityUnitsResult.Units[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.GetEcsStorageCapacityUnitsArgs;
    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.getEcsStorageCapacityUnits();
    
            ctx.export("ecsStorageCapacityUnitId1", ids.applyValue(getEcsStorageCapacityUnitsResult -> getEcsStorageCapacityUnitsResult.units()[0].id()));
            final var nameRegex = EcsFunctions.getEcsStorageCapacityUnits(GetEcsStorageCapacityUnitsArgs.builder()
                .nameRegex("^my-StorageCapacityUnit")
                .build());
    
            ctx.export("ecsStorageCapacityUnitId2", nameRegex.applyValue(getEcsStorageCapacityUnitsResult -> getEcsStorageCapacityUnitsResult.units()[0].id()));
        }
    }
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:ecs:getEcsStorageCapacityUnits
          Arguments: {}
      nameRegex:
        fn::invoke:
          Function: alicloud:ecs:getEcsStorageCapacityUnits
          Arguments:
            nameRegex: ^my-StorageCapacityUnit
    outputs:
      ecsStorageCapacityUnitId1: ${ids.units[0].id}
      ecsStorageCapacityUnitId2: ${nameRegex.units[0].id}
    

    Using getEcsStorageCapacityUnits

    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 getEcsStorageCapacityUnits(args: GetEcsStorageCapacityUnitsArgs, opts?: InvokeOptions): Promise<GetEcsStorageCapacityUnitsResult>
    function getEcsStorageCapacityUnitsOutput(args: GetEcsStorageCapacityUnitsOutputArgs, opts?: InvokeOptions): Output<GetEcsStorageCapacityUnitsResult>
    def get_ecs_storage_capacity_units(ids: Optional[Sequence[str]] = None,
                                       name_regex: Optional[str] = None,
                                       output_file: Optional[str] = None,
                                       status: Optional[str] = None,
                                       opts: Optional[InvokeOptions] = None) -> GetEcsStorageCapacityUnitsResult
    def get_ecs_storage_capacity_units_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                       name_regex: Optional[pulumi.Input[str]] = None,
                                       output_file: Optional[pulumi.Input[str]] = None,
                                       status: Optional[pulumi.Input[str]] = None,
                                       opts: Optional[InvokeOptions] = None) -> Output[GetEcsStorageCapacityUnitsResult]
    func GetEcsStorageCapacityUnits(ctx *Context, args *GetEcsStorageCapacityUnitsArgs, opts ...InvokeOption) (*GetEcsStorageCapacityUnitsResult, error)
    func GetEcsStorageCapacityUnitsOutput(ctx *Context, args *GetEcsStorageCapacityUnitsOutputArgs, opts ...InvokeOption) GetEcsStorageCapacityUnitsResultOutput

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

    public static class GetEcsStorageCapacityUnits 
    {
        public static Task<GetEcsStorageCapacityUnitsResult> InvokeAsync(GetEcsStorageCapacityUnitsArgs args, InvokeOptions? opts = null)
        public static Output<GetEcsStorageCapacityUnitsResult> Invoke(GetEcsStorageCapacityUnitsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetEcsStorageCapacityUnitsResult> getEcsStorageCapacityUnits(GetEcsStorageCapacityUnitsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:ecs/getEcsStorageCapacityUnits:getEcsStorageCapacityUnits
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Ids List<string>
    A list of Storage Capacity Unit IDs.
    NameRegex string
    A regex string to filter results by Storage Capacity Unit name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Status string
    The status of Storage Capacity Unit.
    Ids []string
    A list of Storage Capacity Unit IDs.
    NameRegex string
    A regex string to filter results by Storage Capacity Unit name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Status string
    The status of Storage Capacity Unit.
    ids List<String>
    A list of Storage Capacity Unit IDs.
    nameRegex String
    A regex string to filter results by Storage Capacity Unit name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    status String
    The status of Storage Capacity Unit.
    ids string[]
    A list of Storage Capacity Unit IDs.
    nameRegex string
    A regex string to filter results by Storage Capacity Unit name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    status string
    The status of Storage Capacity Unit.
    ids Sequence[str]
    A list of Storage Capacity Unit IDs.
    name_regex str
    A regex string to filter results by Storage Capacity Unit name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    status str
    The status of Storage Capacity Unit.
    ids List<String>
    A list of Storage Capacity Unit IDs.
    nameRegex String
    A regex string to filter results by Storage Capacity Unit name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    status String
    The status of Storage Capacity Unit.

    getEcsStorageCapacityUnits Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    Units List<Pulumi.AliCloud.Ecs.Outputs.GetEcsStorageCapacityUnitsUnit>
    NameRegex string
    OutputFile string
    Status string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    Units []GetEcsStorageCapacityUnitsUnit
    NameRegex string
    OutputFile string
    Status string
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    units List<GetEcsStorageCapacityUnitsUnit>
    nameRegex String
    outputFile String
    status String
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    units GetEcsStorageCapacityUnitsUnit[]
    nameRegex string
    outputFile string
    status string
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    units Sequence[GetEcsStorageCapacityUnitsUnit]
    name_regex str
    output_file str
    status str
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    units List<Property Map>
    nameRegex String
    outputFile String
    status String

    Supporting Types

    GetEcsStorageCapacityUnitsUnit

    AllocationStatus string
    When the AllocationType value is Shared, this parameter indicates the allocation status of Storage Capacity Unit. Valid values: allocated, Ignored.
    Capacity int
    The capacity of the Storage Capacity Unit.
    CreateTime string
    The time when the Storage Capacity Unit was created.
    Description string
    The description of the Storage Capacity Unit.
    ExpiredTime string
    The time when the Storage Capacity Unit expires.
    Id string
    The ID of the Storage Capacity Unit.
    StartTime string
    The effective time of the Storage Capacity Unit.
    Status string
    The status of Storage Capacity Unit.
    StorageCapacityUnitId string
    The ID of Storage Capacity Unit.
    StorageCapacityUnitName string
    The name of the Storage Capacity Unit.
    AllocationStatus string
    When the AllocationType value is Shared, this parameter indicates the allocation status of Storage Capacity Unit. Valid values: allocated, Ignored.
    Capacity int
    The capacity of the Storage Capacity Unit.
    CreateTime string
    The time when the Storage Capacity Unit was created.
    Description string
    The description of the Storage Capacity Unit.
    ExpiredTime string
    The time when the Storage Capacity Unit expires.
    Id string
    The ID of the Storage Capacity Unit.
    StartTime string
    The effective time of the Storage Capacity Unit.
    Status string
    The status of Storage Capacity Unit.
    StorageCapacityUnitId string
    The ID of Storage Capacity Unit.
    StorageCapacityUnitName string
    The name of the Storage Capacity Unit.
    allocationStatus String
    When the AllocationType value is Shared, this parameter indicates the allocation status of Storage Capacity Unit. Valid values: allocated, Ignored.
    capacity Integer
    The capacity of the Storage Capacity Unit.
    createTime String
    The time when the Storage Capacity Unit was created.
    description String
    The description of the Storage Capacity Unit.
    expiredTime String
    The time when the Storage Capacity Unit expires.
    id String
    The ID of the Storage Capacity Unit.
    startTime String
    The effective time of the Storage Capacity Unit.
    status String
    The status of Storage Capacity Unit.
    storageCapacityUnitId String
    The ID of Storage Capacity Unit.
    storageCapacityUnitName String
    The name of the Storage Capacity Unit.
    allocationStatus string
    When the AllocationType value is Shared, this parameter indicates the allocation status of Storage Capacity Unit. Valid values: allocated, Ignored.
    capacity number
    The capacity of the Storage Capacity Unit.
    createTime string
    The time when the Storage Capacity Unit was created.
    description string
    The description of the Storage Capacity Unit.
    expiredTime string
    The time when the Storage Capacity Unit expires.
    id string
    The ID of the Storage Capacity Unit.
    startTime string
    The effective time of the Storage Capacity Unit.
    status string
    The status of Storage Capacity Unit.
    storageCapacityUnitId string
    The ID of Storage Capacity Unit.
    storageCapacityUnitName string
    The name of the Storage Capacity Unit.
    allocation_status str
    When the AllocationType value is Shared, this parameter indicates the allocation status of Storage Capacity Unit. Valid values: allocated, Ignored.
    capacity int
    The capacity of the Storage Capacity Unit.
    create_time str
    The time when the Storage Capacity Unit was created.
    description str
    The description of the Storage Capacity Unit.
    expired_time str
    The time when the Storage Capacity Unit expires.
    id str
    The ID of the Storage Capacity Unit.
    start_time str
    The effective time of the Storage Capacity Unit.
    status str
    The status of Storage Capacity Unit.
    storage_capacity_unit_id str
    The ID of Storage Capacity Unit.
    storage_capacity_unit_name str
    The name of the Storage Capacity Unit.
    allocationStatus String
    When the AllocationType value is Shared, this parameter indicates the allocation status of Storage Capacity Unit. Valid values: allocated, Ignored.
    capacity Number
    The capacity of the Storage Capacity Unit.
    createTime String
    The time when the Storage Capacity Unit was created.
    description String
    The description of the Storage Capacity Unit.
    expiredTime String
    The time when the Storage Capacity Unit expires.
    id String
    The ID of the Storage Capacity Unit.
    startTime String
    The effective time of the Storage Capacity Unit.
    status String
    The status of Storage Capacity Unit.
    storageCapacityUnitId String
    The ID of Storage Capacity Unit.
    storageCapacityUnitName String
    The name of the Storage Capacity Unit.

    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.54.0 published on Wednesday, Apr 24, 2024 by Pulumi