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
new CapacityReservation(name: string, args: CapacityReservationArgs, opts?: CustomResourceOptions);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);func NewCapacityReservation(ctx *Context, name string, args CapacityReservationArgs, opts ...ResourceOption) (*CapacityReservation, error)public CapacityReservation(string name, CapacityReservationArgs args, CustomResourceOptions? opts = null)- 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:
- Availability
Zone string The Availability Zone in which to create the Capacity Reservation.
- Instance
Count int The number of instances for which to reserve capacity.
- Instance
Platform 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 StandardorWindows with SQL Server Web.- Instance
Type string The instance type for which to reserve capacity.
- Ebs
Optimized bool Indicates whether the Capacity Reservation supports EBS-optimized instances.
- End
Date 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)- End
Date stringType Indicates the way in which the Capacity Reservation ends. Specify either
unlimitedorlimited.- Ephemeral
Storage bool Indicates whether the Capacity Reservation supports instances with temporary, block-level storage.
- Instance
Match stringCriteria Indicates the type of instance launches that the Capacity Reservation accepts. Specify either
openortargeted.- Dictionary<string, string>
A map of tags to assign to the resource.
- Tenancy string
Indicates the tenancy of the Capacity Reservation. Specify either
defaultordedicated.
- Availability
Zone string The Availability Zone in which to create the Capacity Reservation.
- Instance
Count int The number of instances for which to reserve capacity.
- Instance
Platform 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 StandardorWindows with SQL Server Web.- Instance
Type string The instance type for which to reserve capacity.
- Ebs
Optimized bool Indicates whether the Capacity Reservation supports EBS-optimized instances.
- End
Date 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)- End
Date stringType Indicates the way in which the Capacity Reservation ends. Specify either
unlimitedorlimited.- Ephemeral
Storage bool Indicates whether the Capacity Reservation supports instances with temporary, block-level storage.
- Instance
Match stringCriteria Indicates the type of instance launches that the Capacity Reservation accepts. Specify either
openortargeted.- map[string]string
A map of tags to assign to the resource.
- Tenancy string
Indicates the tenancy of the Capacity Reservation. Specify either
defaultordedicated.
- availability
Zone string The Availability Zone in which to create the Capacity Reservation.
- instance
Count number The number of instances for which to reserve capacity.
- instance
Platform 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 StandardorWindows with SQL Server Web.- instance
Type InstanceType The instance type for which to reserve capacity.
- ebs
Optimized boolean Indicates whether the Capacity Reservation supports EBS-optimized instances.
- end
Date 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)- end
Date stringType Indicates the way in which the Capacity Reservation ends. Specify either
unlimitedorlimited.- ephemeral
Storage boolean Indicates whether the Capacity Reservation supports instances with temporary, block-level storage.
- instance
Match stringCriteria Indicates the type of instance launches that the Capacity Reservation accepts. Specify either
openortargeted.- {[key: string]: string}
A map of tags to assign to the resource.
- tenancy Tenancy
Indicates the tenancy of the Capacity Reservation. Specify either
defaultordedicated.
- 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 StandardorWindows 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_ strtype Indicates the way in which the Capacity Reservation ends. Specify either
unlimitedorlimited.- ephemeral_
storage bool Indicates whether the Capacity Reservation supports instances with temporary, block-level storage.
- instance_
match_ strcriteria Indicates the type of instance launches that the Capacity Reservation accepts. Specify either
openortargeted.- Dict[str, str]
A map of tags to assign to the resource.
- tenancy str
Indicates the tenancy of the Capacity Reservation. Specify either
defaultordedicated.
Outputs
All input properties are implicitly available as output properties. Additionally, the CapacityReservation resource produces the following output properties:
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.
public static get(name: string, id: Input<ID>, state?: CapacityReservationState, opts?: CustomResourceOptions): CapacityReservationstatic 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)public static CapacityReservation Get(string name, Input<string> id, CapacityReservationState? state, CustomResourceOptions? opts = null)- 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.
- Availability
Zone string The Availability Zone in which to create the Capacity Reservation.
- Ebs
Optimized bool Indicates whether the Capacity Reservation supports EBS-optimized instances.
- End
Date 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)- End
Date stringType Indicates the way in which the Capacity Reservation ends. Specify either
unlimitedorlimited.- Ephemeral
Storage bool Indicates whether the Capacity Reservation supports instances with temporary, block-level storage.
- Instance
Count int The number of instances for which to reserve capacity.
- Instance
Match stringCriteria Indicates the type of instance launches that the Capacity Reservation accepts. Specify either
openortargeted.- Instance
Platform 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 StandardorWindows with SQL Server Web.- Instance
Type string The instance type for which to reserve capacity.
- Dictionary<string, string>
A map of tags to assign to the resource.
- Tenancy string
Indicates the tenancy of the Capacity Reservation. Specify either
defaultordedicated.
- Arn string
The ARN of the Capacity Reservation.
- Availability
Zone string The Availability Zone in which to create the Capacity Reservation.
- Ebs
Optimized bool Indicates whether the Capacity Reservation supports EBS-optimized instances.
- End
Date 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)- End
Date stringType Indicates the way in which the Capacity Reservation ends. Specify either
unlimitedorlimited.- Ephemeral
Storage bool Indicates whether the Capacity Reservation supports instances with temporary, block-level storage.
- Instance
Count int The number of instances for which to reserve capacity.
- Instance
Match stringCriteria Indicates the type of instance launches that the Capacity Reservation accepts. Specify either
openortargeted.- Instance
Platform 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 StandardorWindows with SQL Server Web.- Instance
Type string The instance type for which to reserve capacity.
- map[string]string
A map of tags to assign to the resource.
- Tenancy string
Indicates the tenancy of the Capacity Reservation. Specify either
defaultordedicated.
- arn string
The ARN of the Capacity Reservation.
- availability
Zone string The Availability Zone in which to create the Capacity Reservation.
- ebs
Optimized boolean Indicates whether the Capacity Reservation supports EBS-optimized instances.
- end
Date 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)- end
Date stringType Indicates the way in which the Capacity Reservation ends. Specify either
unlimitedorlimited.- ephemeral
Storage boolean Indicates whether the Capacity Reservation supports instances with temporary, block-level storage.
- instance
Count number The number of instances for which to reserve capacity.
- instance
Match stringCriteria Indicates the type of instance launches that the Capacity Reservation accepts. Specify either
openortargeted.- instance
Platform 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 StandardorWindows with SQL Server Web.- instance
Type InstanceType The instance type for which to reserve capacity.
- {[key: string]: string}
A map of tags to assign to the resource.
- tenancy Tenancy
Indicates the tenancy of the Capacity Reservation. Specify either
defaultordedicated.
- 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_ strtype Indicates the way in which the Capacity Reservation ends. Specify either
unlimitedorlimited.- 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_ strcriteria Indicates the type of instance launches that the Capacity Reservation accepts. Specify either
openortargeted.- 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 StandardorWindows with SQL Server Web.- instance_
type str The instance type for which to reserve capacity.
- Dict[str, str]
A map of tags to assign to the resource.
- tenancy str
Indicates the tenancy of the Capacity Reservation. Specify either
defaultordedicated.
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.