ec2

package
v0.0.0-...-021b8db Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2017 License: LGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	PublicIp                string `xml:"publicIp"`
	AllocationId            string `xml:"allocationId"`
	Domain                  string `xml:"domain"`
	InstanceId              string `xml:"instanceId"`
	AssociationId           string `xml:"associationId"`
	NetworkInterfaceId      string `xml:"networkInterfaceId"`
	NetworkInterfaceOwnerId string `xml:"networkInterfaceOwnerId"`
	PrivateIpAddress        string `xml:"privateIpAddress"`
}

Address represents an Elastic IP Address See http://goo.gl/uxCjp7 for more details

type AllocateAddressOptions

type AllocateAddressOptions struct {
	Domain string
}

AllocateAddressOptions are request parameters for allocating an Elastic IP Address

See http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-AllocateAddress.html

type AllocateAddressResp

type AllocateAddressResp struct {
	RequestId    string `xml:"requestId"`
	PublicIp     string `xml:"publicIp"`
	Domain       string `xml:"domain"`
	AllocationId string `xml:"allocationId"`
}

Response to an AllocateAddress request

See http://goo.gl/aLPmbm for more details

type AssociateAddressOptions

type AssociateAddressOptions struct {
	PublicIp           string
	InstanceId         string
	AllocationId       string
	NetworkInterfaceId string
	PrivateIpAddress   string
	AllowReassociation bool
}

Options set for AssociateAddress

See http://goo.gl/hhj4z7 for more details

type AssociateAddressResp

type AssociateAddressResp struct {
	RequestId     string `xml:"requestId"`
	Return        bool   `xml:"return"`
	AssociationId string `xml:"associationId"`
}

Response to an AssociateAddress request

See http://goo.gl/hhj4z7 for more details

type AssociateRouteTableResp

type AssociateRouteTableResp struct {
	RequestId     string `xml:"requestId"`
	AssociationId string `xml:"associationId"`
}

AssociateRouteTableResp represents a response from an AssociateRouteTable call

See http://goo.gl/T4KlYk for more details.

type AttachVolumeResp

type AttachVolumeResp struct {
	RequestId  string `xml:"requestId"`
	VolumeId   string `xml:"volumeId"`
	InstanceId string `xml:"instanceId"`
	Device     string `xml:"device"`
	Status     string `xml:"status"`
	AttachTime string `xml:"attachTime"`
}

Response to an AttachVolume request

type BlockDevice

type BlockDevice struct {
	DeviceName string `xml:"deviceName"`
	EBS        EBS    `xml:"ebs"`
}

type BlockDeviceMapping

type BlockDeviceMapping struct {
	DeviceName          string `xml:"deviceName"`
	VirtualName         string `xml:"virtualName"`
	SnapshotId          string `xml:"ebs>snapshotId"`
	VolumeType          string `xml:"ebs>volumeType"`
	VolumeSize          int64  `xml:"ebs>volumeSize"`
	DeleteOnTermination bool   `xml:"ebs>deleteOnTermination"`
	NoDevice            bool   `xml:"noDevice"`

	// The number of I/O operations per second (IOPS) that the volume supports.
	IOPS int64 `xml:"ebs>iops"`
}

BlockDeviceMapping represents the association of a block device with an image.

See http://goo.gl/wnDBf for more details.

type CancelSpotRequestResult

type CancelSpotRequestResult struct {
	SpotRequestId string `xml:"spotInstanceRequestId"`
	State         string `xml:"state"`
}

Response to a CancelSpotInstanceRequests request.

See http://goo.gl/3BKHj for more details.

type CancelSpotRequestsResp

type CancelSpotRequestsResp struct {
	RequestId                string                    `xml:"requestId"`
	CancelSpotRequestResults []CancelSpotRequestResult `xml:"spotInstanceRequestSet>item"`
}

type CopyImage

type CopyImage struct {
	SourceRegion  string
	SourceImageId string
	Name          string
	Description   string
	ClientToken   string
}

The CopyImage request parameters.

See http://goo.gl/hQwPCK for more details.

type CopyImageResp

type CopyImageResp struct {
	RequestId string `xml:"requestId"`
	ImageId   string `xml:"imageId"`
}

Response to a CopyImage request.

See http://goo.gl/hQwPCK for more details.

type CreateImage

type CreateImage struct {
	InstanceId   string
	Name         string
	Description  string
	NoReboot     bool
	BlockDevices []BlockDeviceMapping
}

The CreateImage request parameters.

See http://goo.gl/cxU41 for more details.

type CreateImageResp

type CreateImageResp struct {
	RequestId string `xml:"requestId"`
	ImageId   string `xml:"imageId"`
}

Response to a CreateImage request.

See http://goo.gl/cxU41 for more details.

type CreateKeyPairResp

type CreateKeyPairResp struct {
	RequestId      string `xml:"requestId"`
	KeyName        string `xml:"keyName"`
	KeyFingerprint string `xml:"keyFingerprint"`
	KeyMaterial    string `xml:"keyMaterial"`
}

type CreateRoute

type CreateRoute struct {
	DestinationCidrBlock   string
	GatewayId              string
	InstanceId             string
	NetworkInterfaceId     string
	VpcPeeringConnectionId string
}

CreateRoute structure contains the options for a CreateRoute API call.

type CreateRouteResp

type CreateRouteResp struct {
	RequestId string `xml:"requestId"`
	Return    bool   `xml:"return"` // True if the request succeeds
}

CreateRouteResp represents a response from a CreateRoute request

See http://goo.gl/c6Bg7e for more details.

type CreateRouteTableResp

type CreateRouteTableResp struct {
	RequestId  string     `xml:"requestId"`
	RouteTable RouteTable `xml:"routeTable"`
}

CreateRouteTableResp represents a response from a CreateRouteTable request

See http://goo.gl/LD0TqP for more details.

type CreateSecurityGroupResp

type CreateSecurityGroupResp struct {
	SecurityGroup
	RequestId string `xml:"requestId"`
}

CreateSecurityGroupResp represents a response to a CreateSecurityGroup request.

type CreateSnapshotResp

type CreateSnapshotResp struct {
	RequestId string `xml:"requestId"`
	Snapshot
}

Response to a CreateSnapshot request.

See http://goo.gl/ttcda for more details.

type CreateVolume

type CreateVolume struct {
	AvailZone  string
	Size       int64
	SnapshotId string
	VolumeType string
	IOPS       int64
}

The CreateVolume request parameters

See http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-CreateVolume.html

type CreateVolumeResp

type CreateVolumeResp struct {
	RequestId  string `xml:"requestId"`
	VolumeId   string `xml:"volumeId"`
	Size       int64  `xml:"size"`
	SnapshotId string `xml:"snapshotId"`
	AvailZone  string `xml:"availabilityZone"`
	Status     string `xml:"status"`
	CreateTime string `xml:"createTime"`
	VolumeType string `xml:"volumeType"`
	IOPS       int64  `xml:"iops"`
}

Response to a CreateVolume request

type CreateVpcResp

type CreateVpcResp struct {
	RequestId string `xml:"requestId"`
	VPC       VPC    `xml:"vpc"` // Information about the VPC.
}

CreateVpcResp represents a response from a CreateVpcResp request

See http://goo.gl/QoK11F for more details.

type DeleteRouteResp

type DeleteRouteResp struct {
	RequestId string `xml:"requestId"`
	Return    bool   `xml:"return"` // True if the request succeeds
}

DeleteRouteResp represents a response from a DeleteRoute request

See http://goo.gl/Uqyt3w for more details.

type DeleteRouteTableResp

type DeleteRouteTableResp struct {
	RequestId string `xml:"requestId"`
	Return    bool   `xml:"return"` // True if the request succeeds
}

DeleteRouteTableResp represents a response from a DeleteRouteTable request

See http://goo.gl/b8usig for more details.

type DeleteVpcResp

type DeleteVpcResp struct {
	RequestId string `xml:"requestId"`
	Return    bool   `xml:"return"` // True if the request succeeds
}

DeleteVpcResp represents a response from a DeleteVpc request

See http://goo.gl/qawyrz for more details.

type DeregisterImageResp

type DeregisterImageResp struct {
	RequestId string `xml:"requestId"`
	Return    bool   `xml:"return"`
}

Response to a DegisterImage request.

See http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DeregisterImage.html

type DescribeAddressesResp

type DescribeAddressesResp struct {
	RequestId string    `xml:"requestId"`
	Addresses []Address `xml:"addressesSet>item"`
}

Response to a DescribeAddresses request.

See http://goo.gl/zW7J4p for more details.

type DescribeInstanceStatusOptions

type DescribeInstanceStatusOptions struct {
	InstanceIds         []string // If non-empty, limit the query to this subset of instances. Maximum length of 100.
	IncludeAllInstances bool     // If true, describe all instances, instead of just running instances (the default).
	MaxResults          int      // Maximum number of results to return. Minimum of 5. Maximum of 1000.
	NextToken           string   // The token for the next set of items to return. (You received this token from a prior call.)
}

DescribeInstanceStatusOptions encapsulates the query parameters for the corresponding action.

See http:////goo.gl/2FBTdS for more details.

type DescribeInstanceStatusResp

type DescribeInstanceStatusResp struct {
	RequestId         string               `xml:"requestId"`
	InstanceStatusSet []InstanceStatusItem `xml:"instanceStatusSet>item"`
	NextToken         string               `xml:"nextToken"`
}

Response to a DescribeInstanceStatus request.

See http://goo.gl/2FBTdS for more details.

type DescribeInstancesResp

type DescribeInstancesResp struct {
	RequestId    string        `xml:"requestId"`
	Reservations []Reservation `xml:"reservationSet>item"`
}

Response to a DescribeInstances request.

See http://goo.gl/mLbmw for more details.

type DescribeReservedInstancesResponse

type DescribeReservedInstancesResponse struct {
	RequestId         string                          `xml:"requestId"`
	ReservedInstances []ReservedInstancesResponseItem `xml:"reservedInstancesSet>item"`
}

DescribeReservedInstancesResponse structure returned from a DescribeReservedInstances request.

See

type DescribeRouteTablesResp

type DescribeRouteTablesResp struct {
	RequestId   string       `xml:"requestId"`
	RouteTables []RouteTable `xml:"routeTableSet>item"`
}

DescribeRouteTablesResp represents a response from a DescribeRouteTables call

See http://goo.gl/T3tVsg for more details.

type DescribeVpcsResp

type DescribeVpcsResp struct {
	RequestId string `xml:"requestId"`
	VPCs      []VPC  `xml:"vpcSet>item"` // Information about one or more VPCs.
}

DescribeVpcsResp represents a response from a DescribeVpcs request

See http://goo.gl/DWQWvZ for more details.

type DisassociateAddressResp

type DisassociateAddressResp struct {
	RequestId string `xml:"requestId"`
	Return    bool   `xml:"return"`
}

Response to a Disassociate Address request

See http://goo.gl/Dapkuzfor more details

type DisassociateRouteTableResp

type DisassociateRouteTableResp struct {
	RequestId string `xml:"requestId"`
	Return    bool   `xml:"return"` // True if the request succeeds
}

DisassociateRouteTableResp represents the response from a DisassociateRouteTable request

See http://goo.gl/1v4reT for more details.

type EBS

type EBS struct {
	VolumeId            string `xml:"volumeId"`
	Status              string `xml:"status"`
	AttachTime          string `xml:"attachTime"`
	DeleteOnTermination bool   `xml:"deleteOnTermination"`
}

type EC2

type EC2 struct {
	*aws.Auth
	aws.Region
	// contains filtered or unexported fields
}

The EC2 type encapsulates operations with a specific EC2 region.

func New

func New(auth *aws.Auth, region aws.Region) *EC2

New creates a new EC2.

func NewWithClient

func NewWithClient(auth *aws.Auth, region aws.Region, client *http.Client) *EC2

NewWithClient creates a new EC2 with a custom http client

func (*EC2) AllocateAddress

func (ec2 *EC2) AllocateAddress(options *AllocateAddressOptions) (resp *AllocateAddressResp, err error)

Allocates a new Elastic IP address. The domain parameter is optional and is used for provisioning an ip address in EC2 or in VPC respectively

See http://goo.gl/aLPmbm for more details

func (*EC2) AssociateAddress

func (ec2 *EC2) AssociateAddress(options *AssociateAddressOptions) (resp *AssociateAddressResp, err error)

Associate an Elastic ip address to an instance id or a network interface

See http://goo.gl/hhj4z7 for more details

func (*EC2) AssociateRouteTable

func (ec2 *EC2) AssociateRouteTable(routeTableId, subnetId string) (resp *AssociateRouteTableResp, err error)

AssociateRouteTable associates a subnet with a route table.

The subnet and route table must be in the same VPC. This association causes traffic originating from the subnet to be routed according to the routes in the route table. The action returns an association ID, which you need in order to disassociate the route table from the subnet later. A route table can be associated with multiple subnets.

See http://goo.gl/bfnONU for more details.

func (*EC2) AttachVolume

func (ec2 *EC2) AttachVolume(volumeId string, instanceId string, device string) (resp *AttachVolumeResp, err error)

Attach a volume.

func (*EC2) AuthorizeSecurityGroup

func (ec2 *EC2) AuthorizeSecurityGroup(group SecurityGroup, perms []IPPerm) (resp *SimpleResp, err error)

AuthorizeSecurityGroup creates an allowance for clients matching the provided rules to access instances within the given security group.

See http://goo.gl/u2sDJ for more details.

func (*EC2) AuthorizeSecurityGroupEgress

func (ec2 *EC2) AuthorizeSecurityGroupEgress(group SecurityGroup, perms []IPPerm) (resp *SimpleResp, err error)

AuthorizeSecurityGroupEgress creates an allowance for instances within the given security group to access servers matching the provided rules.

See http://goo.gl/R91LXY for more details.

func (*EC2) CancelSpotRequests

func (ec2 *EC2) CancelSpotRequests(spotrequestIds []string) (resp *CancelSpotRequestsResp, err error)

CancelSpotRequests requests the cancellation of spot requests when the given ids.

See http://goo.gl/3BKHj for more details.

func (*EC2) CopyImage

func (ec2 *EC2) CopyImage(options *CopyImage) (resp *CopyImageResp, err error)

Copy and Image from one region to another.

See http://goo.gl/hQwPCK for more details.

func (*EC2) CreateImage

func (ec2 *EC2) CreateImage(options *CreateImage) (resp *CreateImageResp, err error)

Creates an Amazon EBS-backed AMI from an Amazon EBS-backed instance that is either running or stopped.

See http://goo.gl/cxU41 for more details.

func (*EC2) CreateKeyPair

func (ec2 *EC2) CreateKeyPair(keyName string) (resp *CreateKeyPairResp, err error)

CreateKeyPair creates a new key pair and returns the private key contents.

See http://goo.gl/0S6hV

func (*EC2) CreateRoute

func (ec2 *EC2) CreateRoute(routeTableId string, options *CreateRoute) (resp *CreateRouteResp, err error)

CreateRoute creates a route in a route table within a VPC. You must specify one of the following targets: Internet gateway or virtual private gateway, NAT instance, VPC peering connection, or network interface.

See http://goo.gl/c6Bg7e for more details.

func (*EC2) CreateRouteTable

func (ec2 *EC2) CreateRouteTable(vpcId string) (resp *CreateRouteTableResp, err error)

CreateRouteTable creates a route table for the specified VPC. After you create a route table, you can add routes and associate the table with a subnet.

See http://goo.gl/V9h6gE for more details..

func (*EC2) CreateSecurityGroup

func (ec2 *EC2) CreateSecurityGroup(group SecurityGroup) (resp *CreateSecurityGroupResp, err error)

CreateSecurityGroup run a CreateSecurityGroup request in EC2, with the provided name and description.

See http://goo.gl/Eo7Yl for more details.

func (*EC2) CreateSnapshot

func (ec2 *EC2) CreateSnapshot(volumeId, description string) (resp *CreateSnapshotResp, err error)

CreateSnapshot creates a volume snapshot and stores it in S3.

See http://goo.gl/ttcda for more details.

func (*EC2) CreateTags

func (ec2 *EC2) CreateTags(resourceIds []string, tags []Tag) (resp *SimpleResp, err error)

CreateTags adds or overwrites one or more tags for the specified taggable resources. For a list of tagable resources, see: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html

See http://goo.gl/Vmkqc for more details

func (*EC2) CreateVolume

func (ec2 *EC2) CreateVolume(options *CreateVolume) (resp *CreateVolumeResp, err error)

Create a new volume.

func (*EC2) CreateVpc

func (ec2 *EC2) CreateVpc(cidrBlock, instanceTenancy string) (resp *CreateVpcResp, err error)

CreateVpc creates a VPC with the specified CIDR block.

The smallest VPC you can create uses a /28 netmask (16 IP addresses), and the largest uses a /16 netmask (65,536 IP addresses).

By default, each instance you launch in the VPC has the default DHCP options, which includes only a default DNS server that Amazon provides (AmazonProvidedDNS).

See http://goo.gl/QoK11F for more details.

func (*EC2) DeleteKeyPair

func (ec2 *EC2) DeleteKeyPair(name string) (resp *SimpleResp, err error)

DeleteKeyPair deletes a key pair.

See http://goo.gl/0bqok

func (*EC2) DeleteRoute

func (ec2 *EC2) DeleteRoute(routeTableId, destinationCidrBlock string) (resp *DeleteRouteResp, err error)

DeleteRoute deletes the specified route from the specified route table.

See http://goo.gl/Uqyt3w for more details.

func (*EC2) DeleteRouteTable

func (ec2 *EC2) DeleteRouteTable(routeTableId string) (resp *DeleteRouteTableResp, err error)

DeleteRouteTable deletes the specified route table. You must disassociate the route table from any subnets before you can delete it. You can't delete the main route table.

See http://goo.gl/crHxT2 for more details.

func (*EC2) DeleteSecurityGroup

func (ec2 *EC2) DeleteSecurityGroup(group SecurityGroup) (resp *SimpleResp, err error)

DeleteSecurityGroup removes the given security group in EC2.

See http://goo.gl/QJJDO for more details.

func (*EC2) DeleteSnapshots

func (ec2 *EC2) DeleteSnapshots(ids []string) (resp *SimpleResp, err error)

DeleteSnapshots deletes the volume snapshots with the given ids.

Note: If you make periodic snapshots of a volume, the snapshots are incremental so that only the blocks on the device that have changed since your last snapshot are incrementally saved in the new snapshot. Even though snapshots are saved incrementally, the snapshot deletion process is designed so that you need to retain only the most recent snapshot in order to restore the volume.

See http://goo.gl/vwU1y for more details.

func (*EC2) DeleteVolume

func (ec2 *EC2) DeleteVolume(id string) (resp *SimpleResp, err error)

Delete an EBS volume.

func (*EC2) DeleteVpc

func (ec2 *EC2) DeleteVpc(vpcId string) (resp *DeleteVpcResp, err error)

DeleteVpc deletes the specified VPC.

You must detach or delete all gateways and resources that are associated with the VPC before you can delete it. For example, you must terminate all instances running in the VPC, delete all security groups associated with the VPC (except the default one), delete all route tables associated with the VPC (except the default one), and so on.

See http://goo.gl/qawyrz for more details.

func (*EC2) DeregisterImage

func (ec2 *EC2) DeregisterImage(imageId string) (resp *DeregisterImageResp, err error)

Degisters an image. Note that this does not delete the backing stores of the AMI.

See http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DeregisterImage.html

func (*EC2) DescribeAddresses

func (ec2 *EC2) DescribeAddresses(publicIps []string, allocationIds []string, filter *Filter) (resp *DescribeAddressesResp, err error)

DescribeAddresses returns details about one or more Elastic IP Addresses. Returned addresses can be filtered by Public IP, Allocation ID or multiple filters

See http://goo.gl/zW7J4p for more details.

func (*EC2) DescribeInstanceStatus

func (ec2 *EC2) DescribeInstanceStatus(options *DescribeInstanceStatusOptions, filter *Filter) (resp *DescribeInstanceStatusResp, err error)

DescribeInstanceStatus returns instance status information about instances in EC2. instIds and filter are optional, and if provided will limit the instances returned to those matching the given instance ids or filtering rules. all determines whether to report all matching instances or only those in the running state

See http://goo.gl/2FBTdS for more details.

func (*EC2) DescribeInstances

func (ec2 *EC2) DescribeInstances(instIds []string, filter *Filter) (resp *DescribeInstancesResp, err error)

Instances returns details about instances in EC2. Both parameters are optional, and if provided will limit the instances returned to those matching the given instance ids or filtering rules.

See http://goo.gl/4No7c for more details.

func (*EC2) DescribeReservedInstances

func (ec2 *EC2) DescribeReservedInstances(instIds []string, filter *Filter) (resp *DescribeReservedInstancesResponse, err error)

functions DescribeReservedInstances

See

func (*EC2) DescribeRouteTables

func (ec2 *EC2) DescribeRouteTables(routeTableIds []string, filter *Filter) (resp *DescribeRouteTablesResp, err error)

DescribeRouteTables describes one or more of your route tables

See http://goo.gl/S0RVos for more details.

func (*EC2) DescribeSpotRequests

func (ec2 *EC2) DescribeSpotRequests(spotrequestIds []string, filter *Filter) (resp *SpotRequestsResp, err error)

DescribeSpotInstanceRequests returns details about spot requests in EC2. Both parameters are optional, and if provided will limit the spot requests returned to those matching the given spot request ids or filtering rules.

See http://goo.gl/KsKJJk for more details.

func (*EC2) DescribeVpcs

func (ec2 *EC2) DescribeVpcs(vpcIds []string, filter *Filter) (resp *DescribeVpcsResp, err error)

DescribeVpcs describes one or more of your VPCs.

See http://goo.gl/DWQWvZ for more details.

func (*EC2) DetachVolume

func (ec2 *EC2) DetachVolume(id string) (resp *SimpleResp, err error)

Detaches an EBS volume.

func (*EC2) DisassociateAddress

func (ec2 *EC2) DisassociateAddress(publicIp, associationId string) (resp *DisassociateAddressResp, err error)

Disassociate an elastic ip address from an instance PublicIp - Required for EC2 AssociationId - Required for VPC See http://goo.gl/Dapkuz for more details

func (*EC2) DisassociateRouteTable

func (ec2 *EC2) DisassociateRouteTable(associationId string) (resp *DisassociateRouteTableResp, err error)

DisassociateRouteTable disassociates a subnet from a route table.

See http://goo.gl/A4NJum for more details.

func (*EC2) ImageAttribute

func (ec2 *EC2) ImageAttribute(imageId, attribute string) (resp *ImageAttributeResp, err error)

ImageAttribute describes an attribute of an AMI. You can specify only one attribute at a time. Valid attributes are:

description | kernel | ramdisk | launchPermission | productCodes | blockDeviceMapping

See http://goo.gl/bHO3zT for more details.

func (*EC2) Images

func (ec2 *EC2) Images(ids []string, filter *Filter) (resp *ImagesResp, err error)

Images returns details about available images. The ids and filter parameters, if provided, will limit the images returned. For example, to get all the private images associated with this account set the boolean filter "is-public" to 0. For list of filters: http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeImages.html

Note: calling this function with nil ids and filter parameters will result in a very large number of images being returned.

See http://goo.gl/SRBhW for more details.

func (*EC2) ImagesByOwners

func (ec2 *EC2) ImagesByOwners(ids []string, owners []string, filter *Filter) (resp *ImagesResp, err error)

ImagesByOwners returns details about available images. The ids, owners, and filter parameters, if provided, will limit the images returned. For example, to get all the private images associated with this account set the boolean filter "is-public" to 0. For list of filters: http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeImages.html

Note: calling this function with nil ids and filter parameters will result in a very large number of images being returned.

See http://goo.gl/SRBhW for more details.

func (*EC2) ModifyImageAttribute

func (ec2 *EC2) ModifyImageAttribute(imageId string, options *ModifyImageAttribute) (resp *SimpleResp, err error)

ModifyImageAttribute sets attributes for an image.

See http://goo.gl/YUjO4G for more details.

func (*EC2) ModifyInstance

func (ec2 *EC2) ModifyInstance(instId string, options *ModifyInstance) (resp *ModifyInstanceResp, err error)

ModifyImageAttribute modifies the specified attribute of the specified instance. You can specify only one attribute at a time. To modify some attributes, the instance must be stopped.

See http://goo.gl/icuXh5 for more details.

func (*EC2) RebootInstances

func (ec2 *EC2) RebootInstances(ids ...string) (resp *SimpleResp, err error)

RebootInstance requests a reboot of one or more instances. This operation is asynchronous; it only queues a request to reboot the specified instance(s). The operation will succeed if the instances are valid and belong to you.

Requests to reboot terminated instances are ignored.

See http://goo.gl/baoUf for more details.

func (*EC2) RegisterImage

func (ec2 *EC2) RegisterImage(options *RegisterImage) (resp *RegisterImageResp, err error)

Registers a new AMI with EC2.

See: http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-RegisterImage.html

func (*EC2) ReleaseAddress

func (ec2 *EC2) ReleaseAddress(publicIp, allocationId string) (resp *ReleaseAddressResp, err error)

Release existing elastic ip address from the account PublicIp = Required for EC2 AllocationId = Required for VPC

See http://goo.gl/Ciw2Z8 for more details

func (*EC2) ReplaceRouteTableAssociation

func (ec2 *EC2) ReplaceRouteTableAssociation(associationId, routeTableId string) (resp *ReplaceRouteTableAssociationResp, err error)

ReplaceRouteTableAssociation changes the route table associated with a given subnet in a VPC.

See http://goo.gl/kiit8j for more details.

func (*EC2) RequestSpotInstances

func (ec2 *EC2) RequestSpotInstances(options *RequestSpotInstances) (resp *RequestSpotInstancesResp, err error)

RequestSpotInstances requests a new spot instances in EC2.

func (*EC2) RevokeSecurityGroup

func (ec2 *EC2) RevokeSecurityGroup(group SecurityGroup, perms []IPPerm) (resp *SimpleResp, err error)

RevokeSecurityGroup revokes permissions from a group.

See http://goo.gl/ZgdxA for more details.

func (*EC2) RevokeSecurityGroupEgress

func (ec2 *EC2) RevokeSecurityGroupEgress(group SecurityGroup, perms []IPPerm) (resp *SimpleResp, err error)

RevokeSecurityGroupEgress revokes egress permissions from a group

see http://goo.gl/Zv4wh8

func (*EC2) RunInstances

func (ec2 *EC2) RunInstances(options *RunInstancesOptions) (resp *RunInstancesResp, err error)

RunInstances starts new instances in EC2. If options.MinCount and options.MaxCount are both zero, a single instance will be started; otherwise if options.MaxCount is zero, options.MinCount will be used instead.

See http://goo.gl/Mcm3b for more details.

func (*EC2) SecurityGroups

func (ec2 *EC2) SecurityGroups(groups []SecurityGroup, filter *Filter) (resp *SecurityGroupsResp, err error)

SecurityGroups returns details about security groups in EC2. Both parameters are optional, and if provided will limit the security groups returned to those matching the given groups or filtering rules.

See http://goo.gl/k12Uy for more details.

func (*EC2) Snapshots

func (ec2 *EC2) Snapshots(ids []string, filter *Filter) (resp *SnapshotsResp, err error)

Snapshots returns details about volume snapshots available to the user. The ids and filter parameters, if provided, limit the snapshots returned.

See http://goo.gl/ogJL4 for more details.

func (*EC2) StartInstances

func (ec2 *EC2) StartInstances(ids ...string) (resp *StartInstanceResp, err error)

StartInstances starts an Amazon EBS-backed AMI that you've previously stopped.

See http://goo.gl/awKeF for more details.

func (*EC2) StopInstances

func (ec2 *EC2) StopInstances(ids ...string) (resp *StopInstanceResp, err error)

StopInstances requests stopping one or more Amazon EBS-backed instances.

See http://goo.gl/436dJ for more details.

func (*EC2) TerminateInstances

func (ec2 *EC2) TerminateInstances(instIds []string) (resp *TerminateInstancesResp, err error)

TerminateInstances requests the termination of instances when the given ids.

See http://goo.gl/3BKHj for more details.

func (*EC2) Volumes

func (ec2 *EC2) Volumes(volIds []string, filter *Filter) (resp *VolumesResp, err error)

Finds or lists all volumes.

type Error

type Error struct {
	// HTTP status code (200, 403, ...)
	StatusCode int
	// EC2 error code ("UnsupportedOperation", ...)
	Code string
	// The human-oriented error message
	Message   string
	RequestId string `xml:"RequestID"`
}

Error encapsulates an error returned by EC2.

See http://goo.gl/VZGuC for more details.

func (*Error) Error

func (err *Error) Error() string

type Filter

type Filter struct {
	// contains filtered or unexported fields
}

Filter builds filtering parameters to be used in an EC2 query which supports filtering. For example:

filter := NewFilter()
filter.Add("architecture", "i386")
filter.Add("launch-index", "0")
resp, err := ec2.Instances(nil, filter)

func NewFilter

func NewFilter() *Filter

NewFilter creates a new Filter.

func (*Filter) Add

func (f *Filter) Add(name string, value ...string)

Add appends a filtering parameter with the given name and value(s).

type IPPerm

type IPPerm struct {
	Protocol     string              `xml:"ipProtocol"`
	FromPort     int                 `xml:"fromPort"`
	ToPort       int                 `xml:"toPort"`
	SourceIPs    []string            `xml:"ipRanges>item>cidrIp"`
	SourceGroups []UserSecurityGroup `xml:"groups>item"`
}

IPPerm represents an allowance within an EC2 security group.

See http://goo.gl/4oTxv for more details.

type IamInstanceProfile

type IamInstanceProfile struct {
	ARN  string `xml:"arn"`
	Id   string `xml:"id"`
	Name string `xml:"name"`
}

IamInstanceProfile See http://goo.gl/PjyijL for more details

type Image

type Image struct {
	Id                 string               `xml:"imageId"`
	Name               string               `xml:"name"`
	Description        string               `xml:"description"`
	Type               string               `xml:"imageType"`
	State              string               `xml:"imageState"`
	Location           string               `xml:"imageLocation"`
	Public             bool                 `xml:"isPublic"`
	Architecture       string               `xml:"architecture"`
	Platform           string               `xml:"platform"`
	ProductCodes       []string             `xml:"productCode>item>productCode"`
	KernelId           string               `xml:"kernelId"`
	RamdiskId          string               `xml:"ramdiskId"`
	StateReason        string               `xml:"stateReason"`
	OwnerId            string               `xml:"imageOwnerId"`
	OwnerAlias         string               `xml:"imageOwnerAlias"`
	RootDeviceType     string               `xml:"rootDeviceType"`
	RootDeviceName     string               `xml:"rootDeviceName"`
	VirtualizationType string               `xml:"virtualizationType"`
	Hypervisor         string               `xml:"hypervisor"`
	BlockDevices       []BlockDeviceMapping `xml:"blockDeviceMapping>item"`
	Tags               []Tag                `xml:"tagSet>item"`
}

Image represents details about an image.

See http://goo.gl/iSqJG for more details.

type ImageAttributeResp

type ImageAttributeResp struct {
	RequestId    string               `xml:"requestId"`
	ImageId      string               `xml:"imageId"`
	Kernel       string               `xml:"kernel>value"`
	RamDisk      string               `xml:"ramdisk>value"`
	Description  string               `xml:"description>value"`
	Group        string               `xml:"launchPermission>item>group"`
	UserIds      []string             `xml:"launchPermission>item>userId"`
	ProductCodes []string             `xml:"productCodes>item>productCode"`
	BlockDevices []BlockDeviceMapping `xml:"blockDeviceMapping>item"`
}

Response to a DescribeImageAttribute request.

See http://goo.gl/bHO3zT for more details.

type ImagesResp

type ImagesResp struct {
	RequestId string  `xml:"requestId"`
	Images    []Image `xml:"imagesSet>item"`
}

Response to a DescribeImages request.

See http://goo.gl/hLnyg for more details.

type Instance

type Instance struct {

	// General instance information
	InstanceId         string              `xml:"instanceId"`                 // The ID of the instance launched
	InstanceType       string              `xml:"instanceType"`               // The instance type eg. m1.small | m1.medium | m1.large etc
	AvailabilityZone   string              `xml:"placement>availabilityZone"` // The Availability Zone the instance is located in
	Tags               []Tag               `xml:"tagSet>item"`                // Any tags assigned to the resource
	State              InstanceState       `xml:"instanceState"`              // The current state of the instance
	Reason             string              `xml:"reason"`                     // The reason for the most recent state transition. This might be an empty string
	StateReason        InstanceStateReason `xml:"stateReason"`                // The reason for the most recent state transition
	ImageId            string              `xml:"imageId"`                    // The ID of the AMI used to launch the instance
	KeyName            string              `xml:"keyName"`                    // The key pair name, if this instance was launched with an associated key pair
	Monitoring         string              `xml:"monitoring>state"`           // Valid values: disabled | enabled | pending
	IamInstanceProfile IamInstanceProfile  `xml:"iamInstanceProfile"`         // The IAM instance profile associated with the instance
	LaunchTime         string              `xml:"launchTime"`                 // The time the instance was launched
	OwnerId            string              // This isn't currently returned in the response, and is taken from the parent reservation

	// More specific information
	Architecture          string        `xml:"architecture"`          // Valid values: i386 | x86_64
	Hypervisor            string        `xml:"hypervisor"`            // Valid values: ovm | xen
	KernelId              string        `xml:"kernelId"`              // The kernel associated with this instance
	RamDiskId             string        `xml:"ramdiskId"`             // The RAM disk associated with this instance
	Platform              string        `xml:"platform"`              // The value is Windows for Windows AMIs; otherwise blank
	VirtualizationType    string        `xml:"virtualizationType"`    // Valid values: paravirtual | hvm
	AMILaunchIndex        int           `xml:"amiLaunchIndex"`        // The AMI launch index, which can be used to find this instance in the launch group
	PlacementGroupName    string        `xml:"placement>groupName"`   // The name of the placement group the instance is in (for cluster compute instances)
	Tenancy               string        `xml:"placement>tenancy"`     // (VPC only) Valid values: default | dedicated
	InstanceLifecycle     string        `xml:"instanceLifecycle"`     // Spot instance? Valid values: "spot" or blank
	SpotInstanceRequestId string        `xml:"spotInstanceRequestId"` // The ID of the Spot Instance request
	ClientToken           string        `xml:"clientToken"`           // The idempotency token you provided when you launched the instance
	ProductCodes          []ProductCode `xml:"productCodes>item"`     // The product codes attached to this instance

	// Storage
	RootDeviceType string        `xml:"rootDeviceType"`          // Valid values: ebs | instance-store
	RootDeviceName string        `xml:"rootDeviceName"`          // The root device name (for example, /dev/sda1)
	BlockDevices   []BlockDevice `xml:"blockDeviceMapping>item"` // Any block device mapping entries for the instance
	EbsOptimized   bool          `xml:"ebsOptimized"`            // Indicates whether the instance is optimized for Amazon EBS I/O

	// Network
	DNSName          string          `xml:"dnsName"`          // The public DNS name assigned to the instance. This element remains empty until the instance enters the running state
	PrivateDNSName   string          `xml:"privateDnsName"`   // The private DNS name assigned to the instance. This DNS name can only be used inside the Amazon EC2 network. This element remains empty until the instance enters the running state
	IPAddress        string          `xml:"ipAddress"`        // The public IP address assigned to the instance
	PrivateIPAddress string          `xml:"privateIpAddress"` // The private IP address assigned to the instance
	SubnetId         string          `xml:"subnetId"`         // The ID of the subnet in which the instance is running
	VpcId            string          `xml:"vpcId"`            // The ID of the VPC in which the instance is running
	SecurityGroups   []SecurityGroup `xml:"groupSet>item"`    // A list of the security groups for the instance

	// Advanced Networking
	NetworkInterfaces []InstanceNetworkInterface `xml:"networkInterfaceSet>item"` // (VPC) One or more network interfaces for the instance
	SourceDestCheck   bool                       `xml:"sourceDestCheck"`          // Controls whether source/destination checking is enabled on the instance
	SriovNetSupport   string                     `xml:"sriovNetSupport"`          // Specifies whether enhanced networking is enabled. Valid values: simple
}

Instance encapsulates a running instance in EC2.

See http://goo.gl/OCH8a for more details.

func (Instance) IsSpotInstance

func (i Instance) IsSpotInstance() bool

isSpotInstance returns if the instance is a spot instance

type InstanceNetworkInterface

type InstanceNetworkInterface struct {
	Id                 string                              `xml:"networkInterfaceId"`
	Description        string                              `xml:"description"`
	SubnetId           string                              `xml:"subnetId"`
	VpcId              string                              `xml:"vpcId"`
	OwnerId            string                              `xml:"ownerId"` // The ID of the AWS account that created the network interface.
	Status             string                              `xml:"status"`  // Valid values: available | attaching | in-use | detaching
	MacAddress         string                              `xml:"macAddress"`
	PrivateIPAddress   string                              `xml:"privateIpAddress"`
	PrivateDNSName     string                              `xml:"privateDnsName"`
	SourceDestCheck    bool                                `xml:"sourceDestCheck"`
	SecurityGroups     []SecurityGroup                     `xml:"groupSet>item"`
	Attachment         InstanceNetworkInterfaceAttachment  `xml:"attachment"`
	Association        InstanceNetworkInterfaceAssociation `xml:"association"`
	PrivateIPAddresses []InstancePrivateIpAddress          `xml:"privateIpAddressesSet>item"`
}

InstanceNetworkInterface represents a network interface attached to an instance See http://goo.gl/9eW02N for more details.

type InstanceNetworkInterfaceAssociation

type InstanceNetworkInterfaceAssociation struct {
	PublicIP      string `xml:"publicIp"`      // The address of the Elastic IP address bound to the network interface
	PublicDNSName string `xml:"publicDnsName"` // The public DNS name
	IPOwnerId     string `xml:"ipOwnerId"`     // The ID of the owner of the Elastic IP address
}

Describes association information for an Elastic IP address. See http://goo.gl/YCDdMe for more details

type InstanceNetworkInterfaceAttachment

type InstanceNetworkInterfaceAttachment struct {
	AttachmentID        string `xml:"attachmentID"`        // The ID of the network interface attachment.
	DeviceIndex         int32  `xml:"deviceIndex"`         // The index of the device on the instance for the network interface attachment.
	Status              string `xml:"status"`              // Valid values: attaching | attached | detaching | detached
	AttachTime          string `xml:"attachTime"`          // Time attached, as a Datetime
	DeleteOnTermination bool   `xml:"deleteOnTermination"` // Indicates whether the network interface is deleted when the instance is terminated.
}

InstanceNetworkInterfaceAttachment describes a network interface attachment to an instance See http://goo.gl/0ql0Cg for more details

type InstancePrivateIpAddress

type InstancePrivateIpAddress struct {
	PrivateIPAddress string                              `xml:"privateIpAddress"` // The private IP address of the network interface
	PrivateDNSName   string                              `xml:"privateDnsName"`   // The private DNS name
	Primary          bool                                `xml:"primary"`          // Indicates whether this IP address is the primary private IP address of the network interface
	Association      InstanceNetworkInterfaceAssociation `xml:"association"`      // The association information for an Elastic IP address for the network interface
}

InstancePrivateIpAddress describes a private IP address See http://goo.gl/irN646 for more details

type InstanceState

type InstanceState struct {
	Code int    `xml:"code"` // Watch out, bits 15-8 have unpublished meaning.
	Name string `xml:"name"`
}

InstanceState encapsulates the state of an instance in EC2.

See http://goo.gl/y3ZBq for more details.

type InstanceStateChange

type InstanceStateChange struct {
	InstanceId    string        `xml:"instanceId"`
	CurrentState  InstanceState `xml:"currentState"`
	PreviousState InstanceState `xml:"previousState"`
}

InstanceStateChange informs of the previous and current states for an instance when a state change is requested.

type InstanceStateReason

type InstanceStateReason struct {
	Code    string `xml:"code"`
	Message string `xml:"message"`
}

InstanceStateReason describes a state change for an instance in EC2

See http://goo.gl/KZkbXi for more details

type InstanceStatus

type InstanceStatus struct {
	Status  string                `xml:"status"`  // The instance status.
	Details InstanceStatusDetails `xml:"details"` // The system instance health or application instance health.
}

InstanceStatus describes the status of an instance with details.

See http://goo.gl/eFch4S for more details.

type InstanceStatusDetails

type InstanceStatusDetails struct {
	Name          string `xml:"name"`          // The type of instance status.
	Status        string `xml:"status"`        // The status.
	ImpairedSince string `xml:"impairedSince"` // The time when a status check failed. For an instance that was launched and impaired, this is the time when the instance was launched.
}

InstanceStatusDetails describes the instance status with the cause and more detail.

See http://goo.gl/3qoMC4 for more details.

type InstanceStatusEvent

type InstanceStatusEvent struct {
	Code        string `xml:"code"`        // The associated code of the event.
	Description string `xml:"description"` // A description of the event.
	NotBefore   string `xml:"notBefore"`   // The earliest scheduled start time for the event.
	NotAfter    string `xml:"notAfter"`    // The latest scheduled end time for the event.
}

InstanceStatusEvent describes an instance event.

See http://goo.gl/PXsDTn for more details.

type InstanceStatusItem

type InstanceStatusItem struct {
	InstanceId       string                `xml:"instanceId"`
	AvailabilityZone string                `xml:"availabilityZone"`
	Events           []InstanceStatusEvent `xml:"eventsSet>item"` // Extra information regarding events associated with the instance.
	InstanceState    InstanceState         `xml:"instanceState"`  // The intended state of the instance. Calls to DescribeInstanceStatus require that an instance be in the running state.
	SystemStatus     InstanceStatus        `xml:"systemStatus"`
	InstanceStatus   InstanceStatus        `xml:"instanceStatus"`
}

InstanceStatusItem describes the instance status, cause, details, and potential actions to take in response.

See http://goo.gl/oImFZZ for more details.

type ModifyImageAttribute

type ModifyImageAttribute struct {
	AddUsers     []string
	RemoveUsers  []string
	AddGroups    []string
	RemoveGroups []string
	ProductCodes []string
	Description  string
}

The ModifyImageAttribute request parameters.

type ModifyInstance

type ModifyInstance struct {
	InstanceType          string
	BlockDevices          []BlockDeviceMapping
	DisableAPITermination bool
	EbsOptimized          bool
	SecurityGroups        []SecurityGroup
	ShutdownBehavior      string
	KernelId              string
	RamdiskId             string
	SourceDestCheck       bool
	SriovNetSupport       bool
	UserData              []byte
}

The ModifyInstanceAttribute request parameters.

type ModifyInstanceResp

type ModifyInstanceResp struct {
	RequestId string `xml:"requestId"`
	Return    bool   `xml:"return"`
}

Response to a ModifyInstanceAttribute request.

http://goo.gl/icuXh5 for more details.

type ProductCode

type ProductCode struct {
	ProductCode string `xml:"productCode"` // The product code
	Type        string `xml:"type"`        // Valid values: devpay | marketplace
}

ProductCode represents a product code See http://goo.gl/hswmQm for more details.

type PropagatingVgw

type PropagatingVgw struct {
	GatewayId string `xml:"gatewayID"`
}

PropagatingVgw describes a virtual private gateway propagating route.

See http://goo.gl/myGQtG for more details.

type RecurringCharge

type RecurringCharge struct {
	Frequency string  `xml:"frequency"`
	Amount    float32 `xml:"amount"`
}

See

type RegisterImage

type RegisterImage struct {
	ImageLocation  string
	Name           string
	Description    string
	Architecture   string
	KernelId       string
	RamdiskId      string
	RootDeviceName string
	VirtType       string
	BlockDevices   []BlockDeviceMapping
}

The RegisterImage request parameters.

type RegisterImageResp

type RegisterImageResp struct {
	RequestId string `xml:"requestId"`
	ImageId   string `xml:"imageId"`
}

Response to a RegisterImage request.

type ReleaseAddressResp

type ReleaseAddressResp struct {
	RequestId string `xml:"requestId"`
	Return    bool   `xml:"return"`
}

Response to a ReleaseAddress request

See http://goo.gl/Ciw2Z8 for more details

type ReplaceRouteTableAssociationResp

type ReplaceRouteTableAssociationResp struct {
	RequestId        string `xml:"requestId"`
	NewAssociationId string `xml:"newAssociationId"`
}

ReplaceRouteTableAssociationResp represents a response from a ReplaceRouteTableAssociation call

See http://goo.gl/VhILGe for more details.

type RequestSpotInstances

type RequestSpotInstances struct {
	SpotPrice                string
	InstanceCount            int
	Type                     string
	ImageId                  string
	KeyName                  string
	InstanceType             string
	SecurityGroups           []SecurityGroup
	IamInstanceProfile       string
	KernelId                 string
	RamdiskId                string
	UserData                 []byte
	AvailZone                string
	PlacementGroupName       string
	Monitoring               bool
	SubnetId                 string
	AssociatePublicIpAddress bool
	PrivateIPAddress         string
	BlockDevices             []BlockDeviceMapping
}

The RequestSpotInstances type encapsulates options for the respective request in EC2.

See http://goo.gl/GRZgCD for more details.

type RequestSpotInstancesResp

type RequestSpotInstancesResp struct {
	RequestId          string              `xml:"requestId"`
	SpotRequestResults []SpotRequestResult `xml:"spotInstanceRequestSet>item"`
}

Response to a RequestSpotInstances request.

See http://goo.gl/GRZgCD for more details.

type Reservation

type Reservation struct {
	ReservationId  string          `xml:"reservationId"`
	OwnerId        string          `xml:"ownerId"`
	RequesterId    string          `xml:"requesterId"`
	SecurityGroups []SecurityGroup `xml:"groupSet>item"`
	Instances      []Instance      `xml:"instancesSet>item"`
}

Reservation represents details about a reservation in EC2.

See http://goo.gl/0ItPT for more details.

type ReservedInstancesResponseItem

type ReservedInstancesResponseItem struct {
	ReservedInstanceId string            `xml:"reservedInstancesId"`
	InstanceType       string            `xml:"instanceType"`
	AvailabilityZone   string            `xml:"availabilityZone"`
	Start              string            `xml:"start"`
	Duration           uint64            `xml:"duration"`
	End                string            `xml:"end"`
	FixedPrice         float32           `xml:"fixedPrice"`
	UsagePrice         float32           `xml:"usagePrice"`
	InstanceCount      int               `xml:"instanceCount"`
	ProductDescription string            `xml:"productDescription"`
	State              string            `xml:"state"`
	Tags               []Tag             `xml:"tagSet->item"`
	InstanceTenancy    string            `xml:"instanceTenancy"`
	CurrencyCode       string            `xml:"currencyCode"`
	OfferingType       string            `xml:"offeringType"`
	RecurringCharges   []RecurringCharge `xml:"recurringCharges>item"`
}

See

type Route

type Route struct {
	DestinationCidrBlock   string `xml:"destinationCidrBlock"`   // The CIDR block used for the destination match.
	GatewayId              string `xml:"gatewayId"`              // The ID of a gateway attached to your VPC.
	InstanceId             string `xml:"instanceId"`             // The ID of a NAT instance in your VPC.
	InstanceOwnerId        string `xml:"instanceOwnerId"`        // The AWS account ID of the owner of the instance.
	NetworkInterfaceId     string `xml:"networkInterfaceId"`     // The ID of the network interface.
	State                  string `xml:"state"`                  // The state of the route. Valid values: active | blackhole
	Origin                 string `xml:"origin"`                 // Describes how the route was created. Valid values: Valid values: CreateRouteTable | CreateRoute | EnableVgwRoutePropagation
	VpcPeeringConnectionId string `xml:"vpcPeeringConnectionId"` // The ID of the VPC peering connection.
}

Route describes a route in a route table.

See http://goo.gl/hE5Kxe for more details.

type RouteTable

type RouteTable struct {
	Id              string                  `xml:"routeTableId"`
	VpcId           string                  `xml:"vpcId"`
	Routes          []Route                 `xml:"routeSet>item"`
	Associations    []RouteTableAssociation `xml:"associationSet>item"`
	PropagatingVgws []PropagatingVgw        `xml:"propagatingVgwSet>item"`
	Tags            []Tag                   `xml:"tagSet>item"`
}

RouteTable describes a route table which contains a set of rules, called routes that are used to determine where network traffic is directed.

See http://goo.gl/bI9hkg for more details.

type RouteTableAssociation

type RouteTableAssociation struct {
	Id           string `xml:"routeTableAssociationId"` // The ID of the association between a route table and a subnet.
	RouteTableId string `xml:"routeTableId"`            // The ID of the route table.
	SubnetId     string `xml:"subnetId"`                // The ID of the subnet.
	Main         bool   `xml:"main"`                    // Indicates whether this is the main route table.
}

RouteTableAssociation describes an association between a route table and a subnet.

See http://goo.gl/BZB8o8 for more details.

type RunInstancesOptions

type RunInstancesOptions struct {
	ImageId                  string
	MinCount                 int
	MaxCount                 int
	KeyName                  string
	InstanceType             string
	SecurityGroups           []SecurityGroup
	KernelId                 string
	RamdiskId                string
	UserData                 []byte
	AvailabilityZone         string
	PlacementGroupName       string
	Tenancy                  string
	Monitoring               bool
	SubnetId                 string
	DisableAPITermination    bool
	ShutdownBehavior         string
	PrivateIPAddress         string
	IamInstanceProfile       IamInstanceProfile
	BlockDevices             []BlockDeviceMapping
	EbsOptimized             bool
	AssociatePublicIpAddress bool
}

RunInstancesOptions encapsulates options for the respective request in EC2.

See http://goo.gl/Mcm3b for more details.

type RunInstancesResp

type RunInstancesResp struct {
	RequestId      string          `xml:"requestId"`
	ReservationId  string          `xml:"reservationId"`
	OwnerId        string          `xml:"ownerId"`
	SecurityGroups []SecurityGroup `xml:"groupSet>item"`
	Instances      []Instance      `xml:"instancesSet>item"`
}

Response to a RunInstances request.

See http://goo.gl/Mcm3b for more details.

type SecurityGroup

type SecurityGroup struct {
	Id          string `xml:"groupId"`
	Name        string `xml:"groupName"`
	Description string `xml:"groupDescription"`
	VpcId       string `xml:"vpcId"`
}

SecurityGroup represents an EC2 security group. If SecurityGroup is used as a parameter, then one of Id or Name may be empty. If both are set, then Id is used.

func SecurityGroupIds

func SecurityGroupIds(ids ...string) []SecurityGroup

SecurityGroupNames is a convenience function that returns a slice of security groups with the given ids.

func SecurityGroupNames

func SecurityGroupNames(names ...string) []SecurityGroup

SecurityGroupNames is a convenience function that returns a slice of security groups with the given names.

type SecurityGroupInfo

type SecurityGroupInfo struct {
	SecurityGroup
	OwnerId       string   `xml:"ownerId"`
	Description   string   `xml:"groupDescription"`
	IPPerms       []IPPerm `xml:"ipPermissions>item"`
	IPPermsEgress []IPPerm `xml:"ipPermissionsEgress>item"`
}

SecurityGroup encapsulates details for a security group in EC2.

See http://goo.gl/CIdyP for more details.

type SecurityGroupsResp

type SecurityGroupsResp struct {
	RequestId string              `xml:"requestId"`
	Groups    []SecurityGroupInfo `xml:"securityGroupInfo>item"`
}

SecurityGroupsResp represents a response to a DescribeSecurityGroups request in EC2.

See http://goo.gl/k12Uy for more details.

type SimpleResp

type SimpleResp struct {
	XMLName   xml.Name
	RequestId string `xml:"requestId"`
}

SimpleResp represents a response to an EC2 request which on success will return no other information besides a request id.

type Snapshot

type Snapshot struct {
	Id          string `xml:"snapshotId"`
	VolumeId    string `xml:"volumeId"`
	VolumeSize  string `xml:"volumeSize"`
	Status      string `xml:"status"`
	StartTime   string `xml:"startTime"`
	Description string `xml:"description"`
	Progress    string `xml:"progress"`
	OwnerId     string `xml:"ownerId"`
	OwnerAlias  string `xml:"ownerAlias"`
	Tags        []Tag  `xml:"tagSet>item"`
}

Snapshot represents details about a volume snapshot.

See http://goo.gl/nkovs for more details.

type SnapshotsResp

type SnapshotsResp struct {
	RequestId string     `xml:"requestId"`
	Snapshots []Snapshot `xml:"snapshotSet>item"`
}

Response to a DescribeSnapshots request.

See http://goo.gl/nClDT for more details.

type SpotInstanceSpec

type SpotInstanceSpec struct {
	ImageId                  string
	KeyName                  string
	InstanceType             string
	SecurityGroups           []SecurityGroup
	IamInstanceProfile       string
	KernelId                 string
	RamdiskId                string
	UserData                 []byte
	AvailZone                string
	PlacementGroupName       string
	Monitoring               bool
	SubnetId                 string
	AssociatePublicIpAddress bool
	PrivateIPAddress         string
	BlockDevices             []BlockDeviceMapping
}

type SpotLaunchSpec

type SpotLaunchSpec struct {
	ImageId            string               `xml:"imageId"`
	KeyName            string               `xml:"keyName"`
	InstanceType       string               `xml:"instanceType"`
	SecurityGroups     []SecurityGroup      `xml:"groupSet>item"`
	IamInstanceProfile string               `xml:"iamInstanceProfile"`
	KernelId           string               `xml:"kernelId"`
	RamdiskId          string               `xml:"ramdiskId"`
	PlacementGroupName string               `xml:"placement>groupName"`
	Monitoring         bool                 `xml:"monitoring>enabled"`
	SubnetId           string               `xml:"subnetId"`
	BlockDevices       []BlockDeviceMapping `xml:"blockDeviceMapping>item"`
}

type SpotRequestResult

type SpotRequestResult struct {
	SpotRequestId  string         `xml:"spotInstanceRequestId"`
	SpotPrice      string         `xml:"spotPrice"`
	Type           string         `xml:"type"`
	AvailZone      string         `xml:"launchedAvailabilityZone"`
	InstanceId     string         `xml:"instanceId"`
	State          string         `xml:"state"`
	SpotLaunchSpec SpotLaunchSpec `xml:"launchSpecification"`
	CreateTime     string         `xml:"createTime"`
	Tags           []Tag          `xml:"tagSet>item"`
}

type SpotRequestsResp

type SpotRequestsResp struct {
	RequestId          string              `xml:"requestId"`
	SpotRequestResults []SpotRequestResult `xml:"spotInstanceRequestSet>item"`
}

Response to a DescribeSpotInstanceRequests request.

See http://goo.gl/KsKJJk for more details.

type StartInstanceResp

type StartInstanceResp struct {
	RequestId    string                `xml:"requestId"`
	StateChanges []InstanceStateChange `xml:"instancesSet>item"`
}

Response to a StartInstances request.

See http://goo.gl/awKeF for more details.

type StopInstanceResp

type StopInstanceResp struct {
	RequestId    string                `xml:"requestId"`
	StateChanges []InstanceStateChange `xml:"instancesSet>item"`
}

Response to a StopInstances request.

See http://goo.gl/436dJ for more details.

type Tag

type Tag struct {
	Key   string `xml:"key"`
	Value string `xml:"value"`
}

ResourceTag represents key-value metadata used to classify and organize EC2 instances.

See http://goo.gl/bncl3 for more details

type TerminateInstancesResp

type TerminateInstancesResp struct {
	RequestId    string                `xml:"requestId"`
	StateChanges []InstanceStateChange `xml:"instancesSet>item"`
}

Response to a TerminateInstances request.

See http://goo.gl/3BKHj for more details.

type UserSecurityGroup

type UserSecurityGroup struct {
	Id      string `xml:"groupId"`
	Name    string `xml:"groupName"`
	OwnerId string `xml:"userId"`
}

UserSecurityGroup holds a security group and the owner of that group.

type VPC

type VPC struct {
	CidrBlock       string `xml:"cidrBlock"`
	DHCPOptionsID   string `xml:"dhcpOptionsId"`
	State           string `xml:"state"`
	VpcId           string `xml:"vpcId"`
	InstanceTenancy string `xml:"instanceTenancy"`
	IsDefault       bool   `xml:"isDefault"`
	Tags            []Tag  `xml:"tagSet>item"`
}

VPC describes a VPC.

See http://goo.gl/WjX0Es for more details.

type Volume

type Volume struct {
	VolumeId    string             `xml:"volumeId"`
	Size        string             `xml:"size"`
	SnapshotId  string             `xml:"snapshotId"`
	AvailZone   string             `xml:"availabilityZone"`
	Status      string             `xml:"status"`
	Attachments []VolumeAttachment `xml:"attachmentSet>item"`
	VolumeType  string             `xml:"volumeType"`
	IOPS        int64              `xml:"iops"`
	Tags        []Tag              `xml:"tagSet>item"`
}

Volume is a single volume.

type VolumeAttachment

type VolumeAttachment struct {
	VolumeId   string `xml:"volumeId"`
	InstanceId string `xml:"instanceId"`
	Device     string `xml:"device"`
	Status     string `xml:"status"`
}

type VolumesResp

type VolumesResp struct {
	RequestId string   `xml:"requestId"`
	Volumes   []Volume `xml:"volumeSet>item"`
}

Response to a DescribeVolumes request

Directories

Path Synopsis
The ec2test package implements a fake EC2 provider with the capability of inducing errors on any given operation, and retrospectively determining what operations have been carried out.
The ec2test package implements a fake EC2 provider with the capability of inducing errors on any given operation, and retrospectively determining what operations have been carried out.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL