Documentation
¶
Overview ¶
Package vpc provides an in-memory mock implementation of AWS VPC networking.
Index ¶
- Constants
- type Mock
- func (m *Mock) AcceptPeeringConnection(_ context.Context, peeringID string) error
- func (m *Mock) AddEgressRule(_ context.Context, groupID string, rule driver.SecurityRule) error
- func (m *Mock) AddIngressRule(_ context.Context, groupID string, rule driver.SecurityRule) error
- func (m *Mock) AddNetworkACLRule(_ context.Context, aclID string, rule *driver.NetworkACLRule) error
- func (m *Mock) AllocateAddress(_ context.Context, cfg driver.ElasticIPConfig) (*driver.ElasticIP, error)
- func (m *Mock) AssociateAddress(_ context.Context, allocationID, instanceID string) (string, error)
- func (m *Mock) AssociateRouteTable(_ context.Context, routeTableID, subnetID string) (*driver.RouteTableAssociation, error)
- func (m *Mock) AttachInternetGateway(_ context.Context, igwID, vpcID string) error
- func (m *Mock) CreateFlowLog(_ context.Context, cfg driver.FlowLogConfig) (*driver.FlowLog, error)
- func (m *Mock) CreateInternetGateway(_ context.Context, cfg driver.InternetGatewayConfig) (*driver.InternetGateway, error)
- func (m *Mock) CreateNATGateway(_ context.Context, cfg driver.NATGatewayConfig) (*driver.NATGateway, error)
- func (m *Mock) CreateNetworkACL(_ context.Context, vpcID string, tags map[string]string) (*driver.NetworkACL, error)
- func (m *Mock) CreatePeeringConnection(_ context.Context, cfg driver.PeeringConfig) (*driver.PeeringConnection, error)
- func (m *Mock) CreateRoute(_ context.Context, routeTableID, destinationCIDR, targetID, targetType string) error
- func (m *Mock) CreateRouteTable(_ context.Context, cfg driver.RouteTableConfig) (*driver.RouteTable, error)
- func (m *Mock) CreateSecurityGroup(_ context.Context, cfg driver.SecurityGroupConfig) (*driver.SecurityGroupInfo, error)
- func (m *Mock) CreateSubnet(_ context.Context, cfg driver.SubnetConfig) (*driver.SubnetInfo, error)
- func (m *Mock) CreateVPC(_ context.Context, cfg driver.VPCConfig) (*driver.VPCInfo, error)
- func (m *Mock) CreateVPCEndpoint(_ context.Context, cfg driver.VPCEndpointConfig) (*driver.VPCEndpoint, error)
- func (m *Mock) DeleteFlowLog(_ context.Context, id string) error
- func (m *Mock) DeleteInternetGateway(_ context.Context, id string) error
- func (m *Mock) DeleteNATGateway(_ context.Context, id string) error
- func (m *Mock) DeleteNetworkACL(_ context.Context, id string) error
- func (m *Mock) DeletePeeringConnection(_ context.Context, peeringID string) error
- func (m *Mock) DeleteRoute(_ context.Context, routeTableID, destinationCIDR string) error
- func (m *Mock) DeleteRouteTable(_ context.Context, id string) error
- func (m *Mock) DeleteSecurityGroup(_ context.Context, id string) error
- func (m *Mock) DeleteSubnet(_ context.Context, id string) error
- func (m *Mock) DeleteVPC(_ context.Context, id string) error
- func (m *Mock) DeleteVPCEndpoint(_ context.Context, id string) error
- func (m *Mock) DescribeAddresses(_ context.Context, ids []string) ([]driver.ElasticIP, error)
- func (m *Mock) DescribeFlowLogs(_ context.Context, ids []string) ([]driver.FlowLog, error)
- func (m *Mock) DescribeInternetGateways(_ context.Context, ids []string) ([]driver.InternetGateway, error)
- func (m *Mock) DescribeNATGateways(_ context.Context, ids []string) ([]driver.NATGateway, error)
- func (m *Mock) DescribeNetworkACLs(_ context.Context, ids []string) ([]driver.NetworkACL, error)
- func (m *Mock) DescribePeeringConnections(_ context.Context, ids []string) ([]driver.PeeringConnection, error)
- func (m *Mock) DescribeRouteTables(_ context.Context, ids []string) ([]driver.RouteTable, error)
- func (m *Mock) DescribeSecurityGroups(_ context.Context, ids []string) ([]driver.SecurityGroupInfo, error)
- func (m *Mock) DescribeSubnets(_ context.Context, ids []string) ([]driver.SubnetInfo, error)
- func (m *Mock) DescribeVPCEndpoints(_ context.Context, ids []string) ([]driver.VPCEndpoint, error)
- func (m *Mock) DescribeVPCs(_ context.Context, ids []string) ([]driver.VPCInfo, error)
- func (m *Mock) DetachInternetGateway(_ context.Context, igwID, vpcID string) error
- func (m *Mock) DisassociateAddress(_ context.Context, associationID string) error
- func (m *Mock) DisassociateRouteTable(_ context.Context, associationID string) error
- func (m *Mock) GetFlowLogRecords(_ context.Context, flowLogID string, limit int) ([]driver.FlowLogRecord, error)
- func (m *Mock) ModifyVPCEndpoint(_ context.Context, id string, cfg driver.VPCEndpointConfig) (*driver.VPCEndpoint, error)
- func (m *Mock) RejectPeeringConnection(_ context.Context, peeringID string) error
- func (m *Mock) ReleaseAddress(_ context.Context, allocationID string) error
- func (m *Mock) RemoveEgressRule(_ context.Context, groupID string, rule driver.SecurityRule) error
- func (m *Mock) RemoveIngressRule(_ context.Context, groupID string, rule driver.SecurityRule) error
- func (m *Mock) RemoveNetworkACLRule(_ context.Context, aclID string, ruleNumber int, egress bool) error
Constants ¶
const ( TrafficTypeAll = "ALL" TrafficTypeAccept = "ACCEPT" TrafficTypeReject = "REJECT" )
Flow log traffic type constants.
const ( IGWStateDetached = "detached" IGWStateAttached = "attached" )
Internet gateway state constants.
const ( NATStateAvailable = "available" NATStateDeleted = "deleted" )
NAT gateway state constants.
const ( PeeringStatusPending = "pending-acceptance" PeeringStatusActive = "active" PeeringStatusRejected = "rejected" PeeringStatusDeleted = "deleted" )
Peering status constants.
const (
FlowLogStatusActive = "ACTIVE"
)
Flow log status constants.
const (
RouteTargetLocal = "local"
)
Route target type constants.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mock ¶
type Mock struct {
// contains filtered or unexported fields
}
Mock is an in-memory mock implementation of the AWS VPC networking service.
func (*Mock) AcceptPeeringConnection ¶ added in v1.2.0
AcceptPeeringConnection accepts a pending peering connection.
func (*Mock) AddEgressRule ¶
AddEgressRule adds an egress rule to the specified security group.
func (*Mock) AddIngressRule ¶
AddIngressRule adds an ingress rule to the specified security group.
func (*Mock) AddNetworkACLRule ¶ added in v1.2.0
func (m *Mock) AddNetworkACLRule(_ context.Context, aclID string, rule *driver.NetworkACLRule) error
AddNetworkACLRule adds a rule to the specified network ACL, keeping rules sorted by number.
func (*Mock) AllocateAddress ¶ added in v1.3.2
func (m *Mock) AllocateAddress( _ context.Context, cfg driver.ElasticIPConfig, ) (*driver.ElasticIP, error)
AllocateAddress allocates a new elastic IP address.
func (*Mock) AssociateAddress ¶ added in v1.3.2
func (m *Mock) AssociateAddress( _ context.Context, allocationID, instanceID string, ) (string, error)
AssociateAddress associates an elastic IP with an instance.
func (*Mock) AssociateRouteTable ¶ added in v1.3.2
func (m *Mock) AssociateRouteTable( _ context.Context, routeTableID, subnetID string, ) (*driver.RouteTableAssociation, error)
AssociateRouteTable associates a route table with a subnet.
func (*Mock) AttachInternetGateway ¶ added in v1.3.2
AttachInternetGateway attaches an internet gateway to a VPC.
func (*Mock) CreateFlowLog ¶ added in v1.2.0
CreateFlowLog creates a flow log for a VPC or subnet resource.
func (*Mock) CreateInternetGateway ¶ added in v1.3.2
func (m *Mock) CreateInternetGateway( _ context.Context, cfg driver.InternetGatewayConfig, ) (*driver.InternetGateway, error)
CreateInternetGateway creates a new internet gateway.
func (*Mock) CreateNATGateway ¶ added in v1.2.0
func (m *Mock) CreateNATGateway(_ context.Context, cfg driver.NATGatewayConfig) (*driver.NATGateway, error)
CreateNATGateway creates a NAT gateway in the specified subnet.
func (*Mock) CreateNetworkACL ¶ added in v1.2.0
func (m *Mock) CreateNetworkACL(_ context.Context, vpcID string, tags map[string]string) (*driver.NetworkACL, error)
CreateNetworkACL creates a network ACL for the specified VPC.
func (*Mock) CreatePeeringConnection ¶ added in v1.2.0
func (m *Mock) CreatePeeringConnection( _ context.Context, cfg driver.PeeringConfig, ) (*driver.PeeringConnection, error)
CreatePeeringConnection creates a VPC peering connection between two VPCs.
func (*Mock) CreateRoute ¶ added in v1.2.0
func (m *Mock) CreateRoute( _ context.Context, routeTableID, destinationCIDR, targetID, targetType string, ) error
CreateRoute adds a route to the specified route table.
func (*Mock) CreateRouteTable ¶ added in v1.2.0
func (m *Mock) CreateRouteTable(_ context.Context, cfg driver.RouteTableConfig) (*driver.RouteTable, error)
CreateRouteTable creates a route table for the specified VPC.
func (*Mock) CreateSecurityGroup ¶
func (m *Mock) CreateSecurityGroup(_ context.Context, cfg driver.SecurityGroupConfig) (*driver.SecurityGroupInfo, error)
CreateSecurityGroup creates a new security group with the given configuration.
func (*Mock) CreateSubnet ¶
func (m *Mock) CreateSubnet(_ context.Context, cfg driver.SubnetConfig) (*driver.SubnetInfo, error)
CreateSubnet creates a new subnet with the given configuration.
func (*Mock) CreateVPCEndpoint ¶ added in v1.4.0
func (m *Mock) CreateVPCEndpoint( _ context.Context, cfg driver.VPCEndpointConfig, ) (*driver.VPCEndpoint, error)
CreateVPCEndpoint creates a new VPC endpoint.
func (*Mock) DeleteFlowLog ¶ added in v1.2.0
DeleteFlowLog deletes the flow log with the given ID.
func (*Mock) DeleteInternetGateway ¶ added in v1.3.2
DeleteInternetGateway deletes the internet gateway.
func (*Mock) DeleteNATGateway ¶ added in v1.2.0
DeleteNATGateway deletes the NAT gateway with the given ID.
func (*Mock) DeleteNetworkACL ¶ added in v1.2.0
DeleteNetworkACL deletes the network ACL with the given ID.
func (*Mock) DeletePeeringConnection ¶ added in v1.2.0
DeletePeeringConnection deletes a peering connection.
func (*Mock) DeleteRoute ¶ added in v1.2.0
DeleteRoute removes a route from the specified route table.
func (*Mock) DeleteRouteTable ¶ added in v1.2.0
DeleteRouteTable deletes the route table with the given ID.
func (*Mock) DeleteSecurityGroup ¶
DeleteSecurityGroup deletes the security group with the given ID.
func (*Mock) DeleteSubnet ¶
DeleteSubnet deletes the subnet with the given ID.
func (*Mock) DeleteVPCEndpoint ¶ added in v1.4.0
DeleteVPCEndpoint deletes the VPC endpoint with the given ID.
func (*Mock) DescribeAddresses ¶ added in v1.3.2
DescribeAddresses returns elastic IPs matching the given allocation IDs, or all if ids is empty.
func (*Mock) DescribeFlowLogs ¶ added in v1.2.0
DescribeFlowLogs returns flow logs matching the given IDs, or all if empty.
func (*Mock) DescribeInternetGateways ¶ added in v1.3.2
func (m *Mock) DescribeInternetGateways( _ context.Context, ids []string, ) ([]driver.InternetGateway, error)
DescribeInternetGateways returns internet gateways matching the given IDs, or all if ids is empty.
func (*Mock) DescribeNATGateways ¶ added in v1.2.0
DescribeNATGateways returns NAT gateways matching the given IDs, or all if empty.
func (*Mock) DescribeNetworkACLs ¶ added in v1.2.0
DescribeNetworkACLs returns network ACLs matching the given IDs, or all if empty.
func (*Mock) DescribePeeringConnections ¶ added in v1.2.0
func (m *Mock) DescribePeeringConnections( _ context.Context, ids []string, ) ([]driver.PeeringConnection, error)
DescribePeeringConnections returns peering connections matching the given IDs.
func (*Mock) DescribeRouteTables ¶ added in v1.2.0
DescribeRouteTables returns route tables matching the given IDs, or all if empty.
func (*Mock) DescribeSecurityGroups ¶
func (m *Mock) DescribeSecurityGroups(_ context.Context, ids []string) ([]driver.SecurityGroupInfo, error)
DescribeSecurityGroups returns security groups matching the given IDs, or all if ids is empty.
func (*Mock) DescribeSubnets ¶
DescribeSubnets returns subnets matching the given IDs, or all subnets if ids is empty.
func (*Mock) DescribeVPCEndpoints ¶ added in v1.4.0
func (m *Mock) DescribeVPCEndpoints( _ context.Context, ids []string, ) ([]driver.VPCEndpoint, error)
DescribeVPCEndpoints returns VPC endpoints matching the given IDs, or all endpoints if ids is empty.
func (*Mock) DescribeVPCs ¶
DescribeVPCs returns VPCs matching the given IDs, or all VPCs if ids is empty.
func (*Mock) DetachInternetGateway ¶ added in v1.3.2
DetachInternetGateway detaches an internet gateway from a VPC.
func (*Mock) DisassociateAddress ¶ added in v1.3.2
DisassociateAddress removes an elastic IP association.
func (*Mock) DisassociateRouteTable ¶ added in v1.3.2
DisassociateRouteTable removes a route table association.
func (*Mock) GetFlowLogRecords ¶ added in v1.2.0
func (m *Mock) GetFlowLogRecords( _ context.Context, flowLogID string, limit int, ) ([]driver.FlowLogRecord, error)
GetFlowLogRecords generates mock flow log records for the given flow log.
func (*Mock) ModifyVPCEndpoint ¶ added in v1.4.0
func (m *Mock) ModifyVPCEndpoint( _ context.Context, id string, cfg driver.VPCEndpointConfig, ) (*driver.VPCEndpoint, error)
ModifyVPCEndpoint updates a VPC endpoint configuration.
func (*Mock) RejectPeeringConnection ¶ added in v1.2.0
RejectPeeringConnection rejects a pending peering connection.
func (*Mock) ReleaseAddress ¶ added in v1.3.2
ReleaseAddress releases an elastic IP address.
func (*Mock) RemoveEgressRule ¶
RemoveEgressRule removes a matching egress rule from the specified security group.
func (*Mock) RemoveIngressRule ¶
RemoveIngressRule removes a matching ingress rule from the specified security group.