API Reference

PREVIEW DOCUMENTATION - This is a preview of a new format for the AWS SDK for Go API Reference documentation. For the current AWS SDK for Go API Reference, see

We welcome your feedback on this new version of the documentation. Send your comments to


import ""

type CreateCapacityReservationInput struct { AvailabilityZone *string `type:"string" required:"true"` ClientToken *string `type:"string"` DryRun *bool `type:"boolean"` EbsOptimized *bool `type:"boolean"` EndDate *time.Time `type:"timestamp"` EndDateType *string `type:"string" enum:"EndDateType"` EphemeralStorage *bool `type:"boolean"` InstanceCount *int64 `type:"integer" required:"true"` InstanceMatchCriteria *string `type:"string" enum:"InstanceMatchCriteria"` InstancePlatform *string `type:"string" required:"true" enum:"CapacityReservationInstancePlatform"` InstanceType *string `type:"string" required:"true"` TagSpecifications []*TagSpecification `locationNameList:"item" type:"list"` Tenancy *string `type:"string" enum:"CapacityReservationTenancy"` }


Type: *string

The Availability Zone in which to create the Capacity Reservation.

AvailabilityZone is a required field


Type: *string

Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency (

Constraint: Maximum 64 ASCII characters.


Type: *bool

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.


Type: *bool

Indicates whether the Capacity Reservation supports EBS-optimized instances. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS- optimized instance.


Type: *time.Time

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. The Capacity Reservation's state changes to expired when it reaches its end date and time.

You must provide an EndDate value if EndDateType is limited. Omit EndDate if EndDateType is unlimited.

If the EndDateType is limited, the Capacity Reservation is cancelled within an hour from the specified time. For example, if you specify 5/31/2019, 13:30:55, the Capacity Reservation is guaranteed to end between 13:30:55 and 14:30:55 on 5/31/2019.


Type: *string

Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the following end types:

  • unlimited - The Capacity Reservation remains active until you explicitly cancel it. Do not provide an EndDate if the EndDateType is unlimited.

  • limited - The Capacity Reservation expires automatically at a specified date and time. You must provide an EndDate value if the EndDateType value is limited.


Type: *bool

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


Type: *int64

The number of instances for which to reserve capacity.

InstanceCount is a required field


Type: *string

Indicates the type of instance launches that the Capacity Reservation accepts. The options include:

  • open - The Capacity Reservation automatically matches all instances that have matching attributes (instance type, platform, and Availability Zone). Instances that have matching attributes run in the Capacity Reservation automatically without specifying any additional parameters.

  • targeted - The Capacity Reservation only accepts instances that have matching attributes (instance type, platform, and Availability Zone), and explicitly target the Capacity Reservation. This ensures that only permitted instances can use the reserved capacity.

Default: open


Type: *string

The type of operating system for which to reserve capacity.

InstancePlatform is a required field


Type: *string

The instance type for which to reserve capacity. For more information, see Instance Types ( in the Amazon Elastic Compute Cloud User Guide.

InstanceType is a required field


The tags to apply to a resource when the resource is being created.


Type: *string

Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following tenancy settings:

  • default - The Capacity Reservation is created on hardware that is shared with other AWS accounts.

  • dedicated - The Capacity Reservation is created on single-tenant hardware that is dedicated to a single AWS account.



func (s CreateCapacityReservationInput) GoString() string

GoString returns the string representation


func (s *CreateCapacityReservationInput) SetAvailabilityZone(v string) *CreateCapacityReservationInput

SetAvailabilityZone sets the AvailabilityZone field's value.


func (s *CreateCapacityReservationInput) SetClientToken(v string) *CreateCapacityReservationInput

SetClientToken sets the ClientToken field's value.


func (s *CreateCapacityReservationInput) SetDryRun(v bool) *CreateCapacityReservationInput

SetDryRun sets the DryRun field's value.


func (s *CreateCapacityReservationInput) SetEbsOptimized(v bool) *CreateCapacityReservationInput

SetEbsOptimized sets the EbsOptimized field's value.


func (s *CreateCapacityReservationInput) SetEndDate(v time.Time) *CreateCapacityReservationInput

SetEndDate sets the EndDate field's value.


func (s *CreateCapacityReservationInput) SetEndDateType(v string) *CreateCapacityReservationInput

SetEndDateType sets the EndDateType field's value.


func (s *CreateCapacityReservationInput) SetEphemeralStorage(v bool) *CreateCapacityReservationInput

SetEphemeralStorage sets the EphemeralStorage field's value.


func (s *CreateCapacityReservationInput) SetInstanceCount(v int64) *CreateCapacityReservationInput

SetInstanceCount sets the InstanceCount field's value.


func (s *CreateCapacityReservationInput) SetInstanceMatchCriteria(v string) *CreateCapacityReservationInput

SetInstanceMatchCriteria sets the InstanceMatchCriteria field's value.


func (s *CreateCapacityReservationInput) SetInstancePlatform(v string) *CreateCapacityReservationInput

SetInstancePlatform sets the InstancePlatform field's value.


func (s *CreateCapacityReservationInput) SetInstanceType(v string) *CreateCapacityReservationInput

SetInstanceType sets the InstanceType field's value.


func (s *CreateCapacityReservationInput) SetTagSpecifications(v []*TagSpecification) *CreateCapacityReservationInput

SetTagSpecifications sets the TagSpecifications field's value.


func (s *CreateCapacityReservationInput) SetTenancy(v string) *CreateCapacityReservationInput

SetTenancy sets the Tenancy field's value.


func (s CreateCapacityReservationInput) String() string

String returns the string representation


func (s *CreateCapacityReservationInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

On this page: