AWS v6.73.0 published on Wednesday, Mar 19, 2025 by Pulumi
aws.ec2.getCapacityBlockOffering
Explore with Pulumi AI
Information about a single EC2 Capacity Block Offering.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = aws.ec2.getCapacityBlockOffering({
    capacityDurationHours: 24,
    endDateRange: "2024-05-30T15:04:05Z",
    instanceCount: 1,
    instanceType: "p4d.24xlarge",
    startDateRange: "2024-04-28T15:04:05Z",
});
import pulumi
import pulumi_aws as aws
example = aws.ec2.get_capacity_block_offering(capacity_duration_hours=24,
    end_date_range="2024-05-30T15:04:05Z",
    instance_count=1,
    instance_type="p4d.24xlarge",
    start_date_range="2024-04-28T15:04:05Z")
package main
import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ec2.GetCapacityBlockOffering(ctx, &ec2.GetCapacityBlockOfferingArgs{
			CapacityDurationHours: 24,
			EndDateRange:          pulumi.StringRef("2024-05-30T15:04:05Z"),
			InstanceCount:         1,
			InstanceType:          "p4d.24xlarge",
			StartDateRange:        pulumi.StringRef("2024-04-28T15:04:05Z"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() => 
{
    var example = Aws.Ec2.GetCapacityBlockOffering.Invoke(new()
    {
        CapacityDurationHours = 24,
        EndDateRange = "2024-05-30T15:04:05Z",
        InstanceCount = 1,
        InstanceType = "p4d.24xlarge",
        StartDateRange = "2024-04-28T15:04:05Z",
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.Ec2Functions;
import com.pulumi.aws.ec2.inputs.GetCapacityBlockOfferingArgs;
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 example = Ec2Functions.getCapacityBlockOffering(GetCapacityBlockOfferingArgs.builder()
            .capacityDurationHours(24)
            .endDateRange("2024-05-30T15:04:05Z")
            .instanceCount(1)
            .instanceType("p4d.24xlarge")
            .startDateRange("2024-04-28T15:04:05Z")
            .build());
    }
}
variables:
  example:
    fn::invoke:
      function: aws:ec2:getCapacityBlockOffering
      arguments:
        capacityDurationHours: 24
        endDateRange: 2024-05-30T15:04:05Z
        instanceCount: 1
        instanceType: p4d.24xlarge
        startDateRange: 2024-04-28T15:04:05Z
Using getCapacityBlockOffering
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 getCapacityBlockOffering(args: GetCapacityBlockOfferingArgs, opts?: InvokeOptions): Promise<GetCapacityBlockOfferingResult>
function getCapacityBlockOfferingOutput(args: GetCapacityBlockOfferingOutputArgs, opts?: InvokeOptions): Output<GetCapacityBlockOfferingResult>def get_capacity_block_offering(capacity_duration_hours: Optional[int] = None,
                                end_date_range: Optional[str] = None,
                                instance_count: Optional[int] = None,
                                instance_type: Optional[str] = None,
                                start_date_range: Optional[str] = None,
                                opts: Optional[InvokeOptions] = None) -> GetCapacityBlockOfferingResult
def get_capacity_block_offering_output(capacity_duration_hours: Optional[pulumi.Input[int]] = None,
                                end_date_range: Optional[pulumi.Input[str]] = None,
                                instance_count: Optional[pulumi.Input[int]] = None,
                                instance_type: Optional[pulumi.Input[str]] = None,
                                start_date_range: Optional[pulumi.Input[str]] = None,
                                opts: Optional[InvokeOptions] = None) -> Output[GetCapacityBlockOfferingResult]func GetCapacityBlockOffering(ctx *Context, args *GetCapacityBlockOfferingArgs, opts ...InvokeOption) (*GetCapacityBlockOfferingResult, error)
func GetCapacityBlockOfferingOutput(ctx *Context, args *GetCapacityBlockOfferingOutputArgs, opts ...InvokeOption) GetCapacityBlockOfferingResultOutput> Note: This function is named GetCapacityBlockOffering in the Go SDK.
public static class GetCapacityBlockOffering 
{
    public static Task<GetCapacityBlockOfferingResult> InvokeAsync(GetCapacityBlockOfferingArgs args, InvokeOptions? opts = null)
    public static Output<GetCapacityBlockOfferingResult> Invoke(GetCapacityBlockOfferingInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetCapacityBlockOfferingResult> getCapacityBlockOffering(GetCapacityBlockOfferingArgs args, InvokeOptions options)
public static Output<GetCapacityBlockOfferingResult> getCapacityBlockOffering(GetCapacityBlockOfferingArgs args, InvokeOptions options)
fn::invoke:
  function: aws:ec2/getCapacityBlockOffering:getCapacityBlockOffering
  arguments:
    # arguments dictionaryThe following arguments are supported:
- CapacityDuration intHours 
- The amount of time of the Capacity Block reservation in hours.
- InstanceCount int
- The number of instances for which to reserve capacity.
- InstanceType string
- The instance type for which to reserve capacity.
- EndDate stringRange 
- The date and time at which the Capacity Block Reservation expires. When a Capacity Reservation expires, the reserved capacity is released and you can no longer launch instances into it. Valid values: RFC3339 time string (YYYY-MM-DDTHH:MM:SSZ)
- StartDate stringRange 
- The date and time at which the Capacity Block Reservation starts. Valid values: RFC3339 time string (YYYY-MM-DDTHH:MM:SSZ)
- CapacityDuration intHours 
- The amount of time of the Capacity Block reservation in hours.
- InstanceCount int
- The number of instances for which to reserve capacity.
- InstanceType string
- The instance type for which to reserve capacity.
- EndDate stringRange 
- The date and time at which the Capacity Block Reservation expires. When a Capacity Reservation expires, the reserved capacity is released and you can no longer launch instances into it. Valid values: RFC3339 time string (YYYY-MM-DDTHH:MM:SSZ)
- StartDate stringRange 
- The date and time at which the Capacity Block Reservation starts. Valid values: RFC3339 time string (YYYY-MM-DDTHH:MM:SSZ)
- capacityDuration IntegerHours 
- The amount of time of the Capacity Block reservation in hours.
- instanceCount Integer
- The number of instances for which to reserve capacity.
- instanceType String
- The instance type for which to reserve capacity.
- endDate StringRange 
- The date and time at which the Capacity Block Reservation expires. When a Capacity Reservation expires, the reserved capacity is released and you can no longer launch instances into it. Valid values: RFC3339 time string (YYYY-MM-DDTHH:MM:SSZ)
- startDate StringRange 
- The date and time at which the Capacity Block Reservation starts. Valid values: RFC3339 time string (YYYY-MM-DDTHH:MM:SSZ)
- capacityDuration numberHours 
- The amount of time of the Capacity Block reservation in hours.
- instanceCount number
- The number of instances for which to reserve capacity.
- instanceType string
- The instance type for which to reserve capacity.
- endDate stringRange 
- The date and time at which the Capacity Block Reservation expires. When a Capacity Reservation expires, the reserved capacity is released and you can no longer launch instances into it. Valid values: RFC3339 time string (YYYY-MM-DDTHH:MM:SSZ)
- startDate stringRange 
- The date and time at which the Capacity Block Reservation starts. Valid values: RFC3339 time string (YYYY-MM-DDTHH:MM:SSZ)
- capacity_duration_ inthours 
- The amount of time of the Capacity Block reservation in hours.
- instance_count int
- The number of instances for which to reserve capacity.
- instance_type str
- The instance type for which to reserve capacity.
- end_date_ strrange 
- The date and time at which the Capacity Block Reservation expires. When a Capacity Reservation expires, the reserved capacity is released and you can no longer launch instances into it. Valid values: RFC3339 time string (YYYY-MM-DDTHH:MM:SSZ)
- start_date_ strrange 
- The date and time at which the Capacity Block Reservation starts. Valid values: RFC3339 time string (YYYY-MM-DDTHH:MM:SSZ)
- capacityDuration NumberHours 
- The amount of time of the Capacity Block reservation in hours.
- instanceCount Number
- The number of instances for which to reserve capacity.
- instanceType String
- The instance type for which to reserve capacity.
- endDate StringRange 
- The date and time at which the Capacity Block Reservation expires. When a Capacity Reservation expires, the reserved capacity is released and you can no longer launch instances into it. Valid values: RFC3339 time string (YYYY-MM-DDTHH:MM:SSZ)
- startDate StringRange 
- The date and time at which the Capacity Block Reservation starts. Valid values: RFC3339 time string (YYYY-MM-DDTHH:MM:SSZ)
getCapacityBlockOffering Result
The following output properties are available:
- AvailabilityZone string
- The Availability Zone in which to create the Capacity Reservation.
- CapacityBlock stringOffering Id 
- The Capacity Block Reservation ID.
- CapacityDuration intHours 
- CurrencyCode string
- The currency of the payment for the Capacity Block.
- EndDate stringRange 
- Id string
- The provider-assigned unique ID for this managed resource.
- InstanceCount int
- InstanceType string
- StartDate stringRange 
- Tenancy string
- Indicates the tenancy of the Capacity Reservation. Specify either defaultordedicated.
- UpfrontFee string
- The total price to be paid up front.
- AvailabilityZone string
- The Availability Zone in which to create the Capacity Reservation.
- CapacityBlock stringOffering Id 
- The Capacity Block Reservation ID.
- CapacityDuration intHours 
- CurrencyCode string
- The currency of the payment for the Capacity Block.
- EndDate stringRange 
- Id string
- The provider-assigned unique ID for this managed resource.
- InstanceCount int
- InstanceType string
- StartDate stringRange 
- Tenancy string
- Indicates the tenancy of the Capacity Reservation. Specify either defaultordedicated.
- UpfrontFee string
- The total price to be paid up front.
- availabilityZone String
- The Availability Zone in which to create the Capacity Reservation.
- capacityBlock StringOffering Id 
- The Capacity Block Reservation ID.
- capacityDuration IntegerHours 
- currencyCode String
- The currency of the payment for the Capacity Block.
- endDate StringRange 
- id String
- The provider-assigned unique ID for this managed resource.
- instanceCount Integer
- instanceType String
- startDate StringRange 
- tenancy String
- Indicates the tenancy of the Capacity Reservation. Specify either defaultordedicated.
- upfrontFee String
- The total price to be paid up front.
- availabilityZone string
- The Availability Zone in which to create the Capacity Reservation.
- capacityBlock stringOffering Id 
- The Capacity Block Reservation ID.
- capacityDuration numberHours 
- currencyCode string
- The currency of the payment for the Capacity Block.
- endDate stringRange 
- id string
- The provider-assigned unique ID for this managed resource.
- instanceCount number
- instanceType string
- startDate stringRange 
- tenancy string
- Indicates the tenancy of the Capacity Reservation. Specify either defaultordedicated.
- upfrontFee string
- The total price to be paid up front.
- availability_zone str
- The Availability Zone in which to create the Capacity Reservation.
- capacity_block_ stroffering_ id 
- The Capacity Block Reservation ID.
- capacity_duration_ inthours 
- currency_code str
- The currency of the payment for the Capacity Block.
- end_date_ strrange 
- id str
- The provider-assigned unique ID for this managed resource.
- instance_count int
- instance_type str
- start_date_ strrange 
- tenancy str
- Indicates the tenancy of the Capacity Reservation. Specify either defaultordedicated.
- upfront_fee str
- The total price to be paid up front.
- availabilityZone String
- The Availability Zone in which to create the Capacity Reservation.
- capacityBlock StringOffering Id 
- The Capacity Block Reservation ID.
- capacityDuration NumberHours 
- currencyCode String
- The currency of the payment for the Capacity Block.
- endDate StringRange 
- id String
- The provider-assigned unique ID for this managed resource.
- instanceCount Number
- instanceType String
- startDate StringRange 
- tenancy String
- Indicates the tenancy of the Capacity Reservation. Specify either defaultordedicated.
- upfrontFee String
- The total price to be paid up front.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the awsTerraform Provider.