Help us shape the future of Go! Take the 2026 Go Developer Survey

ec2

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 38 Imported by: 0

Documentation

Overview

Package ec2 emulates Amazon EC2 over the EC2 Query protocol: regions and zones, a default VPC per region (subnets, security group, internet gateway, main route table and network ACL), VPCs, subnets, security groups and rules, tags, key pairs, an AMI catalog, instances (containers when an engine runs, see instances.go) with their metadata service (imds.go), launch templates, EBS volumes and instance types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Acl

type Acl struct {
	NetworkAclId string     `xml:"networkAclId"`
	VpcId        string     `xml:"vpcId"`
	IsDefault    bool       `xml:"default"`
	OwnerId      string     `xml:"ownerId"`
	Entries      []aclEntry `xml:"entrySet>item"`
	Associations []aclAssoc `xml:"associationSet>item"`
	TagSet       []Tag      `xml:"tagSet>item" json:"-"`
}

Acl is a network ACL.

type Address

type Address struct {
	AllocationId            string `xml:"allocationId"`
	PublicIp                string `xml:"publicIp"`
	Domain                  string `xml:"domain"`
	PublicIpv4Pool          string `xml:"publicIpv4Pool"`
	NetworkBorderGroup      string `xml:"networkBorderGroup"`
	AssociationId           string `xml:"associationId,omitempty"`
	InstanceId              string `xml:"instanceId,omitempty"`
	NetworkInterfaceId      string `xml:"networkInterfaceId,omitempty"`
	NetworkInterfaceOwnerId string `xml:"networkInterfaceOwnerId,omitempty"`
	PrivateIpAddress        string `xml:"privateIpAddress,omitempty"`
	TagSet                  []Tag  `xml:"tagSet>item" json:"-"`
}

Address is an Elastic IP.

type BlockDevice

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

BlockDevice is an EBS volume of an instance.

type CpuOptions

type CpuOptions struct {
	CoreCount      int `xml:"coreCount"`
	ThreadsPerCore int `xml:"threadsPerCore"`
}

CpuOptions are an instance's cores and threads.

type DhcpOptions

type DhcpOptions struct {
	DhcpOptionsId string       `xml:"dhcpOptionsId"`
	OwnerId       string       `xml:"ownerId"`
	Configuration []dhcpConfig `xml:"dhcpConfigurationSet>item"`
	TagSet        []Tag        `xml:"tagSet>item" json:"-"`
}

DhcpOptions is a DHCP options set.

type EbsDevice

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

EbsDevice is a volume's attachment as an instance shows it.

type EgressGateway

type EgressGateway struct {
	EgressOnlyInternetGatewayId string       `xml:"egressOnlyInternetGatewayId"`
	Attachments                 []attachment `xml:"attachmentSet>item"`
	TagSet                      []Tag        `xml:"tagSet>item" json:"-"`
}

EgressGateway is an egress-only internet gateway.

type FlowLog

type FlowLog struct {
	CreationTime             string           `xml:"creationTime"`
	DeliverLogsPermissionArn string           `xml:"deliverLogsPermissionArn,omitempty"`
	DeliverLogsStatus        string           `xml:"deliverLogsStatus"`
	FlowLogId                string           `xml:"flowLogId"`
	FlowLogStatus            string           `xml:"flowLogStatus"`
	LogGroupName             string           `xml:"logGroupName,omitempty"`
	ResourceId               string           `xml:"resourceId"`
	TrafficType              string           `xml:"trafficType"`
	LogDestinationType       string           `xml:"logDestinationType"`
	LogDestination           string           `xml:"logDestination,omitempty"`
	LogFormat                string           `xml:"logFormat"`
	TagSet                   []Tag            `xml:"tagSet>item" json:"-"`
	MaxAggregationInterval   int              `xml:"maxAggregationInterval"`
	DestinationOptions       *flowDestOptions `xml:"destinationOptions"`
}

FlowLog is a flow log.

type Gateway

type Gateway struct {
	InternetGatewayId string       `xml:"internetGatewayId"`
	OwnerId           string       `xml:"ownerId"`
	Attachments       []attachment `xml:"attachmentSet>item"`
	TagSet            []Tag        `xml:"tagSet>item" json:"-"`
}

Gateway is an internet gateway.

type Group

type Group struct {
	OwnerId             string `xml:"ownerId"`
	GroupId             string `xml:"groupId"`
	GroupName           string `xml:"groupName"`
	Description         string `xml:"groupDescription"`
	VpcId               string `xml:"vpcId"`
	SecurityGroupArn    string `xml:"securityGroupArn"`
	IpPermissions       []perm `xml:"ipPermissions>item"`
	IpPermissionsEgress []perm `xml:"ipPermissionsEgress>item"`
	TagSet              []Tag  `xml:"tagSet>item" json:"-"`
}

Group is a security group; rules are stored one source per rule and grouped by protocol and ports on output, as EC2 lists them.

type GroupIdentifier

type GroupIdentifier struct {
	GroupId   string `xml:"groupId"`
	GroupName string `xml:"groupName"`
}

GroupIdentifier is a security group of an instance.

type Header struct {
	RequestID string `xml:"requestId"`
}

Header is embedded first in every output, so responses read <OpResponse xmlns=…><requestId>…</requestId>…; EC2 does not wrap results in <OpResult> like plain Query does.

type Host

type Host struct {
	HostId             string         `xml:"hostId"`
	AvailabilityZone   string         `xml:"availabilityZone"`
	AvailabilityZoneId string         `xml:"availabilityZoneId"`
	AutoPlacement      string         `xml:"autoPlacement"`
	HostRecovery       string         `xml:"hostRecovery"`
	HostMaintenance    string         `xml:"hostMaintenance"`
	State              string         `xml:"state"`
	AllocationTime     string         `xml:"allocationTime"`
	ReleaseTime        string         `xml:"releaseTime,omitempty"`
	OwnerId            string         `xml:"ownerId"`
	HostProperties     hostProperties `xml:"hostProperties"`
	Instances          []struct{}     `xml:"instances>item"`
	AvailableCapacity  struct {
		AvailableVCpus int `xml:"availableVCpus"`
	} `xml:"availableCapacity"`
	TagSet []Tag `xml:"tagSet>item" json:"-"`
}

Host is a dedicated host. ponytail: every host is a two-socket, 96 vCPU machine whatever its family.

type IipAssociation

type IipAssociation struct {
	AssociationId      string     `xml:"associationId"`
	InstanceId         string     `xml:"instanceId"`
	IamInstanceProfile ProfileRef `xml:"iamInstanceProfile"`
	State              string     `xml:"state"`
	Timestamp          string     `xml:"timestamp"`
}

IipAssociation links an instance to its IAM instance profile.

type Image

type Image struct {
	ImageId             string        `xml:"imageId"`
	ImageLocation       string        `xml:"imageLocation"`
	ImageState          string        `xml:"imageState"`
	ImageOwnerId        string        `xml:"imageOwnerId"`
	CreationDate        string        `xml:"creationDate"`
	IsPublic            bool          `xml:"isPublic"`
	Architecture        string        `xml:"architecture"`
	ImageType           string        `xml:"imageType"`
	ImageOwnerAlias     string        `xml:"imageOwnerAlias,omitempty"`
	Name                string        `xml:"name"`
	Description         string        `xml:"description"`
	RootDeviceType      string        `xml:"rootDeviceType"`
	RootDeviceName      string        `xml:"rootDeviceName"`
	VirtualizationType  string        `xml:"virtualizationType"`
	Hypervisor          string        `xml:"hypervisor"`
	EnaSupport          bool          `xml:"enaSupport"`
	PlatformDetails     string        `xml:"platformDetails"`
	UsageOperation      string        `xml:"usageOperation"`
	TagSet              []Tag         `xml:"tagSet>item"`
	BlockDeviceMappings []ImageDevice `xml:"blockDeviceMapping>item"`
	Docker              string        `xml:"-"` // the container image its instances run
	Keyword             string        `xml:"-"` // finds it in resolve:ssm: image ids
}

Image is an AMI.

type ImageDevice

type ImageDevice struct {
	DeviceName string `xml:"deviceName"`
	Ebs        struct {
		DeleteOnTermination bool   `xml:"deleteOnTermination"`
		VolumeSize          int    `xml:"volumeSize"`
		VolumeType          string `xml:"volumeType"`
		Encrypted           bool   `xml:"encrypted"`
	} `xml:"ebs"`
}

ImageDevice is a block device of an image. A created image keeps no snapshots: pogi has none, so its devices show size and type only.

type Instance

type Instance struct {
	InstanceId            string            `xml:"instanceId"`
	ImageId               string            `xml:"imageId"`
	State                 InstanceState     `xml:"instanceState"`
	PrivateDnsName        string            `xml:"privateDnsName"`
	PublicDnsName         string            `xml:"dnsName"`
	StateTransitionReason string            `xml:"reason"`
	KeyName               string            `xml:"keyName,omitempty"`
	AmiLaunchIndex        int               `xml:"amiLaunchIndex"`
	InstanceType          string            `xml:"instanceType"`
	LaunchTime            string            `xml:"launchTime"`
	Placement             Placement         `xml:"placement"`
	Monitoring            Monitoring        `xml:"monitoring"`
	SubnetId              string            `xml:"subnetId"`
	VpcId                 string            `xml:"vpcId"`
	PrivateIpAddress      string            `xml:"privateIpAddress"`
	PublicIpAddress       string            `xml:"ipAddress,omitempty"`
	SourceDestCheck       bool              `xml:"sourceDestCheck"`
	SecurityGroups        []GroupIdentifier `xml:"groupSet>item"`
	StateReason           *StateReason      `xml:"stateReason"`
	Architecture          string            `xml:"architecture"`
	RootDeviceType        string            `xml:"rootDeviceType"`
	RootDeviceName        string            `xml:"rootDeviceName"`
	BlockDeviceMappings   []BlockDevice     `xml:"blockDeviceMapping>item"`
	VirtualizationType    string            `xml:"virtualizationType"`
	ClientToken           string            `xml:"clientToken,omitempty"`
	TagSet                []Tag             `xml:"tagSet>item" json:"-"`
	Hypervisor            string            `xml:"hypervisor"`
	IamInstanceProfile    *ProfileRef       `xml:"iamInstanceProfile"`
	EbsOptimized          bool              `xml:"ebsOptimized"`
	EnaSupport            bool              `xml:"enaSupport"`
	CpuOptions            CpuOptions        `xml:"cpuOptions"`
	MetadataOptions       MetadataOptions   `xml:"metadataOptions"`
	PlatformDetails       string            `xml:"platformDetails"`
	UsageOperation        string            `xml:"usageOperation"`
	NetworkInterfaces     []InstanceNic     `xml:"networkInterfaceSet>item" json:"-"` // made when described, see nics

	ReservationId         string    `xml:"-"`
	UserData              string    `xml:"-"` // base64, as given
	DisableApiTermination bool      `xml:"-"`
	DisableApiStop        bool      `xml:"-"`
	ShutdownBehavior      string    `xml:"-"`
	CpuCredits            string    `xml:"-"`
	Role                  string    `xml:"-"` // of the instance profile: IMDS hands out its credentials
	Container             string    `xml:"-"` // empty: metadata only
	Ports                 []int     `xml:"-"` // container ports published on 127.0.0.1
	Ended                 time.Time `xml:"-"`
}

Instance is an instance in its wire shape, then pogi's own fields.

type InstanceNic

type InstanceNic struct {
	NetworkInterfaceId string            `xml:"networkInterfaceId"`
	SubnetId           string            `xml:"subnetId"`
	VpcId              string            `xml:"vpcId"`
	Description        string            `xml:"description"`
	Status             string            `xml:"status"`
	MacAddress         string            `xml:"macAddress"`
	PrivateIpAddress   string            `xml:"privateIpAddress"`
	PrivateDnsName     string            `xml:"privateDnsName"`
	SourceDestCheck    bool              `xml:"sourceDestCheck"`
	Groups             []GroupIdentifier `xml:"groupSet>item"`
	Attachment         struct {
		AttachmentId        string `xml:"attachmentId"`
		DeviceIndex         int    `xml:"deviceIndex"`
		Status              string `xml:"status"`
		AttachTime          string `xml:"attachTime"`
		DeleteOnTermination bool   `xml:"deleteOnTermination"`
	} `xml:"attachment"`
	PrivateIpAddresses []struct {
		PrivateIpAddress string `xml:"privateIpAddress"`
		PrivateDnsName   string `xml:"privateDnsName"`
		Primary          bool   `xml:"primary"`
	} `xml:"privateIpAddressesSet>item"`
	InterfaceType string `xml:"interfaceType"`
}

InstanceNic is the primary network interface of an instance.

type InstanceState

type InstanceState struct {
	Code int    `xml:"code"`
	Name string `xml:"name"`
}

InstanceState is an instance state with its code.

type KeyPair

type KeyPair struct {
	KeyPairId      string `xml:"keyPairId"`
	KeyName        string `xml:"keyName"`
	KeyFingerprint string `xml:"keyFingerprint"`
	KeyType        string `xml:"keyType"`
	CreateTime     string `xml:"createTime"`
	PublicKey      string `xml:"publicKey,omitempty"`
	TagSet         []Tag  `xml:"tagSet>item" json:"-"`
}

KeyPair is a key pair; PublicKey is what an instance with this key lets in over ssh.

type LaunchTemplate

type LaunchTemplate struct {
	LaunchTemplateId     string             `xml:"launchTemplateId"`
	LaunchTemplateName   string             `xml:"launchTemplateName"`
	CreateTime           string             `xml:"createTime"`
	CreatedBy            string             `xml:"createdBy"`
	DefaultVersionNumber int                `xml:"defaultVersionNumber"`
	LatestVersionNumber  int                `xml:"latestVersionNumber"`
	TagSet               []Tag              `xml:"tagSet>item" json:"-"`
	Versions             []*TemplateVersion `xml:"-"`
}

LaunchTemplate is a launch template and its versions.

type MetadataOptions

type MetadataOptions struct {
	State                   string `xml:"state"`
	HttpTokens              string `xml:"httpTokens"`
	HttpPutResponseHopLimit int    `xml:"httpPutResponseHopLimit"`
	HttpEndpoint            string `xml:"httpEndpoint"`
	HttpProtocolIpv6        string `xml:"httpProtocolIpv6"`
	InstanceMetadataTags    string `xml:"instanceMetadataTags"`
}

MetadataOptions configure an instance's metadata service.

type Monitoring

type Monitoring struct {
	State string `xml:"state"`
}

Monitoring says whether detailed monitoring is on.

type NatGateway

type NatGateway struct {
	CreateTime          string       `xml:"createTime"`
	DeleteTime          string       `xml:"deleteTime,omitempty"`
	NatGatewayAddresses []natAddress `xml:"natGatewayAddressSet>item"`
	NatGatewayId        string       `xml:"natGatewayId"`
	State               string       `xml:"state"`
	SubnetId            string       `xml:"subnetId"`
	VpcId               string       `xml:"vpcId"`
	TagSet              []Tag        `xml:"tagSet>item" json:"-"`
	ConnectivityType    string       `xml:"connectivityType"`
	ClientToken         string       `xml:"-"`
}

NatGateway is a NAT gateway.

type NetworkInterface

type NetworkInterface struct {
	Association        *eniAssociation   `xml:"association" json:"-"`
	Attachment         *eniAttachment    `xml:"attachment" json:"-"`
	AvailabilityZone   string            `xml:"availabilityZone"`
	Description        string            `xml:"description"`
	Groups             []GroupIdentifier `xml:"groupSet>item"`
	InterfaceType      string            `xml:"interfaceType"`
	MacAddress         string            `xml:"macAddress"`
	NetworkInterfaceId string            `xml:"networkInterfaceId"`
	OwnerId            string            `xml:"ownerId"`
	PrivateDnsName     string            `xml:"privateDnsName"`
	PrivateIpAddress   string            `xml:"privateIpAddress"`
	PrivateIpAddresses []eniIP           `xml:"privateIpAddressesSet>item"`
	RequesterId        string            `xml:"requesterId,omitempty"`
	RequesterManaged   bool              `xml:"requesterManaged"`
	SourceDestCheck    bool              `xml:"sourceDestCheck"`
	Status             string            `xml:"status"`
	SubnetId           string            `xml:"subnetId"`
	TagSet             []Tag             `xml:"tagSet>item" json:"-"`
	VpcId              string            `xml:"vpcId"`
	Owner              string            `xml:"-"` // the NAT gateway or endpoint it belongs to
}

NetworkInterface is a network interface in its wire shape. Interfaces made for NAT gateways and endpoints are stored; those of instances are made from the instance when described.

type Placement

type Placement struct {
	AvailabilityZone string `xml:"availabilityZone"`
	GroupName        string `xml:"groupName"`
	Tenancy          string `xml:"tenancy"`
}

Placement is where an instance runs.

type PrefixList

type PrefixList struct {
	PrefixListId   string        `xml:"prefixListId"`
	AddressFamily  string        `xml:"addressFamily"`
	State          string        `xml:"state"`
	PrefixListName string        `xml:"prefixListName"`
	MaxEntries     int           `xml:"maxEntries"`
	Version        int           `xml:"version"`
	PrefixListArn  string        `xml:"prefixListArn"`
	OwnerId        string        `xml:"ownerId"`
	TagSet         []Tag         `xml:"tagSet>item" json:"-"`
	Entries        []prefixEntry `xml:"-"`
}

PrefixList is a managed prefix list; the AWS ones (S3 and DynamoDB) are made when asked for and never stored.

type ProfileRef

type ProfileRef struct {
	Arn string `xml:"arn"`
	Id  string `xml:"id"`
}

ProfileRef is an instance's IAM instance profile.

type RouteTable

type RouteTable struct {
	RouteTableId string    `xml:"routeTableId"`
	VpcId        string    `xml:"vpcId"`
	OwnerId      string    `xml:"ownerId"`
	Routes       []route   `xml:"routeSet>item"`
	Associations []rtAssoc `xml:"associationSet>item"`
	TagSet       []Tag     `xml:"tagSet>item" json:"-"`
}

RouteTable is a route table.

type Service

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

Service is the EC2 emulator.

func New

func New(hub *core.Hub) *Service

New creates the EC2 service.

func (*Service) Info

func (s *Service) Info() core.Info

func (*Service) Inspect

func (s *Service) Inspect(table, id string) any

Inspect returns one resource with its tags.

func (*Service) Load

func (s *Service) Load(b []byte) error

Load replaces the state: instances that ran in containers start again (persisted state keeps them), and containers the old state had are removed.

func (*Service) Reset

func (s *Service) Reset()

func (*Service) Resources

func (s *Service) Resources() []core.Table

Resources lists instances, VPCs, subnets, security groups and key pairs.

func (*Service) Save

func (s *Service) Save() ([]byte, error)

func (*Service) ServeHTTP

func (s *Service) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Service) TaggedResources

func (s *Service) TaggedResources(account, region string) map[string]map[string]string

TaggedResources lists tagged resources (ARN → tags) for the tagging API.

func (*Service) VPCOfSubnet added in v0.2.0

func (s *Service) VPCOfSubnet(account, region, subnet string) string

VPCOfSubnet is the VPC of a subnet, or "" when there is none; Route 53 and the services that run containers in a VPC use it to find the private zones to resolve.

type StateReason

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

StateReason says why an instance stopped or terminated.

type Subnet

type Subnet struct {
	SubnetId                    string `xml:"subnetId"`
	SubnetArn                   string `xml:"subnetArn"`
	State                       string `xml:"state"`
	VpcId                       string `xml:"vpcId"`
	OwnerId                     string `xml:"ownerId"`
	CidrBlock                   string `xml:"cidrBlock"`
	AvailableIpAddressCount     int    `xml:"availableIpAddressCount"`
	AvailabilityZone            string `xml:"availabilityZone"`
	AvailabilityZoneId          string `xml:"availabilityZoneId"`
	DefaultForAz                bool   `xml:"defaultForAz"`
	MapPublicIpOnLaunch         bool   `xml:"mapPublicIpOnLaunch"`
	AssignIpv6AddressOnCreation bool   `xml:"assignIpv6AddressOnCreation"`
	PrivateDns                  struct {
		HostnameType string `xml:"hostnameType"`
	} `xml:"privateDnsNameOptionsOnLaunch"`
	TagSet []Tag `xml:"tagSet>item" json:"-"`
}

Subnet is a subnet in its wire shape.

type Tag

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

Tag is an EC2 tag.

type TemplateVersion

type TemplateVersion struct {
	LaunchTemplateId   string `xml:"launchTemplateId"`
	LaunchTemplateName string `xml:"launchTemplateName"`
	VersionNumber      int    `xml:"versionNumber"`
	VersionDescription string `xml:"versionDescription,omitempty"`
	CreateTime         string `xml:"createTime"`
	CreatedBy          string `xml:"createdBy"`
	DefaultVersion     bool   `xml:"defaultVersion"`
	LaunchTemplateData ltData `xml:"launchTemplateData"`
}

TemplateVersion is one version of a launch template. Its data keeps the Query keys it came with (ImageId, SecurityGroupId.1, …): RunInstances decodes them, responses render them (see ltData).

type TgwAttachment

type TgwAttachment struct {
	TransitGatewayAttachmentId string `xml:"transitGatewayAttachmentId"`
	TransitGatewayId           string `xml:"transitGatewayId"`
	TransitGatewayOwnerId      string `xml:"transitGatewayOwnerId"`
	ResourceOwnerId            string `xml:"resourceOwnerId"`
	ResourceType               string `xml:"resourceType"`
	ResourceId                 string `xml:"resourceId"`
	State                      string `xml:"state"`
	Association                *struct {
		TransitGatewayRouteTableId string `xml:"transitGatewayRouteTableId"`
		State                      string `xml:"state"`
	} `xml:"association"`
	CreationTime string `xml:"creationTime"`
	TagSet       []Tag  `xml:"tagSet>item"`
}

TgwAttachment is an attachment of any kind.

type TgwPeering

type TgwPeering struct {
	TransitGatewayAttachmentId string  `xml:"transitGatewayAttachmentId"`
	RequesterTgwInfo           tgwInfo `xml:"requesterTgwInfo"`
	AccepterTgwInfo            tgwInfo `xml:"accepterTgwInfo"`
	Options                    struct {
		DynamicRouting string `xml:"dynamicRouting"`
	} `xml:"options"`
	Status struct {
		Code    string `xml:"code"`
		Message string `xml:"message"`
	} `xml:"status"`
	State        string `xml:"state"`
	CreationTime string `xml:"creationTime"`
	TagSet       []Tag  `xml:"tagSet>item" json:"-"`
}

TgwPeering peers two transit gateways, which may be in other accounts and regions.

type TgwVpcAttachment

type TgwVpcAttachment struct {
	TransitGatewayAttachmentId string           `xml:"transitGatewayAttachmentId"`
	TransitGatewayId           string           `xml:"transitGatewayId"`
	VpcId                      string           `xml:"vpcId"`
	VpcOwnerId                 string           `xml:"vpcOwnerId"`
	State                      string           `xml:"state"`
	SubnetIds                  []string         `xml:"subnetIds>item"`
	CreationTime               string           `xml:"creationTime"`
	Options                    vpcAttachOptions `xml:"options"`
	TagSet                     []Tag            `xml:"tagSet>item" json:"-"`
}

TgwVpcAttachment attaches a VPC to a transit gateway.

type TransitGateway

type TransitGateway struct {
	TransitGatewayId  string     `xml:"transitGatewayId"`
	TransitGatewayArn string     `xml:"transitGatewayArn"`
	State             string     `xml:"state"`
	OwnerId           string     `xml:"ownerId"`
	Description       string     `xml:"description"`
	CreationTime      string     `xml:"creationTime"`
	Options           tgwOptions `xml:"options"`
	TagSet            []Tag      `xml:"tagSet>item" json:"-"`
	RouteTableId      string     `xml:"-"` // the default route table
}

TransitGateway is a transit gateway.

type TypeInfo

type TypeInfo struct {
	InstanceType                 string   `xml:"instanceType"`
	CurrentGeneration            bool     `xml:"currentGeneration"`
	FreeTierEligible             bool     `xml:"freeTierEligible"`
	SupportedUsageClasses        []string `xml:"supportedUsageClasses>item"`
	SupportedRootDeviceTypes     []string `xml:"supportedRootDeviceTypes>item"`
	SupportedVirtualizationTypes []string `xml:"supportedVirtualizationTypes>item"`
	BareMetal                    bool     `xml:"bareMetal"`
	Hypervisor                   string   `xml:"hypervisor"`
	ProcessorInfo                struct {
		SupportedArchitectures []string `xml:"supportedArchitectures>item"`
	} `xml:"processorInfo"`
	VCpuInfo struct {
		DefaultVCpus          int `xml:"defaultVCpus"`
		DefaultCores          int `xml:"defaultCores"`
		DefaultThreadsPerCore int `xml:"defaultThreadsPerCore"`
	} `xml:"vCpuInfo"`
	MemoryInfo struct {
		SizeInMiB int `xml:"sizeInMiB"`
	} `xml:"memoryInfo"`
	NetworkInfo struct {
		NetworkPerformance           string    `xml:"networkPerformance"`
		MaximumNetworkInterfaces     int       `xml:"maximumNetworkInterfaces"`
		MaximumNetworkCards          int       `xml:"maximumNetworkCards"`
		DefaultNetworkCardIndex      int       `xml:"defaultNetworkCardIndex"`
		NetworkCards                 []netCard `xml:"networkCards>item"`
		Ipv4AddressesPerInterface    int       `xml:"ipv4AddressesPerInterface"`
		Ipv6AddressesPerInterface    int       `xml:"ipv6AddressesPerInterface"`
		Ipv6Supported                bool      `xml:"ipv6Supported"`
		EnaSupport                   string    `xml:"enaSupport"`
		EfaSupported                 bool      `xml:"efaSupported"`
		EncryptionInTransitSupported bool      `xml:"encryptionInTransitSupported"`
	} `xml:"networkInfo"`
	InstanceStorageSupported      bool `xml:"instanceStorageSupported"`
	BurstablePerformanceSupported bool `xml:"burstablePerformanceSupported"`
}

TypeInfo describes an instance type.

type Volume

type Volume struct {
	VolumeId           string             `xml:"volumeId"`
	Size               int                `xml:"size"`
	SnapshotId         string             `xml:"snapshotId"`
	AvailabilityZone   string             `xml:"availabilityZone"`
	State              string             `xml:"status"`
	CreateTime         string             `xml:"createTime"`
	Attachments        []VolumeAttachment `xml:"attachmentSet>item"`
	VolumeType         string             `xml:"volumeType"`
	Iops               int                `xml:"iops,omitempty"`
	Throughput         int                `xml:"throughput,omitempty"`
	Encrypted          bool               `xml:"encrypted"`
	KmsKeyId           string             `xml:"kmsKeyId,omitempty"`
	MultiAttachEnabled bool               `xml:"multiAttachEnabled"`
	TagSet             []Tag              `xml:"tagSet>item" json:"-"`
}

Volume is an EBS volume: metadata only.

type VolumeAttachment

type VolumeAttachment struct {
	VolumeId            string `xml:"volumeId"`
	InstanceId          string `xml:"instanceId"`
	Device              string `xml:"device"`
	State               string `xml:"status"`
	AttachTime          string `xml:"attachTime"`
	DeleteOnTermination bool   `xml:"deleteOnTermination"`
}

VolumeAttachment is a volume attached to an instance.

type Vpc

type Vpc struct {
	VpcId           string      `xml:"vpcId"`
	OwnerId         string      `xml:"ownerId"`
	State           string      `xml:"state"`
	CidrBlock       string      `xml:"cidrBlock"`
	CidrAssoc       []cidrAssoc `xml:"cidrBlockAssociationSet>item"`
	DhcpOptionsId   string      `xml:"dhcpOptionsId"`
	InstanceTenancy string      `xml:"instanceTenancy"`
	IsDefault       bool        `xml:"isDefault"`
	TagSet          []Tag       `xml:"tagSet>item" json:"-"`
	DnsSupport      bool        `xml:"-"`
	DnsHostnames    bool        `xml:"-"`
	UsageMetrics    bool        `xml:"-"`
}

Vpc is a VPC in its wire shape.

type VpcEndpoint

type VpcEndpoint struct {
	VpcEndpointId       string            `xml:"vpcEndpointId"`
	VpcEndpointType     string            `xml:"vpcEndpointType"`
	VpcId               string            `xml:"vpcId"`
	ServiceName         string            `xml:"serviceName"`
	State               string            `xml:"state"`
	PolicyDocument      string            `xml:"policyDocument"`
	RouteTableIds       []string          `xml:"routeTableIdSet>item"`
	SubnetIds           []string          `xml:"subnetIdSet>item"`
	Groups              []GroupIdentifier `xml:"groupSet>item"`
	IpAddressType       string            `xml:"ipAddressType"`
	DnsOptions          dnsOptions        `xml:"dnsOptions"`
	PrivateDnsEnabled   bool              `xml:"privateDnsEnabled"`
	RequesterManaged    bool              `xml:"requesterManaged"`
	NetworkInterfaceIds []string          `xml:"networkInterfaceIdSet>item"`
	DnsEntries          []dnsEntry        `xml:"dnsEntrySet>item"`
	CreationTimestamp   string            `xml:"creationTimestamp"`
	TagSet              []Tag             `xml:"tagSet>item" json:"-"`
	OwnerId             string            `xml:"ownerId"`
}

VpcEndpoint is a VPC endpoint.

Jump to

Keyboard shortcuts

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