1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. ecs
  5. getCapacityReservations
Alibaba Cloud v3.38.0 published on Friday, Jun 2, 2023 by Pulumi

alicloud.ecs.getCapacityReservations

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.38.0 published on Friday, Jun 2, 2023 by Pulumi

    This data source provides Ecs Capacity Reservation available to the user.

    NOTE: Available in 1.195.0+

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = AliCloud.Ecs.GetCapacityReservations.Invoke(new()
        {
            Ids = new[]
            {
                alicloud_ecs_capacity_reservation.Default.Id,
            },
            NameRegex = alicloud_ecs_capacity_reservation.Default.Name,
            InstanceType = "ecs.c6.large",
            Platform = "linux",
        });
    
        return new Dictionary<string, object?>
        {
            ["alicloudEcsCapacityReservationExampleId"] = @default.Apply(@default => @default.Apply(getCapacityReservationsResult => getCapacityReservationsResult.Reservations[0]?.Id)),
        };
    });
    

    Coming soon!

    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.GetCapacityReservationsArgs;
    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 default = EcsFunctions.getCapacityReservations(GetCapacityReservationsArgs.builder()
                .ids(alicloud_ecs_capacity_reservation.default().id())
                .nameRegex(alicloud_ecs_capacity_reservation.default().name())
                .instanceType("ecs.c6.large")
                .platform("linux")
                .build());
    
            ctx.export("alicloudEcsCapacityReservationExampleId", default_.reservations()[0].id());
        }
    }
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.ecs.get_capacity_reservations(ids=[alicloud_ecs_capacity_reservation["default"]["id"]],
        name_regex=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        instance_type="ecs.c6.large",
        platform="linux")
    pulumi.export("alicloudEcsCapacityReservationExampleId", default.reservations[0].id)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const default = alicloud.ecs.getCapacityReservations({
        ids: [alicloud_ecs_capacity_reservation["default"].id],
        nameRegex: alicloud_ecs_capacity_reservation["default"].name,
        instanceType: "ecs.c6.large",
        platform: "linux",
    });
    export const alicloudEcsCapacityReservationExampleId = _default.then(_default => _default.reservations?.[0]?.id);
    
    variables:
      default:
        fn::invoke:
          Function: alicloud:ecs:getCapacityReservations
          Arguments:
            ids:
              - ${alicloud_ecs_capacity_reservation.default.id}
            nameRegex: ${alicloud_ecs_capacity_reservation.default.name}
            instanceType: ecs.c6.large
            platform: linux
    outputs:
      alicloudEcsCapacityReservationExampleId: ${default.reservations[0].id}
    

    Using getCapacityReservations

    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 getCapacityReservations(args: GetCapacityReservationsArgs, opts?: InvokeOptions): Promise<GetCapacityReservationsResult>
    function getCapacityReservationsOutput(args: GetCapacityReservationsOutputArgs, opts?: InvokeOptions): Output<GetCapacityReservationsResult>
    def get_capacity_reservations(capacity_reservation_ids: Optional[Sequence[str]] = None,
                                  ids: Optional[Sequence[str]] = None,
                                  instance_type: Optional[str] = None,
                                  name_regex: Optional[str] = None,
                                  output_file: Optional[str] = None,
                                  payment_type: Optional[str] = None,
                                  platform: Optional[str] = None,
                                  resource_group_id: Optional[str] = None,
                                  status: Optional[str] = None,
                                  tags: Optional[Mapping[str, Any]] = None,
                                  opts: Optional[InvokeOptions] = None) -> GetCapacityReservationsResult
    def get_capacity_reservations_output(capacity_reservation_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                  ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                  instance_type: Optional[pulumi.Input[str]] = None,
                                  name_regex: Optional[pulumi.Input[str]] = None,
                                  output_file: Optional[pulumi.Input[str]] = None,
                                  payment_type: Optional[pulumi.Input[str]] = None,
                                  platform: Optional[pulumi.Input[str]] = None,
                                  resource_group_id: Optional[pulumi.Input[str]] = None,
                                  status: Optional[pulumi.Input[str]] = None,
                                  tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                                  opts: Optional[InvokeOptions] = None) -> Output[GetCapacityReservationsResult]
    func GetCapacityReservations(ctx *Context, args *GetCapacityReservationsArgs, opts ...InvokeOption) (*GetCapacityReservationsResult, error)
    func GetCapacityReservationsOutput(ctx *Context, args *GetCapacityReservationsOutputArgs, opts ...InvokeOption) GetCapacityReservationsResultOutput

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

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

    The following arguments are supported:

    CapacityReservationIds List<string>
    Ids List<string>

    A list of Capacity Reservation IDs.

    InstanceType string

    Instance type. Currently, you can only set the capacity reservation service for one instance type.

    NameRegex string

    A regex string to filter results by Group Metric Rule name.

    OutputFile string

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

    PaymentType string

    The payment type of the resource. value range PostPaid, PrePaid.

    Platform string

    platform of the capacity reservation , value range windows, linux, all.

    ResourceGroupId string

    The resource group id.

    Status string

    The status of the capacity reservation. value range All, Pending, Preparing, Prepared, Active, Released.

    Tags Dictionary<string, object>

    The tag of the resource.

    CapacityReservationIds []string
    Ids []string

    A list of Capacity Reservation IDs.

    InstanceType string

    Instance type. Currently, you can only set the capacity reservation service for one instance type.

    NameRegex string

    A regex string to filter results by Group Metric Rule name.

    OutputFile string

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

    PaymentType string

    The payment type of the resource. value range PostPaid, PrePaid.

    Platform string

    platform of the capacity reservation , value range windows, linux, all.

    ResourceGroupId string

    The resource group id.

    Status string

    The status of the capacity reservation. value range All, Pending, Preparing, Prepared, Active, Released.

    Tags map[string]interface{}

    The tag of the resource.

    capacityReservationIds List<String>
    ids List<String>

    A list of Capacity Reservation IDs.

    instanceType String

    Instance type. Currently, you can only set the capacity reservation service for one instance type.

    nameRegex String

    A regex string to filter results by Group Metric Rule name.

    outputFile String

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

    paymentType String

    The payment type of the resource. value range PostPaid, PrePaid.

    platform String

    platform of the capacity reservation , value range windows, linux, all.

    resourceGroupId String

    The resource group id.

    status String

    The status of the capacity reservation. value range All, Pending, Preparing, Prepared, Active, Released.

    tags Map<String,Object>

    The tag of the resource.

    capacityReservationIds string[]
    ids string[]

    A list of Capacity Reservation IDs.

    instanceType string

    Instance type. Currently, you can only set the capacity reservation service for one instance type.

    nameRegex string

    A regex string to filter results by Group Metric Rule name.

    outputFile string

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

    paymentType string

    The payment type of the resource. value range PostPaid, PrePaid.

    platform string

    platform of the capacity reservation , value range windows, linux, all.

    resourceGroupId string

    The resource group id.

    status string

    The status of the capacity reservation. value range All, Pending, Preparing, Prepared, Active, Released.

    tags {[key: string]: any}

    The tag of the resource.

    capacity_reservation_ids Sequence[str]
    ids Sequence[str]

    A list of Capacity Reservation IDs.

    instance_type str

    Instance type. Currently, you can only set the capacity reservation service for one instance type.

    name_regex str

    A regex string to filter results by Group Metric Rule name.

    output_file str

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

    payment_type str

    The payment type of the resource. value range PostPaid, PrePaid.

    platform str

    platform of the capacity reservation , value range windows, linux, all.

    resource_group_id str

    The resource group id.

    status str

    The status of the capacity reservation. value range All, Pending, Preparing, Prepared, Active, Released.

    tags Mapping[str, Any]

    The tag of the resource.

    capacityReservationIds List<String>
    ids List<String>

    A list of Capacity Reservation IDs.

    instanceType String

    Instance type. Currently, you can only set the capacity reservation service for one instance type.

    nameRegex String

    A regex string to filter results by Group Metric Rule name.

    outputFile String

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

    paymentType String

    The payment type of the resource. value range PostPaid, PrePaid.

    platform String

    platform of the capacity reservation , value range windows, linux, all.

    resourceGroupId String

    The resource group id.

    status String

    The status of the capacity reservation. value range All, Pending, Preparing, Prepared, Active, Released.

    tags Map<Any>

    The tag of the resource.

    getCapacityReservations Result

    The following output properties are available:

    Id string

    The provider-assigned unique ID for this managed resource.

    Ids List<string>

    A list of Capacity Reservation IDs.

    Names List<string>

    A list of name of Capacity Reservations.

    Reservations List<Pulumi.AliCloud.Ecs.Outputs.GetCapacityReservationsReservation>

    A list of Capacity Reservation Entries. Each element contains the following attributes:

    CapacityReservationIds List<string>
    InstanceType string

    Instance type. Currently, you can only set the capacity reservation service for one instance type.

    NameRegex string
    OutputFile string
    PaymentType string

    The payment type of the resource

    Platform string

    platform of the capacity reservation.

    ResourceGroupId string

    The resource group id

    Status string

    The status of the capacity reservation.

    Tags Dictionary<string, object>

    A mapping of tags to assign to the Capacity Reservation.

    Id string

    The provider-assigned unique ID for this managed resource.

    Ids []string

    A list of Capacity Reservation IDs.

    Names []string

    A list of name of Capacity Reservations.

    Reservations []GetCapacityReservationsReservation

    A list of Capacity Reservation Entries. Each element contains the following attributes:

    CapacityReservationIds []string
    InstanceType string

    Instance type. Currently, you can only set the capacity reservation service for one instance type.

    NameRegex string
    OutputFile string
    PaymentType string

    The payment type of the resource

    Platform string

    platform of the capacity reservation.

    ResourceGroupId string

    The resource group id

    Status string

    The status of the capacity reservation.

    Tags map[string]interface{}

    A mapping of tags to assign to the Capacity Reservation.

    id String

    The provider-assigned unique ID for this managed resource.

    ids List<String>

    A list of Capacity Reservation IDs.

    names List<String>

    A list of name of Capacity Reservations.

    reservations List<GetCapacityReservationsReservation>

    A list of Capacity Reservation Entries. Each element contains the following attributes:

    capacityReservationIds List<String>
    instanceType String

    Instance type. Currently, you can only set the capacity reservation service for one instance type.

    nameRegex String
    outputFile String
    paymentType String

    The payment type of the resource

    platform String

    platform of the capacity reservation.

    resourceGroupId String

    The resource group id

    status String

    The status of the capacity reservation.

    tags Map<String,Object>

    A mapping of tags to assign to the Capacity Reservation.

    id string

    The provider-assigned unique ID for this managed resource.

    ids string[]

    A list of Capacity Reservation IDs.

    names string[]

    A list of name of Capacity Reservations.

    reservations GetCapacityReservationsReservation[]

    A list of Capacity Reservation Entries. Each element contains the following attributes:

    capacityReservationIds string[]
    instanceType string

    Instance type. Currently, you can only set the capacity reservation service for one instance type.

    nameRegex string
    outputFile string
    paymentType string

    The payment type of the resource

    platform string

    platform of the capacity reservation.

    resourceGroupId string

    The resource group id

    status string

    The status of the capacity reservation.

    tags {[key: string]: any}

    A mapping of tags to assign to the Capacity Reservation.

    id str

    The provider-assigned unique ID for this managed resource.

    ids Sequence[str]

    A list of Capacity Reservation IDs.

    names Sequence[str]

    A list of name of Capacity Reservations.

    reservations Sequence[GetCapacityReservationsReservation]

    A list of Capacity Reservation Entries. Each element contains the following attributes:

    capacity_reservation_ids Sequence[str]
    instance_type str

    Instance type. Currently, you can only set the capacity reservation service for one instance type.

    name_regex str
    output_file str
    payment_type str

    The payment type of the resource

    platform str

    platform of the capacity reservation.

    resource_group_id str

    The resource group id

    status str

    The status of the capacity reservation.

    tags Mapping[str, Any]

    A mapping of tags to assign to the Capacity Reservation.

    id String

    The provider-assigned unique ID for this managed resource.

    ids List<String>

    A list of Capacity Reservation IDs.

    names List<String>

    A list of name of Capacity Reservations.

    reservations List<Property Map>

    A list of Capacity Reservation Entries. Each element contains the following attributes:

    capacityReservationIds List<String>
    instanceType String

    Instance type. Currently, you can only set the capacity reservation service for one instance type.

    nameRegex String
    outputFile String
    paymentType String

    The payment type of the resource

    platform String

    platform of the capacity reservation.

    resourceGroupId String

    The resource group id

    status String

    The status of the capacity reservation.

    tags Map<Any>

    A mapping of tags to assign to the Capacity Reservation.

    Supporting Types

    GetCapacityReservationsReservation

    CapacityReservationId string

    Capacity Reservation id

    CapacityReservationName string

    Capacity reservation service name.

    Description string

    description of the capacity reservation instance

    EndTime string

    end time of the capacity reservation. the capacity reservation will be released at the end time automatically if set. otherwise it will last until manually released

    EndTimeType string

    Release mode of capacity reservation service. Value range:Limited: release at specified time. The EndTime parameter must be specified at the same time.Unlimited: manual release. No time limit.

    Id string

    The ID of the Capacity Reservation.

    InstanceAmount string

    The total number of instances that need to be reserved within the capacity reservation

    InstanceType string

    Instance type. Currently, you can only set the capacity reservation service for one instance type.

    MatchCriteria string

    The type of private resource pool generated after the capacity reservation service takes effect. Value range:Open: Open mode.Target: dedicated mode.Default value: Open

    PaymentType string

    The payment type of the resource. value range PostPaid, PrePaid.

    Platform string

    platform of the capacity reservation , value range windows, linux, all.

    ResourceGroupId string

    The resource group id.

    StartTime string

    time of the capacity reservation which become active

    StartTimeType string

    The capacity is scheduled to take effect. Possible values:-Now: Effective immediately.-Later: the specified time takes effect.

    Status string

    The status of the capacity reservation. value range All, Pending, Preparing, Prepared, Active, Released.

    TimeSlot string

    This parameter is under test and is not yet open for use.

    ZoneIds List<string>

    The ID of the zone in the region to which the capacity reservation service belongs. Currently, it is only supported to create a capacity reservation service in one zone.

    Tags Dictionary<string, object>

    The tag of the resource.

    CapacityReservationId string

    Capacity Reservation id

    CapacityReservationName string

    Capacity reservation service name.

    Description string

    description of the capacity reservation instance

    EndTime string

    end time of the capacity reservation. the capacity reservation will be released at the end time automatically if set. otherwise it will last until manually released

    EndTimeType string

    Release mode of capacity reservation service. Value range:Limited: release at specified time. The EndTime parameter must be specified at the same time.Unlimited: manual release. No time limit.

    Id string

    The ID of the Capacity Reservation.

    InstanceAmount string

    The total number of instances that need to be reserved within the capacity reservation

    InstanceType string

    Instance type. Currently, you can only set the capacity reservation service for one instance type.

    MatchCriteria string

    The type of private resource pool generated after the capacity reservation service takes effect. Value range:Open: Open mode.Target: dedicated mode.Default value: Open

    PaymentType string

    The payment type of the resource. value range PostPaid, PrePaid.

    Platform string

    platform of the capacity reservation , value range windows, linux, all.

    ResourceGroupId string

    The resource group id.

    StartTime string

    time of the capacity reservation which become active

    StartTimeType string

    The capacity is scheduled to take effect. Possible values:-Now: Effective immediately.-Later: the specified time takes effect.

    Status string

    The status of the capacity reservation. value range All, Pending, Preparing, Prepared, Active, Released.

    TimeSlot string

    This parameter is under test and is not yet open for use.

    ZoneIds []string

    The ID of the zone in the region to which the capacity reservation service belongs. Currently, it is only supported to create a capacity reservation service in one zone.

    Tags map[string]interface{}

    The tag of the resource.

    capacityReservationId String

    Capacity Reservation id

    capacityReservationName String

    Capacity reservation service name.

    description String

    description of the capacity reservation instance

    endTime String

    end time of the capacity reservation. the capacity reservation will be released at the end time automatically if set. otherwise it will last until manually released

    endTimeType String

    Release mode of capacity reservation service. Value range:Limited: release at specified time. The EndTime parameter must be specified at the same time.Unlimited: manual release. No time limit.

    id String

    The ID of the Capacity Reservation.

    instanceAmount String

    The total number of instances that need to be reserved within the capacity reservation

    instanceType String

    Instance type. Currently, you can only set the capacity reservation service for one instance type.

    matchCriteria String

    The type of private resource pool generated after the capacity reservation service takes effect. Value range:Open: Open mode.Target: dedicated mode.Default value: Open

    paymentType String

    The payment type of the resource. value range PostPaid, PrePaid.

    platform String

    platform of the capacity reservation , value range windows, linux, all.

    resourceGroupId String

    The resource group id.

    startTime String

    time of the capacity reservation which become active

    startTimeType String

    The capacity is scheduled to take effect. Possible values:-Now: Effective immediately.-Later: the specified time takes effect.

    status String

    The status of the capacity reservation. value range All, Pending, Preparing, Prepared, Active, Released.

    timeSlot String

    This parameter is under test and is not yet open for use.

    zoneIds List<String>

    The ID of the zone in the region to which the capacity reservation service belongs. Currently, it is only supported to create a capacity reservation service in one zone.

    tags Map<String,Object>

    The tag of the resource.

    capacityReservationId string

    Capacity Reservation id

    capacityReservationName string

    Capacity reservation service name.

    description string

    description of the capacity reservation instance

    endTime string

    end time of the capacity reservation. the capacity reservation will be released at the end time automatically if set. otherwise it will last until manually released

    endTimeType string

    Release mode of capacity reservation service. Value range:Limited: release at specified time. The EndTime parameter must be specified at the same time.Unlimited: manual release. No time limit.

    id string

    The ID of the Capacity Reservation.

    instanceAmount string

    The total number of instances that need to be reserved within the capacity reservation

    instanceType string

    Instance type. Currently, you can only set the capacity reservation service for one instance type.

    matchCriteria string

    The type of private resource pool generated after the capacity reservation service takes effect. Value range:Open: Open mode.Target: dedicated mode.Default value: Open

    paymentType string

    The payment type of the resource. value range PostPaid, PrePaid.

    platform string

    platform of the capacity reservation , value range windows, linux, all.

    resourceGroupId string

    The resource group id.

    startTime string

    time of the capacity reservation which become active

    startTimeType string

    The capacity is scheduled to take effect. Possible values:-Now: Effective immediately.-Later: the specified time takes effect.

    status string

    The status of the capacity reservation. value range All, Pending, Preparing, Prepared, Active, Released.

    timeSlot string

    This parameter is under test and is not yet open for use.

    zoneIds string[]

    The ID of the zone in the region to which the capacity reservation service belongs. Currently, it is only supported to create a capacity reservation service in one zone.

    tags {[key: string]: any}

    The tag of the resource.

    capacity_reservation_id str

    Capacity Reservation id

    capacity_reservation_name str

    Capacity reservation service name.

    description str

    description of the capacity reservation instance

    end_time str

    end time of the capacity reservation. the capacity reservation will be released at the end time automatically if set. otherwise it will last until manually released

    end_time_type str

    Release mode of capacity reservation service. Value range:Limited: release at specified time. The EndTime parameter must be specified at the same time.Unlimited: manual release. No time limit.

    id str

    The ID of the Capacity Reservation.

    instance_amount str

    The total number of instances that need to be reserved within the capacity reservation

    instance_type str

    Instance type. Currently, you can only set the capacity reservation service for one instance type.

    match_criteria str

    The type of private resource pool generated after the capacity reservation service takes effect. Value range:Open: Open mode.Target: dedicated mode.Default value: Open

    payment_type str

    The payment type of the resource. value range PostPaid, PrePaid.

    platform str

    platform of the capacity reservation , value range windows, linux, all.

    resource_group_id str

    The resource group id.

    start_time str

    time of the capacity reservation which become active

    start_time_type str

    The capacity is scheduled to take effect. Possible values:-Now: Effective immediately.-Later: the specified time takes effect.

    status str

    The status of the capacity reservation. value range All, Pending, Preparing, Prepared, Active, Released.

    time_slot str

    This parameter is under test and is not yet open for use.

    zone_ids Sequence[str]

    The ID of the zone in the region to which the capacity reservation service belongs. Currently, it is only supported to create a capacity reservation service in one zone.

    tags Mapping[str, Any]

    The tag of the resource.

    capacityReservationId String

    Capacity Reservation id

    capacityReservationName String

    Capacity reservation service name.

    description String

    description of the capacity reservation instance

    endTime String

    end time of the capacity reservation. the capacity reservation will be released at the end time automatically if set. otherwise it will last until manually released

    endTimeType String

    Release mode of capacity reservation service. Value range:Limited: release at specified time. The EndTime parameter must be specified at the same time.Unlimited: manual release. No time limit.

    id String

    The ID of the Capacity Reservation.

    instanceAmount String

    The total number of instances that need to be reserved within the capacity reservation

    instanceType String

    Instance type. Currently, you can only set the capacity reservation service for one instance type.

    matchCriteria String

    The type of private resource pool generated after the capacity reservation service takes effect. Value range:Open: Open mode.Target: dedicated mode.Default value: Open

    paymentType String

    The payment type of the resource. value range PostPaid, PrePaid.

    platform String

    platform of the capacity reservation , value range windows, linux, all.

    resourceGroupId String

    The resource group id.

    startTime String

    time of the capacity reservation which become active

    startTimeType String

    The capacity is scheduled to take effect. Possible values:-Now: Effective immediately.-Later: the specified time takes effect.

    status String

    The status of the capacity reservation. value range All, Pending, Preparing, Prepared, Active, Released.

    timeSlot String

    This parameter is under test and is not yet open for use.

    zoneIds List<String>

    The ID of the zone in the region to which the capacity reservation service belongs. Currently, it is only supported to create a capacity reservation service in one zone.

    tags Map<Any>

    The tag of the resource.

    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.38.0 published on Friday, Jun 2, 2023 by Pulumi