1. Packages
  2. AWS
  3. API Docs
  4. ec2
  5. getCapacityBlockOffering
AWS v6.77.0 published on Wednesday, Apr 9, 2025 by Pulumi

aws.ec2.getCapacityBlockOffering

Explore with Pulumi AI

AWS v6.77.0 published on Wednesday, Apr 9, 2025 by Pulumi

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",
});
Copy
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")
Copy
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
	})
}
Copy
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",
    });

});
Copy
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());

    }
}
Copy
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
Copy

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>
Copy
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]
Copy
func GetCapacityBlockOffering(ctx *Context, args *GetCapacityBlockOfferingArgs, opts ...InvokeOption) (*GetCapacityBlockOfferingResult, error)
func GetCapacityBlockOfferingOutput(ctx *Context, args *GetCapacityBlockOfferingOutputArgs, opts ...InvokeOption) GetCapacityBlockOfferingResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetCapacityBlockOfferingResult> getCapacityBlockOffering(GetCapacityBlockOfferingArgs args, InvokeOptions options)
public static Output<GetCapacityBlockOfferingResult> getCapacityBlockOffering(GetCapacityBlockOfferingArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: aws:ec2/getCapacityBlockOffering:getCapacityBlockOffering
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

CapacityDurationHours This property is required. int
The amount of time of the Capacity Block reservation in hours.
InstanceCount This property is required. int
The number of instances for which to reserve capacity.
InstanceType This property is required. string
The instance type for which to reserve capacity.
EndDateRange string
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)
StartDateRange string
The date and time at which the Capacity Block Reservation starts. Valid values: RFC3339 time string (YYYY-MM-DDTHH:MM:SSZ)
CapacityDurationHours This property is required. int
The amount of time of the Capacity Block reservation in hours.
InstanceCount This property is required. int
The number of instances for which to reserve capacity.
InstanceType This property is required. string
The instance type for which to reserve capacity.
EndDateRange string
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)
StartDateRange string
The date and time at which the Capacity Block Reservation starts. Valid values: RFC3339 time string (YYYY-MM-DDTHH:MM:SSZ)
capacityDurationHours This property is required. Integer
The amount of time of the Capacity Block reservation in hours.
instanceCount This property is required. Integer
The number of instances for which to reserve capacity.
instanceType This property is required. String
The instance type for which to reserve capacity.
endDateRange String
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)
startDateRange String
The date and time at which the Capacity Block Reservation starts. Valid values: RFC3339 time string (YYYY-MM-DDTHH:MM:SSZ)
capacityDurationHours This property is required. number
The amount of time of the Capacity Block reservation in hours.
instanceCount This property is required. number
The number of instances for which to reserve capacity.
instanceType This property is required. string
The instance type for which to reserve capacity.
endDateRange string
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)
startDateRange string
The date and time at which the Capacity Block Reservation starts. Valid values: RFC3339 time string (YYYY-MM-DDTHH:MM:SSZ)
capacity_duration_hours This property is required. int
The amount of time of the Capacity Block reservation in hours.
instance_count This property is required. int
The number of instances for which to reserve capacity.
instance_type This property is required. str
The instance type for which to reserve capacity.
end_date_range str
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_range str
The date and time at which the Capacity Block Reservation starts. Valid values: RFC3339 time string (YYYY-MM-DDTHH:MM:SSZ)
capacityDurationHours This property is required. Number
The amount of time of the Capacity Block reservation in hours.
instanceCount This property is required. Number
The number of instances for which to reserve capacity.
instanceType This property is required. String
The instance type for which to reserve capacity.
endDateRange String
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)
startDateRange String
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.
CapacityBlockOfferingId string
The Capacity Block Reservation ID.
CapacityDurationHours int
CurrencyCode string
The currency of the payment for the Capacity Block.
EndDateRange string
Id string
The provider-assigned unique ID for this managed resource.
InstanceCount int
InstanceType string
StartDateRange string
Tenancy string
Indicates the tenancy of the Capacity Reservation. Specify either default or dedicated.
UpfrontFee string
The total price to be paid up front.
AvailabilityZone string
The Availability Zone in which to create the Capacity Reservation.
CapacityBlockOfferingId string
The Capacity Block Reservation ID.
CapacityDurationHours int
CurrencyCode string
The currency of the payment for the Capacity Block.
EndDateRange string
Id string
The provider-assigned unique ID for this managed resource.
InstanceCount int
InstanceType string
StartDateRange string
Tenancy string
Indicates the tenancy of the Capacity Reservation. Specify either default or dedicated.
UpfrontFee string
The total price to be paid up front.
availabilityZone String
The Availability Zone in which to create the Capacity Reservation.
capacityBlockOfferingId String
The Capacity Block Reservation ID.
capacityDurationHours Integer
currencyCode String
The currency of the payment for the Capacity Block.
endDateRange String
id String
The provider-assigned unique ID for this managed resource.
instanceCount Integer
instanceType String
startDateRange String
tenancy String
Indicates the tenancy of the Capacity Reservation. Specify either default or dedicated.
upfrontFee String
The total price to be paid up front.
availabilityZone string
The Availability Zone in which to create the Capacity Reservation.
capacityBlockOfferingId string
The Capacity Block Reservation ID.
capacityDurationHours number
currencyCode string
The currency of the payment for the Capacity Block.
endDateRange string
id string
The provider-assigned unique ID for this managed resource.
instanceCount number
instanceType string
startDateRange string
tenancy string
Indicates the tenancy of the Capacity Reservation. Specify either default or dedicated.
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_offering_id str
The Capacity Block Reservation ID.
capacity_duration_hours int
currency_code str
The currency of the payment for the Capacity Block.
end_date_range str
id str
The provider-assigned unique ID for this managed resource.
instance_count int
instance_type str
start_date_range str
tenancy str
Indicates the tenancy of the Capacity Reservation. Specify either default or dedicated.
upfront_fee str
The total price to be paid up front.
availabilityZone String
The Availability Zone in which to create the Capacity Reservation.
capacityBlockOfferingId String
The Capacity Block Reservation ID.
capacityDurationHours Number
currencyCode String
The currency of the payment for the Capacity Block.
endDateRange String
id String
The provider-assigned unique ID for this managed resource.
instanceCount Number
instanceType String
startDateRange String
tenancy String
Indicates the tenancy of the Capacity Reservation. Specify either default or dedicated.
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 aws Terraform Provider.
AWS v6.77.0 published on Wednesday, Apr 9, 2025 by Pulumi