AWS SDK for Go (PILOT)
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 https://docs.aws.amazon.com/sdk-for-go/api/.

We welcome your feedback on this new version of the documentation. Send your comments to aws-sdkdocs-feedback@amazon.com.

CreateCapacityReservationInput

import "github.com/aws/aws-sdk-go/service/ec2"

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"` }

AvailabilityZone

Type: *string

The Availability Zone in which to create the Capacity Reservation.

AvailabilityZone is a required field

ClientToken

Type: *string

Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).

Constraint: Maximum 64 ASCII characters.

DryRun

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.

EbsOptimized

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.

EndDate

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.

EndDateType

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.

EphemeralStorage

Type: *bool

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

InstanceCount

Type: *int64

The number of instances for which to reserve capacity.

InstanceCount is a required field

InstanceMatchCriteria

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

InstancePlatform

Type: *string

The type of operating system for which to reserve capacity.

InstancePlatform is a required field

InstanceType

Type: *string

The instance type for which to reserve capacity. For more information, see Instance Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) in the Amazon Elastic Compute Cloud User Guide.

InstanceType is a required field

TagSpecifications

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

Tenancy

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.

Method

GoString

func (s CreateCapacityReservationInput) GoString() string

GoString returns the string representation

SetAvailabilityZone

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

SetAvailabilityZone sets the AvailabilityZone field's value.

SetClientToken

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

SetClientToken sets the ClientToken field's value.

SetDryRun

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

SetDryRun sets the DryRun field's value.

SetEbsOptimized

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

SetEbsOptimized sets the EbsOptimized field's value.

SetEndDate

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

SetEndDate sets the EndDate field's value.

SetEndDateType

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

SetEndDateType sets the EndDateType field's value.

SetEphemeralStorage

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

SetEphemeralStorage sets the EphemeralStorage field's value.

SetInstanceCount

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

SetInstanceCount sets the InstanceCount field's value.

SetInstanceMatchCriteria

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

SetInstanceMatchCriteria sets the InstanceMatchCriteria field's value.

SetInstancePlatform

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

SetInstancePlatform sets the InstancePlatform field's value.

SetInstanceType

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

SetInstanceType sets the InstanceType field's value.

SetTagSpecifications

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

SetTagSpecifications sets the TagSpecifications field's value.

SetTenancy

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

SetTenancy sets the Tenancy field's value.

String

func (s CreateCapacityReservationInput) String() string

String returns the string representation

Validate

func (s *CreateCapacityReservationInput) Validate() error

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

On this page: