Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi
alicloud.ecs.getEcsStorageCapacityUnits
Explore with Pulumi AI
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.
- Name
Regex string - A regex string to filter results by Storage Capacity Unit name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Status string
- The status of Storage Capacity Unit. Valid values:
Active
,Creating
,Expired
,Pending
.
- Ids []string
- A list of Storage Capacity Unit IDs.
- Name
Regex string - A regex string to filter results by Storage Capacity Unit name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Status string
- The status of Storage Capacity Unit. Valid values:
Active
,Creating
,Expired
,Pending
.
- ids List<String>
- A list of Storage Capacity Unit IDs.
- name
Regex String - A regex string to filter results by Storage Capacity Unit name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - status String
- The status of Storage Capacity Unit. Valid values:
Active
,Creating
,Expired
,Pending
.
- ids string[]
- A list of Storage Capacity Unit IDs.
- name
Regex string - A regex string to filter results by Storage Capacity Unit name.
- output
File string - File name where to save data source results (after running
pulumi preview
). - status string
- The status of Storage Capacity Unit. Valid values:
Active
,Creating
,Expired
,Pending
.
- 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. Valid values:
Active
,Creating
,Expired
,Pending
.
- ids List<String>
- A list of Storage Capacity Unit IDs.
- name
Regex String - A regex string to filter results by Storage Capacity Unit name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - status String
- The status of Storage Capacity Unit. Valid values:
Active
,Creating
,Expired
,Pending
.
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.
Ali Cloud. Ecs. Outputs. Get Ecs Storage Capacity Units Unit> - Name
Regex string - Output
File string - Status string
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Names []string
- Units
[]Get
Ecs Storage Capacity Units Unit - Name
Regex string - Output
File string - Status string
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- units
List<Get
Ecs Storage Capacity Units Unit> - name
Regex String - output
File String - status String
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- names string[]
- units
Get
Ecs Storage Capacity Units Unit[] - name
Regex string - output
File string - status string
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- names Sequence[str]
- units
Sequence[Get
Ecs Storage Capacity Units Unit] - 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>
- name
Regex String - output
File String - status String
Supporting Types
GetEcsStorageCapacityUnitsUnit
- Allocation
Status 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.
- Create
Time string - The time when the Storage Capacity Unit was created.
- Description string
- The description of the Storage Capacity Unit.
- Expired
Time string - The time when the Storage Capacity Unit expires.
- Id string
- The ID of the Storage Capacity Unit.
- Start
Time string - The effective time of the Storage Capacity Unit.
- Status string
- The status of Storage Capacity Unit.
- Storage
Capacity stringUnit Id - The ID of Storage Capacity Unit.
- Storage
Capacity stringUnit Name - The name of the Storage Capacity Unit.
- Allocation
Status 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.
- Create
Time string - The time when the Storage Capacity Unit was created.
- Description string
- The description of the Storage Capacity Unit.
- Expired
Time string - The time when the Storage Capacity Unit expires.
- Id string
- The ID of the Storage Capacity Unit.
- Start
Time string - The effective time of the Storage Capacity Unit.
- Status string
- The status of Storage Capacity Unit.
- Storage
Capacity stringUnit Id - The ID of Storage Capacity Unit.
- Storage
Capacity stringUnit Name - The name of the Storage Capacity Unit.
- allocation
Status 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.
- create
Time String - The time when the Storage Capacity Unit was created.
- description String
- The description of the Storage Capacity Unit.
- expired
Time String - The time when the Storage Capacity Unit expires.
- id String
- The ID of the Storage Capacity Unit.
- start
Time String - The effective time of the Storage Capacity Unit.
- status String
- The status of Storage Capacity Unit.
- storage
Capacity StringUnit Id - The ID of Storage Capacity Unit.
- storage
Capacity StringUnit Name - The name of the Storage Capacity Unit.
- allocation
Status 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.
- create
Time string - The time when the Storage Capacity Unit was created.
- description string
- The description of the Storage Capacity Unit.
- expired
Time string - The time when the Storage Capacity Unit expires.
- id string
- The ID of the Storage Capacity Unit.
- start
Time string - The effective time of the Storage Capacity Unit.
- status string
- The status of Storage Capacity Unit.
- storage
Capacity stringUnit Id - The ID of Storage Capacity Unit.
- storage
Capacity stringUnit Name - 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_ strunit_ id - The ID of Storage Capacity Unit.
- storage_
capacity_ strunit_ name - The name of the Storage Capacity Unit.
- allocation
Status 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.
- create
Time String - The time when the Storage Capacity Unit was created.
- description String
- The description of the Storage Capacity Unit.
- expired
Time String - The time when the Storage Capacity Unit expires.
- id String
- The ID of the Storage Capacity Unit.
- start
Time String - The effective time of the Storage Capacity Unit.
- status String
- The status of Storage Capacity Unit.
- storage
Capacity StringUnit Id - The ID of Storage Capacity Unit.
- storage
Capacity StringUnit Name - 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.