Documentation ¶
Index ¶
- func DownloadFile(filepath string, url string) error
- func ExitErrorHandler(err error)
- func GetInstanceName(i *ec2.Instance) string
- func GetTagValue(tags []*ec2.Tag, key string) string
- func IsSubnetEmpty(subnet *ec2.Subnet) bool
- func RemoveARN(s *string) string
- func StringSliceContains(slice []string, s string) bool
- func SubnetSize(cidr string) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadFile ¶
DownloadFile downloads the file at the given URL to the local filepath.
func ExitErrorHandler ¶
func ExitErrorHandler(err error)
ExitErrorHandler exits the program with a non-zero exit status if err != nil
func GetInstanceName ¶
GetInstanceName returns the name for an ec2.Instance. If there is no associated name tag, it returns an empty string.
func GetTagValue ¶
GetTagValue iterates over the tags and returns the value of the given tag if it exists, otherwise ""
func IsSubnetEmpty ¶
IsSubnetEmpty returns true/false depending on if the subnet is empty. This is tailored to Amazon's implementation where they reserve 5 IP addresses per subnet. So, we will consider the subnet empty if its available IP Addresses is equal to the subnet size minus 5
func StringSliceContains ¶
StringSliceContains returns true if the slice contains the string, otherwise false
func SubnetSize ¶
SubnetSize calculates the number of addresses in a given CIDR
Types ¶
This section is empty.