CapacityReservation

Provides an EC2 Capacity Reservation. This allows you to reserve capacity for your Amazon EC2 instances in a specific Availability Zone for any duration.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var @default = new Aws.Ec2.CapacityReservation("default", new Aws.Ec2.CapacityReservationArgs
        {
            AvailabilityZone = "eu-west-1a",
            InstanceCount = 1,
            InstancePlatform = "Linux/UNIX",
            InstanceType = "t2.micro",
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/ec2"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := ec2.NewCapacityReservation(ctx, "_default", &ec2.CapacityReservationArgs{
            AvailabilityZone: pulumi.String("eu-west-1a"),
            InstanceCount:    pulumi.Int(1),
            InstancePlatform: pulumi.String("Linux/UNIX"),
            InstanceType:     pulumi.String("t2.micro"),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

default = aws.ec2.CapacityReservation("default",
    availability_zone="eu-west-1a",
    instance_count=1,
    instance_platform="Linux/UNIX",
    instance_type="t2.micro")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const defaultCapacityReservation = new aws.ec2.CapacityReservation("default", {
    availabilityZone: "eu-west-1a",
    instanceCount: 1,
    instancePlatform: "Linux/UNIX",
    instanceType: "t2.micro",
});

Create a CapacityReservation Resource

def CapacityReservation(resource_name, opts=None, availability_zone=None, ebs_optimized=None, end_date=None, end_date_type=None, ephemeral_storage=None, instance_count=None, instance_match_criteria=None, instance_platform=None, instance_type=None, tags=None, tenancy=None, __props__=None);
name string
The unique name of the resource.
args CapacityReservationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args CapacityReservationArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args CapacityReservationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

CapacityReservation Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The CapacityReservation resource accepts the following input properties:

AvailabilityZone string

The Availability Zone in which to create the Capacity Reservation.

InstanceCount int

The number of instances for which to reserve capacity.

InstancePlatform string

The type of operating system for which to reserve capacity. Valid options are Linux/UNIX, Red Hat Enterprise Linux, SUSE Linux, Windows, Windows with SQL Server, Windows with SQL Server Enterprise, Windows with SQL Server Standard or Windows with SQL Server Web.

InstanceType string

The instance type for which to reserve capacity.

EbsOptimized bool

Indicates whether the Capacity Reservation supports EBS-optimized instances.

EndDate string

The date and time at which the Capacity 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)

EndDateType string

Indicates the way in which the Capacity Reservation ends. Specify either unlimited or limited.

EphemeralStorage bool

Indicates whether the Capacity Reservation supports instances with temporary, block-level storage.

InstanceMatchCriteria string

Indicates the type of instance launches that the Capacity Reservation accepts. Specify either open or targeted.

Tags Dictionary<string, string>

A map of tags to assign to the resource.

Tenancy string

Indicates the tenancy of the Capacity Reservation. Specify either default or dedicated.

AvailabilityZone string

The Availability Zone in which to create the Capacity Reservation.

InstanceCount int

The number of instances for which to reserve capacity.

InstancePlatform string

The type of operating system for which to reserve capacity. Valid options are Linux/UNIX, Red Hat Enterprise Linux, SUSE Linux, Windows, Windows with SQL Server, Windows with SQL Server Enterprise, Windows with SQL Server Standard or Windows with SQL Server Web.

InstanceType string

The instance type for which to reserve capacity.

EbsOptimized bool

Indicates whether the Capacity Reservation supports EBS-optimized instances.

EndDate string

The date and time at which the Capacity 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)

EndDateType string

Indicates the way in which the Capacity Reservation ends. Specify either unlimited or limited.

EphemeralStorage bool

Indicates whether the Capacity Reservation supports instances with temporary, block-level storage.

InstanceMatchCriteria string

Indicates the type of instance launches that the Capacity Reservation accepts. Specify either open or targeted.

Tags map[string]string

A map of tags to assign to the resource.

Tenancy string

Indicates the tenancy of the Capacity Reservation. Specify either default or dedicated.

availabilityZone string

The Availability Zone in which to create the Capacity Reservation.

instanceCount number

The number of instances for which to reserve capacity.

instancePlatform InstancePlatform

The type of operating system for which to reserve capacity. Valid options are Linux/UNIX, Red Hat Enterprise Linux, SUSE Linux, Windows, Windows with SQL Server, Windows with SQL Server Enterprise, Windows with SQL Server Standard or Windows with SQL Server Web.

instanceType InstanceType

The instance type for which to reserve capacity.

ebsOptimized boolean

Indicates whether the Capacity Reservation supports EBS-optimized instances.

endDate string

The date and time at which the Capacity 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)

endDateType string

Indicates the way in which the Capacity Reservation ends. Specify either unlimited or limited.

ephemeralStorage boolean

Indicates whether the Capacity Reservation supports instances with temporary, block-level storage.

instanceMatchCriteria string

Indicates the type of instance launches that the Capacity Reservation accepts. Specify either open or targeted.

tags {[key: string]: string}

A map of tags to assign to the resource.

tenancy Tenancy

Indicates the tenancy of the Capacity Reservation. Specify either default or dedicated.

availability_zone str

The Availability Zone in which to create the Capacity Reservation.

instance_count float

The number of instances for which to reserve capacity.

instance_platform str

The type of operating system for which to reserve capacity. Valid options are Linux/UNIX, Red Hat Enterprise Linux, SUSE Linux, Windows, Windows with SQL Server, Windows with SQL Server Enterprise, Windows with SQL Server Standard or Windows with SQL Server Web.

instance_type str

The instance type for which to reserve capacity.

ebs_optimized bool

Indicates whether the Capacity Reservation supports EBS-optimized instances.

end_date str

The date and time at which the Capacity 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)

end_date_type str

Indicates the way in which the Capacity Reservation ends. Specify either unlimited or limited.

ephemeral_storage bool

Indicates whether the Capacity Reservation supports instances with temporary, block-level storage.

instance_match_criteria str

Indicates the type of instance launches that the Capacity Reservation accepts. Specify either open or targeted.

tags Dict[str, str]

A map of tags to assign to the resource.

tenancy str

Indicates the tenancy of the Capacity Reservation. Specify either default or dedicated.

Outputs

All input properties are implicitly available as output properties. Additionally, the CapacityReservation resource produces the following output properties:

Arn string

The ARN of the Capacity Reservation.

Id string
The provider-assigned unique ID for this managed resource.
Arn string

The ARN of the Capacity Reservation.

Id string
The provider-assigned unique ID for this managed resource.
arn string

The ARN of the Capacity Reservation.

id string
The provider-assigned unique ID for this managed resource.
arn str

The ARN of the Capacity Reservation.

id str
The provider-assigned unique ID for this managed resource.

Look up an Existing CapacityReservation Resource

Get an existing CapacityReservation resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

static get(resource_name, id, opts=None, arn=None, availability_zone=None, ebs_optimized=None, end_date=None, end_date_type=None, ephemeral_storage=None, instance_count=None, instance_match_criteria=None, instance_platform=None, instance_type=None, tags=None, tenancy=None, __props__=None);
func GetCapacityReservation(ctx *Context, name string, id IDInput, state *CapacityReservationState, opts ...ResourceOption) (*CapacityReservation, error)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Arn string

The ARN of the Capacity Reservation.

AvailabilityZone string

The Availability Zone in which to create the Capacity Reservation.

EbsOptimized bool

Indicates whether the Capacity Reservation supports EBS-optimized instances.

EndDate string

The date and time at which the Capacity 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)

EndDateType string

Indicates the way in which the Capacity Reservation ends. Specify either unlimited or limited.

EphemeralStorage bool

Indicates whether the Capacity Reservation supports instances with temporary, block-level storage.

InstanceCount int

The number of instances for which to reserve capacity.

InstanceMatchCriteria string

Indicates the type of instance launches that the Capacity Reservation accepts. Specify either open or targeted.

InstancePlatform string

The type of operating system for which to reserve capacity. Valid options are Linux/UNIX, Red Hat Enterprise Linux, SUSE Linux, Windows, Windows with SQL Server, Windows with SQL Server Enterprise, Windows with SQL Server Standard or Windows with SQL Server Web.

InstanceType string

The instance type for which to reserve capacity.

Tags Dictionary<string, string>

A map of tags to assign to the resource.

Tenancy string

Indicates the tenancy of the Capacity Reservation. Specify either default or dedicated.

Arn string

The ARN of the Capacity Reservation.

AvailabilityZone string

The Availability Zone in which to create the Capacity Reservation.

EbsOptimized bool

Indicates whether the Capacity Reservation supports EBS-optimized instances.

EndDate string

The date and time at which the Capacity 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)

EndDateType string

Indicates the way in which the Capacity Reservation ends. Specify either unlimited or limited.

EphemeralStorage bool

Indicates whether the Capacity Reservation supports instances with temporary, block-level storage.

InstanceCount int

The number of instances for which to reserve capacity.

InstanceMatchCriteria string

Indicates the type of instance launches that the Capacity Reservation accepts. Specify either open or targeted.

InstancePlatform string

The type of operating system for which to reserve capacity. Valid options are Linux/UNIX, Red Hat Enterprise Linux, SUSE Linux, Windows, Windows with SQL Server, Windows with SQL Server Enterprise, Windows with SQL Server Standard or Windows with SQL Server Web.

InstanceType string

The instance type for which to reserve capacity.

Tags map[string]string

A map of tags to assign to the resource.

Tenancy string

Indicates the tenancy of the Capacity Reservation. Specify either default or dedicated.

arn string

The ARN of the Capacity Reservation.

availabilityZone string

The Availability Zone in which to create the Capacity Reservation.

ebsOptimized boolean

Indicates whether the Capacity Reservation supports EBS-optimized instances.

endDate string

The date and time at which the Capacity 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)

endDateType string

Indicates the way in which the Capacity Reservation ends. Specify either unlimited or limited.

ephemeralStorage boolean

Indicates whether the Capacity Reservation supports instances with temporary, block-level storage.

instanceCount number

The number of instances for which to reserve capacity.

instanceMatchCriteria string

Indicates the type of instance launches that the Capacity Reservation accepts. Specify either open or targeted.

instancePlatform InstancePlatform

The type of operating system for which to reserve capacity. Valid options are Linux/UNIX, Red Hat Enterprise Linux, SUSE Linux, Windows, Windows with SQL Server, Windows with SQL Server Enterprise, Windows with SQL Server Standard or Windows with SQL Server Web.

instanceType InstanceType

The instance type for which to reserve capacity.

tags {[key: string]: string}

A map of tags to assign to the resource.

tenancy Tenancy

Indicates the tenancy of the Capacity Reservation. Specify either default or dedicated.

arn str

The ARN of the Capacity Reservation.

availability_zone str

The Availability Zone in which to create the Capacity Reservation.

ebs_optimized bool

Indicates whether the Capacity Reservation supports EBS-optimized instances.

end_date str

The date and time at which the Capacity 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)

end_date_type str

Indicates the way in which the Capacity Reservation ends. Specify either unlimited or limited.

ephemeral_storage bool

Indicates whether the Capacity Reservation supports instances with temporary, block-level storage.

instance_count float

The number of instances for which to reserve capacity.

instance_match_criteria str

Indicates the type of instance launches that the Capacity Reservation accepts. Specify either open or targeted.

instance_platform str

The type of operating system for which to reserve capacity. Valid options are Linux/UNIX, Red Hat Enterprise Linux, SUSE Linux, Windows, Windows with SQL Server, Windows with SQL Server Enterprise, Windows with SQL Server Standard or Windows with SQL Server Web.

instance_type str

The instance type for which to reserve capacity.

tags Dict[str, str]

A map of tags to assign to the resource.

tenancy str

Indicates the tenancy of the Capacity Reservation. Specify either default or dedicated.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.