Documentation ¶
Index ¶
- Variables
- func DescribeStack(cfnSvc cloudformationiface.CloudFormationAPI, stackName string) (*cloudformation.Stack, error)
- func GetCFNTemplateBody(cfnTemplate string, input interface{}) (string, error)
- func GetCustomerGatewayConfig(ec2Svc ec2iface.EC2API, customerGatewayIP string, stack *cloudformation.Stack) (string, error)
- func GetRouteTableIDs(ec2Svc ec2iface.EC2API, VpcID string) ([]string, error)
- func GetVpcIDs(ec2Svc ec2iface.EC2API, nodes []*string) ([]string, error)
- func IsComplete(status string) bool
- func IsFailed(status string) bool
- func IsPending(status string) bool
- func StackDoesNotExist(err error) bool
- type MockCloudformationAPI
- func (m *MockCloudformationAPI) CreateStack(*cloudformation.CreateStackInput) (*cloudformation.CreateStackOutput, error)
- func (m *MockCloudformationAPI) DeleteStack(*cloudformation.DeleteStackInput) (*cloudformation.DeleteStackOutput, error)
- func (m *MockCloudformationAPI) DescribeStacks(input *cloudformation.DescribeStacksInput) (*cloudformation.DescribeStacksOutput, error)
- type MockEC2API
- func (m *MockEC2API) DescribeInstances(*ec2.DescribeInstancesInput) (*ec2.DescribeInstancesOutput, error)
- func (m *MockEC2API) DescribeRouteTables(*ec2.DescribeRouteTablesInput) (*ec2.DescribeRouteTablesOutput, error)
- func (m *MockEC2API) DescribeVpnConnections(*ec2.DescribeVpnConnectionsInput) (*ec2.DescribeVpnConnectionsOutput, error)
Constants ¶
This section is empty.
Variables ¶
var CompleteStatuses = []string{ cloudformation.StackStatusCreateComplete, cloudformation.StackStatusUpdateComplete, cloudformation.StackStatusDeleteComplete, }
CompleteStatuses contains all CloudFormation status strings that we consider to be complete for a vpn
var FailedStatuses = []string{ cloudformation.StackStatusCreateFailed, cloudformation.StackStatusRollbackComplete, cloudformation.StackStatusRollbackFailed, cloudformation.StackStatusUpdateRollbackFailed, cloudformation.StackStatusUpdateRollbackComplete, cloudformation.StackStatusDeleteFailed, }
FailedStatuses contains all CloudFormation status strings that we consider to be failed for a vpn
var PendingStatuses = []string{ cloudformation.StackStatusCreateInProgress, cloudformation.StackStatusDeleteInProgress, cloudformation.StackStatusRollbackInProgress, cloudformation.StackStatusUpdateCompleteCleanupInProgress, cloudformation.StackStatusUpdateInProgress, cloudformation.StackStatusUpdateRollbackCompleteCleanupInProgress, cloudformation.StackStatusUpdateRollbackInProgress, cloudformation.StackStatusReviewInProgress, }
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 ¶
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 ¶
GetRouteTableIDs takes vpc ID and returns its routetable ids
func IsComplete ¶
IsComplete tests if the specified string is considered a completed cloudformation stack state
func IsFailed ¶
IsFailed tests if the specified string is considered a failed cloudformation stack state
func IsPending ¶
IsPending tests if the specified string is considered a pending cloudformation stack state
func StackDoesNotExist ¶
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 ¶
func (m *MockCloudformationAPI) CreateStack(*cloudformation.CreateStackInput) (*cloudformation.CreateStackOutput, error)
CreateStack mocks the cloudformation CreateStack call and returns an empty output
func (*MockCloudformationAPI) DeleteStack ¶
func (m *MockCloudformationAPI) DeleteStack(*cloudformation.DeleteStackInput) (*cloudformation.DeleteStackOutput, error)
DeleteStack mocks the cloudformation DeleteStack call and returns an empty output
func (*MockCloudformationAPI) DescribeStacks ¶
func (m *MockCloudformationAPI) DescribeStacks(input *cloudformation.DescribeStacksInput) (*cloudformation.DescribeStacksOutput, error)
DescribeStacks mocks the cloudformation DescribeStacks call and returns a sample VPN stack output
type MockEC2API ¶
MockEC2API mocks the ec2 api interface
func (*MockEC2API) DescribeInstances ¶
func (m *MockEC2API) DescribeInstances(*ec2.DescribeInstancesInput) (*ec2.DescribeInstancesOutput, error)
DescribeInstances mocks the ec2 DescribeInstances call and returns the instances stored in the Mock
func (*MockEC2API) DescribeRouteTables ¶
func (m *MockEC2API) DescribeRouteTables(*ec2.DescribeRouteTablesInput) (*ec2.DescribeRouteTablesOutput, error)
DescribeRouteTables mocks the cloudformation DescribeRouteTables call and returns test output
func (*MockEC2API) DescribeVpnConnections ¶
func (m *MockEC2API) DescribeVpnConnections(*ec2.DescribeVpnConnectionsInput) (*ec2.DescribeVpnConnectionsOutput, error)
DescribeVpnConnections mocks the cloudformation DescribeVpnConnections call and returns test output