aws_provider

package
v0.0.0-...-24ed54c Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AwsCloudProvider

type AwsCloudProvider struct {
	FailureRegion     string
	MaxIPsPerInstance int

	Client AwsDirectCalls

	Log logr.Logger
}

func (AwsCloudProvider) AddRandomIP

func (a AwsCloudProvider) AddRandomIP(hostName string) (*net.IP, error)

func (AwsCloudProvider) AddSpecifiedIP

func (a AwsCloudProvider) AddSpecifiedIP(ip *net.IP, hostName string) error

func (AwsCloudProvider) CheckIP

func (a AwsCloudProvider) CheckIP(ip *net.IP, hostName string) error

func (AwsCloudProvider) MoveIP

func (a AwsCloudProvider) MoveIP(ip *net.IP, oldHostName string, newHostName string) error

func (AwsCloudProvider) RemoveIP

func (a AwsCloudProvider) RemoveIP(ip *net.IP, hostName string) error

type AwsDirectCalls

type AwsDirectCalls interface {
	AssignPrivateIpAddresses(filter *ec2.AssignPrivateIpAddressesInput) (*ec2.AssignPrivateIpAddressesOutput, error)
	DescribeInstances(filter *ec2.DescribeInstancesInput) (*ec2.DescribeInstancesOutput, error)
	UnassignPrivateIpAddresses(filter *ec2.UnassignPrivateIpAddressesInput) (*ec2.UnassignPrivateIpAddressesOutput, error)
}

AwsDirectCalls is the interface for accessing AWS services. It is the final interface to be able to mock the AWS calls during testing.

type AwsDirectCallsProd

type AwsDirectCallsProd struct {
	Session *session.Session
	Client  *ec2.EC2
}

AwsDirectCallsProd is the working implementation of the AwsDirectCalls interface.

func (*AwsDirectCallsProd) AssignPrivateIpAddresses

AssignPrivateIpAddresses calls assign-private-ip-addresses and returns either the output or an error.

func (*AwsDirectCallsProd) DescribeInstances

DescribeInstances calls describe-instances at AWS and returns either the output or an error.

func (*AwsDirectCallsProd) UnassignPrivateIpAddresses

UnassignPrivateIpAddresses calls unassign-private-ip-addresses and returns either the output or an error.

Jump to

Keyboard shortcuts

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