ec2

package
v0.0.1-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: MIT Imports: 30 Imported by: 0

Documentation

Overview

Package ec2 provides emulation of Amazon EC2 and VPC operations.

Implemented: DescribeRegions, DescribeAvailabilityZones, DescribeInstances, DescribeInstanceTypes, RunInstances, TerminateInstances, StartInstances, StopInstances, CreateVpc, DescribeVpcs, DeleteVpc, CreateSubnet, DeleteSubnet, DescribeSubnets, CreateSecurityGroup, DeleteSecurityGroup, DescribeSecurityGroups, AuthorizeSecurityGroupIngress, AuthorizeSecurityGroupEgress, RevokeSecurityGroupIngress, RevokeSecurityGroupEgress, DescribeImages, CreateKeyPair, DescribeKeyPairs, DeleteKeyPair, CreateRouteTable, DescribeRouteTables, DeleteRouteTable, CreateRoute, AssociateRouteTable, DisassociateRouteTable, CreateInternetGateway, DescribeInternetGateways, DeleteInternetGateway, AttachInternetGateway, DetachInternetGateway, CreateVpnGateway, AttachVpnGateway, DescribeVpnGateways, DetachVpnGateway, DeleteVpnGateway, CreateVpcPeeringConnection, AcceptVpcPeeringConnection, DescribeVpcPeeringConnections, DeleteVpcPeeringConnection. All other operations return HTTP 501 Not Implemented.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ElasticIP

type ElasticIP struct {
	AllocationID       string `json:"AllocationId"`
	PublicIP           string `json:"PublicIp"`
	Domain             string `json:"Domain"`
	AssociationID      string `json:"AssociationId,omitempty"`
	InstanceID         string `json:"InstanceId,omitempty"`
	NetworkInterfaceID string `json:"NetworkInterfaceId,omitempty"`
	PrivateIP          string `json:"PrivateIpAddress,omitempty"`
}

ElasticIP represents an EC2 Elastic IP address.

type Handler

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

Handler handles EC2 Query-protocol requests.

func (*Handler) AcceptVpcPeeringConnection

func (h *Handler) AcceptVpcPeeringConnection(w http.ResponseWriter, r *http.Request)

AcceptVpcPeeringConnection accepts a pending peering connection.

func (*Handler) AllocateAddress

func (h *Handler) AllocateAddress(w http.ResponseWriter, r *http.Request)

AllocateAddress allocates an Elastic IP address.

func (*Handler) AssociateAddress

func (h *Handler) AssociateAddress(w http.ResponseWriter, r *http.Request)

AssociateAddress associates an Elastic IP with an instance.

func (*Handler) AssociateRouteTable

func (h *Handler) AssociateRouteTable(w http.ResponseWriter, r *http.Request)

AssociateRouteTable associates a route table with a subnet.

func (*Handler) AttachInternetGateway

func (h *Handler) AttachInternetGateway(w http.ResponseWriter, r *http.Request)

AttachInternetGateway attaches an internet gateway to a VPC.

func (*Handler) AttachVpnGateway

func (h *Handler) AttachVpnGateway(w http.ResponseWriter, r *http.Request)

AttachVpnGateway attaches a virtual private gateway to a VPC.

func (*Handler) AuthorizeSecurityGroupEgress

func (h *Handler) AuthorizeSecurityGroupEgress(w http.ResponseWriter, r *http.Request)

AuthorizeSecurityGroupEgress adds outbound rules to a security group.

func (*Handler) AuthorizeSecurityGroupIngress

func (h *Handler) AuthorizeSecurityGroupIngress(w http.ResponseWriter, r *http.Request)

AuthorizeSecurityGroupIngress adds inbound rules to a security group.

func (*Handler) CreateInternetGateway

func (h *Handler) CreateInternetGateway(w http.ResponseWriter, r *http.Request)

CreateInternetGateway creates a new internet gateway.

func (*Handler) CreateKeyPair

func (h *Handler) CreateKeyPair(w http.ResponseWriter, r *http.Request)

CreateKeyPair creates a new key pair and returns key material.

func (*Handler) CreateNatGateway

func (h *Handler) CreateNatGateway(w http.ResponseWriter, r *http.Request)

CreateNatGateway creates a NAT gateway in a subnet.

func (*Handler) CreateNetworkInterface

func (h *Handler) CreateNetworkInterface(w http.ResponseWriter, r *http.Request)

CreateNetworkInterface creates a network interface in a subnet.

func (*Handler) CreateRoute

func (h *Handler) CreateRoute(w http.ResponseWriter, r *http.Request)

CreateRoute adds a route to an existing route table.

func (*Handler) CreateRouteTable

func (h *Handler) CreateRouteTable(w http.ResponseWriter, r *http.Request)

CreateRouteTable creates a new route table in a VPC with a local route.

func (*Handler) CreateSecurityGroup

func (h *Handler) CreateSecurityGroup(w http.ResponseWriter, r *http.Request)

CreateSecurityGroup creates a new VPC security group.

func (*Handler) CreateSubnet

func (h *Handler) CreateSubnet(w http.ResponseWriter, r *http.Request)

CreateSubnet creates a new subnet in a VPC.

func (*Handler) CreateTags

func (h *Handler) CreateTags(w http.ResponseWriter, r *http.Request)

CreateTags adds or overwrites tags on one or more resources.

func (*Handler) CreateVpc

func (h *Handler) CreateVpc(w http.ResponseWriter, r *http.Request)

CreateVpc creates a new VPC.

func (*Handler) CreateVpcEndpoint

func (h *Handler) CreateVpcEndpoint(w http.ResponseWriter, r *http.Request)

CreateVpcEndpoint handles Action=CreateVpcEndpoint.

func (*Handler) CreateVpcPeeringConnection

func (h *Handler) CreateVpcPeeringConnection(w http.ResponseWriter, r *http.Request)

CreateVpcPeeringConnection creates a peering connection between two VPCs.

func (*Handler) CreateVpnGateway

func (h *Handler) CreateVpnGateway(w http.ResponseWriter, r *http.Request)

CreateVpnGateway creates a metadata-only virtual private gateway.

func (*Handler) DeleteInternetGateway

func (h *Handler) DeleteInternetGateway(w http.ResponseWriter, r *http.Request)

DeleteInternetGateway deletes an internet gateway (must be detached).

func (*Handler) DeleteKeyPair

func (h *Handler) DeleteKeyPair(w http.ResponseWriter, r *http.Request)

DeleteKeyPair deletes a key pair by name.

func (*Handler) DeleteNatGateway

func (h *Handler) DeleteNatGateway(w http.ResponseWriter, r *http.Request)

DeleteNatGateway deletes a NAT gateway.

func (*Handler) DeleteNetworkInterface

func (h *Handler) DeleteNetworkInterface(w http.ResponseWriter, r *http.Request)

DeleteNetworkInterface deletes a network interface.

func (*Handler) DeleteRoute

func (h *Handler) DeleteRoute(w http.ResponseWriter, r *http.Request)

DeleteRoute removes a route from a route table by destination CIDR.

func (*Handler) DeleteRouteTable

func (h *Handler) DeleteRouteTable(w http.ResponseWriter, r *http.Request)

DeleteRouteTable deletes a route table by ID.

func (*Handler) DeleteSecurityGroup

func (h *Handler) DeleteSecurityGroup(w http.ResponseWriter, r *http.Request)

DeleteSecurityGroup deletes a security group by ID.

func (*Handler) DeleteSubnet

func (h *Handler) DeleteSubnet(w http.ResponseWriter, r *http.Request)

DeleteSubnet deletes a subnet by ID.

func (*Handler) DeleteTags

func (h *Handler) DeleteTags(w http.ResponseWriter, r *http.Request)

DeleteTags removes tags from one or more resources.

func (*Handler) DeleteVpc

func (h *Handler) DeleteVpc(w http.ResponseWriter, r *http.Request)

DeleteVpc deletes a VPC by ID.

func (*Handler) DeleteVpcEndpoints

func (h *Handler) DeleteVpcEndpoints(w http.ResponseWriter, r *http.Request)

DeleteVpcEndpoints handles Action=DeleteVpcEndpoints. Accepts VpcEndpointId.N positional params; silently skips unknown IDs.

func (*Handler) DeleteVpcPeeringConnection

func (h *Handler) DeleteVpcPeeringConnection(w http.ResponseWriter, r *http.Request)

DeleteVpcPeeringConnection deletes a peering connection.

func (*Handler) DeleteVpnGateway

func (h *Handler) DeleteVpnGateway(w http.ResponseWriter, r *http.Request)

DeleteVpnGateway deletes a detached virtual private gateway.

func (*Handler) DescribeAccountAttributes

func (h *Handler) DescribeAccountAttributes(w http.ResponseWriter, r *http.Request)

DescribeAccountAttributes returns default account attributes.

func (*Handler) DescribeAddresses

func (h *Handler) DescribeAddresses(w http.ResponseWriter, r *http.Request)

DescribeAddresses lists Elastic IP addresses.

func (*Handler) DescribeAvailabilityZones

func (h *Handler) DescribeAvailabilityZones(w http.ResponseWriter, r *http.Request)

DescribeAvailabilityZones returns the AZs for the configured region.

func (*Handler) DescribeDhcpOptions

func (h *Handler) DescribeDhcpOptions(w http.ResponseWriter, r *http.Request)

DescribeDhcpOptions returns a default DHCP options set.

func (*Handler) DescribeImages

func (h *Handler) DescribeImages(w http.ResponseWriter, r *http.Request)

DescribeImages returns a set of synthetic AMIs, optionally filtered by ImageId.

func (*Handler) DescribeInstanceTypes

func (h *Handler) DescribeInstanceTypes(w http.ResponseWriter, r *http.Request)

DescribeInstanceTypes returns info for requested instance types.

func (*Handler) DescribeInstances

func (h *Handler) DescribeInstances(w http.ResponseWriter, r *http.Request)

DescribeInstances returns instances, optionally filtered by ID or state.

func (*Handler) DescribeInternetGateways

func (h *Handler) DescribeInternetGateways(w http.ResponseWriter, r *http.Request)

DescribeInternetGateways lists internet gateways, optionally filtered.

func (*Handler) DescribeKeyPairs

func (h *Handler) DescribeKeyPairs(w http.ResponseWriter, r *http.Request)

DescribeKeyPairs lists key pairs, optionally filtered by KeyName.

func (*Handler) DescribeNatGateways

func (h *Handler) DescribeNatGateways(w http.ResponseWriter, r *http.Request)

DescribeNatGateways lists NAT gateways with optional filtering.

func (*Handler) DescribeNetworkInterfaces

func (h *Handler) DescribeNetworkInterfaces(w http.ResponseWriter, r *http.Request)

DescribeNetworkInterfaces lists network interfaces with optional filtering.

func (*Handler) DescribeRegions

func (h *Handler) DescribeRegions(w http.ResponseWriter, r *http.Request)

DescribeRegions returns a hardcoded list of AWS regions.

func (*Handler) DescribeRouteTables

func (h *Handler) DescribeRouteTables(w http.ResponseWriter, r *http.Request)

DescribeRouteTables lists route tables, optionally filtered.

func (*Handler) DescribeSecurityGroups

func (h *Handler) DescribeSecurityGroups(w http.ResponseWriter, r *http.Request)

DescribeSecurityGroups returns security groups, optionally filtered.

func (*Handler) DescribeSubnets

func (h *Handler) DescribeSubnets(w http.ResponseWriter, r *http.Request)

DescribeSubnets returns subnets, optionally filtered.

func (*Handler) DescribeTags

func (h *Handler) DescribeTags(w http.ResponseWriter, r *http.Request)

DescribeTags lists tags for resources.

func (*Handler) DescribeVpcAttribute

func (h *Handler) DescribeVpcAttribute(w http.ResponseWriter, r *http.Request)

DescribeVpcAttribute returns a VPC attribute value (always true for DNS attributes).

func (*Handler) DescribeVpcEndpoints

func (h *Handler) DescribeVpcEndpoints(w http.ResponseWriter, r *http.Request)

DescribeVpcEndpoints handles Action=DescribeVpcEndpoints. Supports filter vpc-id and VpcEndpointId.N positional params.

func (*Handler) DescribeVpcPeeringConnections

func (h *Handler) DescribeVpcPeeringConnections(w http.ResponseWriter, r *http.Request)

DescribeVpcPeeringConnections lists peering connections, optionally filtered.

func (*Handler) DescribeVpcs

func (h *Handler) DescribeVpcs(w http.ResponseWriter, r *http.Request)

DescribeVpcs returns all VPCs.

func (*Handler) DescribeVpnGateways

func (h *Handler) DescribeVpnGateways(w http.ResponseWriter, r *http.Request)

DescribeVpnGateways lists virtual private gateways, optionally filtered.

func (*Handler) DetachInternetGateway

func (h *Handler) DetachInternetGateway(w http.ResponseWriter, r *http.Request)

DetachInternetGateway detaches an internet gateway from a VPC.

func (*Handler) DetachVpnGateway

func (h *Handler) DetachVpnGateway(w http.ResponseWriter, r *http.Request)

DetachVpnGateway detaches a virtual private gateway from a VPC.

func (*Handler) DisassociateAddress

func (h *Handler) DisassociateAddress(w http.ResponseWriter, r *http.Request)

DisassociateAddress disassociates an Elastic IP from an instance.

func (*Handler) DisassociateRouteTable

func (h *Handler) DisassociateRouteTable(w http.ResponseWriter, r *http.Request)

DisassociateRouteTable disassociates a route table from a subnet.

func (*Handler) ModifyInstanceAttribute

func (h *Handler) ModifyInstanceAttribute(w http.ResponseWriter, r *http.Request)

ModifyInstanceAttribute handles Action=ModifyInstanceAttribute. Supports InstanceType.Value; all other attributes are accepted and ignored.

func (*Handler) ModifySubnetAttribute

func (h *Handler) ModifySubnetAttribute(w http.ResponseWriter, r *http.Request)

ModifySubnetAttribute modifies a subnet attribute (metadata-only).

func (*Handler) ModifyVpcAttribute

func (h *Handler) ModifyVpcAttribute(w http.ResponseWriter, r *http.Request)

ModifyVpcAttribute modifies a VPC attribute (metadata-only: EnableDnsSupport, EnableDnsHostnames).

func (*Handler) ReleaseAddress

func (h *Handler) ReleaseAddress(w http.ResponseWriter, r *http.Request)

ReleaseAddress releases an Elastic IP address.

func (*Handler) RevokeSecurityGroupEgress

func (h *Handler) RevokeSecurityGroupEgress(w http.ResponseWriter, r *http.Request)

RevokeSecurityGroupEgress removes outbound rules from a security group.

func (*Handler) RevokeSecurityGroupIngress

func (h *Handler) RevokeSecurityGroupIngress(w http.ResponseWriter, r *http.Request)

RevokeSecurityGroupIngress removes inbound rules from a security group.

func (*Handler) RunInstances

func (h *Handler) RunInstances(w http.ResponseWriter, r *http.Request)

RunInstances launches one or more new EC2 instances.

func (*Handler) StartInstances

func (h *Handler) StartInstances(w http.ResponseWriter, r *http.Request)

StartInstances starts one or more stopped instances.

func (*Handler) StopInstances

func (h *Handler) StopInstances(w http.ResponseWriter, r *http.Request)

StopInstances stops one or more running instances.

func (*Handler) TerminateInstances

func (h *Handler) TerminateInstances(w http.ResponseWriter, r *http.Request)

TerminateInstances terminates one or more instances.

type IGWAttachment

type IGWAttachment struct {
	VpcID string `json:"VpcId"`
	State string `json:"State"`
}

IGWAttachment represents an internet gateway VPC attachment.

type Instance

type Instance struct {
	InstanceID       string        `json:"InstanceId"`
	ImageID          string        `json:"ImageId"`
	InstanceType     string        `json:"InstanceType"`
	State            InstanceState `json:"State"`
	LaunchTime       string        `json:"LaunchTime"`
	SubnetID         string        `json:"SubnetId,omitempty"`
	VpcID            string        `json:"VpcId,omitempty"`
	PrivateIPAddress string        `json:"PrivateIpAddress,omitempty"`
	SecurityGroups   []InstanceSG  `json:"SecurityGroups,omitempty"`
	Placement        Placement     `json:"Placement"`
	Tags             []Tag         `json:"Tags,omitempty"`
}

Instance represents an EC2 instance resource.

type InstanceSG

type InstanceSG struct {
	GroupID   string `json:"GroupId"`
	GroupName string `json:"GroupName"`
}

InstanceSG is a security group reference attached to an instance.

type InstanceState

type InstanceState struct {
	Code int    `json:"Code"`
	Name string `json:"Name"`
}

InstanceState holds the state code and name for an EC2 instance.

type InternetGateway

type InternetGateway struct {
	InternetGatewayID string          `json:"InternetGatewayId"`
	Attachments       []IGWAttachment `json:"Attachments,omitempty"`
}

InternetGateway represents an EC2 internet gateway resource.

type IpPermission

type IpPermission struct {
	IpProtocol string    `json:"IpProtocol"`
	FromPort   int       `json:"FromPort"`
	ToPort     int       `json:"ToPort"`
	IpRanges   []IpRange `json:"IpRanges,omitempty"`
}

IpPermission represents a security group rule (inbound or outbound).

type IpRange

type IpRange struct {
	CidrIp      string `json:"CidrIp"`
	Description string `json:"Description,omitempty"`
}

IpRange represents a CIDR range in a security group rule.

type KeyPair

type KeyPair struct {
	KeyName        string `json:"KeyName"`
	KeyFingerprint string `json:"KeyFingerprint"`
	KeyPairID      string `json:"KeyPairId"`
	KeyMaterial    string `json:"KeyMaterial,omitempty"`
}

KeyPair represents an EC2 key pair resource.

type NatGateway

type NatGateway struct {
	NatGatewayID string `json:"NatGatewayId"`
	SubnetID     string `json:"SubnetId"`
	VpcID        string `json:"VpcId"`
	State        string `json:"State"`
	AllocationID string `json:"AllocationId,omitempty"`
	PublicIP     string `json:"PublicIp,omitempty"`
	PrivateIP    string `json:"PrivateIp,omitempty"`
	CreateTime   string `json:"CreateTime"`
	Tags         []Tag  `json:"Tags,omitempty"`
}

NatGateway represents an EC2 NAT gateway resource.

type NetworkInterface

type NetworkInterface struct {
	NetworkInterfaceID string `json:"NetworkInterfaceId"`
	SubnetID           string `json:"SubnetId"`
	VpcID              string `json:"VpcId"`
	AvailabilityZone   string `json:"AvailabilityZone"`
	Description        string `json:"Description"`
	PrivateIPAddress   string `json:"PrivateIpAddress"`
	Status             string `json:"Status"`
	MacAddress         string `json:"MacAddress"`
}

NetworkInterface represents an EC2 network interface resource.

type Placement

type Placement struct {
	AvailabilityZone string `json:"AvailabilityZone"`
}

Placement describes the placement of an instance.

type Route

type Route struct {
	DestinationCidrBlock string `json:"DestinationCidrBlock"`
	GatewayID            string `json:"GatewayId,omitempty"`
	Origin               string `json:"Origin"` // CreateRouteTable | CreateRoute
}

Route represents a route in a route table.

type RouteTable

type RouteTable struct {
	RouteTableID string                  `json:"RouteTableId"`
	VpcID        string                  `json:"VpcId"`
	Routes       []Route                 `json:"Routes"`
	Associations []RouteTableAssociation `json:"Associations"`
}

RouteTable represents an EC2 route table resource.

type RouteTableAssociation

type RouteTableAssociation struct {
	AssociationID string `json:"RouteTableAssociationId"`
	RouteTableID  string `json:"RouteTableId"`
	SubnetID      string `json:"SubnetId,omitempty"`
	Main          bool   `json:"Main"`
}

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

type SecurityGroup

type SecurityGroup struct {
	GroupID             string         `json:"GroupId"`
	GroupName           string         `json:"GroupName"`
	Description         string         `json:"Description"`
	VpcID               string         `json:"VpcId"`
	IpPermissions       []IpPermission `json:"IpPermissions,omitempty"`
	IpPermissionsEgress []IpPermission `json:"IpPermissionsEgress,omitempty"`
}

SecurityGroup represents an EC2 Security Group resource.

type Service

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

Service implements router.Service and router.QueryDispatcher for EC2 and VPC. Uses the AWS Query protocol (form-encoded POST, XML responses) and identifies itself by the API version "2016-11-15".

func New

func New(cfg *config.Config, store state.Store, logger *zap.Logger, clk clock.Clock) *Service

New returns a configured EC2 Service.

func (*Service) AllocatePrivateIPForSubnet

func (s *Service) AllocatePrivateIPForSubnet(ctx context.Context, subnetID string) string

AllocatePrivateIPForSubnet returns the API-visible private IP for the given subnet, applying remapped translation when needed. Empty string means the subnet could not be resolved.

func (*Service) DebugVPCsHandler

func (s *Service) DebugVPCsHandler() http.HandlerFunc

DebugVPCsHandler returns an http.HandlerFunc that writes the current VPC state as JSON, including internal networking fields not visible in the standard DescribeVpcs response. Used at /_debug/ec2/vpcs.

func (*Service) DispatchQuery

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

DispatchQuery satisfies router.QueryDispatcher; routes to the correct handler.

func (*Service) DockerNetworkForVpc

func (s *Service) DockerNetworkForVpc(ctx context.Context, vpcID string) string

DockerNetworkForVpc returns the Docker network ID for the given VPC. Returns empty string if the VPC is not found or has no Docker network.

func (*Service) InitBus

func (s *Service) InitBus(bus *events.Bus)

InitBus wires the event bus for VPC/subnet/security group lifecycle events.

func (*Service) Name

func (s *Service) Name() string

Name satisfies router.Service.

func (*Service) Operations

func (s *Service) Operations() []op.Operation

Operations implements router.ProtocolService.

func (*Service) OwnsVersion

func (s *Service) OwnsVersion(version string) bool

OwnsVersion satisfies router.QueryVersionOwner.

func (*Service) ReconcileNetworks

func (s *Service) ReconcileNetworks(ctx context.Context, networks []docker.NetworkSummary)

ReconcileNetworks satisfies router.NetworkReconciler. Called once after Docker becomes available to sync stored VPC state against actual Docker networks (recreate missing networks, update stale Docker network IDs).

func (*Service) RegisterRoutes

func (s *Service) RegisterRoutes(_ chi.Router)

RegisterRoutes satisfies router.Service. EC2 has no path-routed endpoints.

func (*Service) SetDocker

func (s *Service) SetDocker(dc *docker.Client)

SetDocker wires a Docker client for VPC network management. EC2 manages Docker networks (one per VPC) rather than containers.

func (*Service) Stop

func (s *Service) Stop(ctx context.Context)

Stop cancels pending lifecycle transitions (e.g. instance state changes).

func (*Service) SupportedProtocols

func (s *Service) SupportedProtocols() []codec.Codec

SupportedProtocols implements router.ProtocolService.

func (*Service) VPCNetworkStatus

func (s *Service) VPCNetworkStatus(ctx context.Context, vpcID string) string

VPCNetworkStatus returns the current network status for the given VPC. Empty string means the VPC was not found.

func (*Service) VpcIDForSubnet

func (s *Service) VpcIDForSubnet(ctx context.Context, subnetID string) string

VpcIDForSubnet returns the VPC ID that owns the given subnet. Returns empty string if the subnet is not found.

type Subnet

type Subnet struct {
	SubnetID         string `json:"SubnetId"`
	VpcID            string `json:"VpcId"`
	CidrBlock        string `json:"CidrBlock"`
	AvailabilityZone string `json:"AvailabilityZone"`
	State            string `json:"State"`
}

Subnet represents an EC2 Subnet resource.

type Tag

type Tag struct {
	Key   string `json:"Key"`
	Value string `json:"Value"`
}

Tag is a key-value pair attached to an EC2 resource.

type VPC

type VPC struct {
	VpcID           string `json:"VpcId"`
	CidrBlock       string `json:"CidrBlock"`
	State           string `json:"State"`
	IsDefault       bool   `json:"IsDefault,omitempty"`
	DockerNetworkID string `json:"DockerNetworkId,omitempty"`

	// NetworkStatus describes the relationship between the stored VPC and
	// its backing Docker network. Populated by the active vpcNetworkStrategy.
	// Empty is treated as vpcNetworkOK for backwards compatibility with VPCs
	// written before this field existed.
	NetworkStatus string `json:"NetworkStatus,omitempty"`

	// DockerCidrBlock is the subnet actually used for the backing Docker
	// network. It differs from CidrBlock only when the active strategy
	// relocates the pool (e.g. the future `remapped` strategy). Empty means
	// the Docker network uses CidrBlock directly.
	DockerCidrBlock string `json:"DockerCidrBlock,omitempty"`

	// CreateTime is the UnixMillis timestamp when this VPC was created.
	// Used by reconcile to deterministically pick the winner when multiple
	// VPCs claim the same CIDR — earliest creation wins.
	CreateTime int64 `json:"CreateTime,omitempty"`
}

VPC represents an EC2 VPC resource.

type VPCIPTranslation

type VPCIPTranslation struct {
	VpcID           string `json:"VpcId"`
	DockerNetworkID string `json:"DockerNetworkId,omitempty"`
	FakeIP          string `json:"FakeIp"`
	RealIP          string `json:"RealIp"`
}

VPCIPTranslation persists fakeIP↔realIP mapping for remapped VPCs. FakeIP is what EC2 APIs return; RealIP is what Docker-backed workloads use.

type VpcEndpoint

type VpcEndpoint struct {
	VpcEndpointID   string `json:"VpcEndpointId"`
	VpcID           string `json:"VpcId"`
	ServiceName     string `json:"ServiceName"`
	State           string `json:"State"`
	VpcEndpointType string `json:"VpcEndpointType"`
}

VpcEndpoint represents an EC2 VPC endpoint resource.

type VpcPeeringConnection

type VpcPeeringConnection struct {
	VpcPeeringConnectionID string                      `json:"VpcPeeringConnectionId"`
	RequesterVpcInfo       VpcPeeringConnectionVpcInfo `json:"RequesterVpcInfo"`
	AccepterVpcInfo        VpcPeeringConnectionVpcInfo `json:"AccepterVpcInfo"`
	Status                 VpcPeeringConnectionStatus  `json:"Status"`
	Tags                   []Tag                       `json:"Tags,omitempty"`
}

VpcPeeringConnection represents an EC2 VPC peering connection resource.

type VpcPeeringConnectionStatus

type VpcPeeringConnectionStatus struct {
	Code    string `json:"Code"`
	Message string `json:"Message"`
}

VpcPeeringConnectionStatus is the current state of a peering connection.

type VpcPeeringConnectionVpcInfo

type VpcPeeringConnectionVpcInfo struct {
	VpcID     string `json:"VpcId"`
	OwnerID   string `json:"OwnerId"`
	CidrBlock string `json:"CidrBlock"`
	Region    string `json:"Region"`
}

VpcPeeringConnectionVpcInfo describes one side (requester or accepter) of a peering connection.

type VpnGateway

type VpnGateway struct {
	VpnGatewayID     string                 `json:"VpnGatewayId"`
	State            string                 `json:"State"`
	Type             string                 `json:"Type"`
	AmazonSideAsn    int64                  `json:"AmazonSideAsn"`
	AvailabilityZone string                 `json:"AvailabilityZone,omitempty"`
	Attachments      []VpnGatewayAttachment `json:"Attachments,omitempty"`
	Tags             []Tag                  `json:"Tags,omitempty"`
}

VpnGateway represents an EC2 virtual private gateway resource.

type VpnGatewayAttachment

type VpnGatewayAttachment struct {
	VpcID string `json:"VpcId"`
	State string `json:"State"`
}

VpnGatewayAttachment represents a virtual private gateway VPC attachment.

Jump to

Keyboard shortcuts

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