aws

package
v0.0.0-...-a0919e1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

CompleteStatuses contains all CloudFormation status strings that we consider to be complete for a vpn

FailedStatuses contains all CloudFormation status strings that we consider to be failed for a vpn

PendingStatuses contains all CloudFormation status strings that we consider to be pending for a vpn

Functions

func DescribeStack

func DescribeStack(cfnSvc cloudformationiface.CloudFormationAPI, stackName string) (*cloudformation.Stack, error)

DescribeStack takes a stackName as input and returns the Stack information along with any errors.

func GetCFNTemplateBody

func GetCFNTemplateBody(cfnTemplate string, input interface{}) (string, error)

GetCFNTemplateBody takes a cfnTemplate and a corresponding struct as input and return the rendered template

func GetCustomerGatewayConfig

func GetCustomerGatewayConfig(ec2Svc ec2iface.EC2API, customerGatewayIP string, stack *cloudformation.Stack) (string, error)

GetCustomerGatewayConfig takes a customer gateway IP address and a CFN VPN stack name and returns the VPN config for that customer gateway

func GetRouteTableIDs

func GetRouteTableIDs(ec2Svc ec2iface.EC2API, VpcID string) ([]string, error)

GetRouteTableIDs takes vpc ID and returns its routetable ids

func GetVpcIDs

func GetVpcIDs(ec2Svc ec2iface.EC2API, nodes []*string) ([]string, error)

GetVpcIDs retrieves a list of unique vpcIDs from the provided nodes.

func IsComplete

func IsComplete(status string) bool

IsComplete tests if the specified string is considered a completed cloudformation stack state

func IsFailed

func IsFailed(status string) bool

IsFailed tests if the specified string is considered a failed cloudformation stack state

func IsPending

func IsPending(status string) bool

IsPending tests if the specified string is considered a pending cloudformation stack state

func StackDoesNotExist

func StackDoesNotExist(err error) bool

StackDoesNotExist Checks if the error recieved for DescribeStacks denotes if the stack is non exsistent

Types

type MockCloudformationAPI

type MockCloudformationAPI struct {
	cloudformationiface.CloudFormationAPI

	Err    error
	Status string

	FailDescribe bool
}

MockCloudformationAPI provides mocked interface to AWS Cloudformation service

func (*MockCloudformationAPI) CreateStack

CreateStack mocks the cloudformation CreateStack call and returns an empty output

func (*MockCloudformationAPI) DeleteStack

DeleteStack mocks the cloudformation DeleteStack call and returns an empty output

func (*MockCloudformationAPI) DescribeStacks

DescribeStacks mocks the cloudformation DescribeStacks call and returns a sample VPN stack output

type MockEC2API

type MockEC2API struct {
	ec2iface.EC2API
	VpcIds map[string]string
}

MockEC2API mocks the ec2 api interface

func (*MockEC2API) DescribeInstances

DescribeInstances mocks the ec2 DescribeInstances call and returns the instances stored in the Mock

func (*MockEC2API) DescribeRouteTables

DescribeRouteTables mocks the cloudformation DescribeRouteTables call and returns test output

func (*MockEC2API) DescribeVpnConnections

DescribeVpnConnections mocks the cloudformation DescribeVpnConnections call and returns test output

Jump to

Keyboard shortcuts

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