Documentation
¶
Index ¶
Constants ¶
View Source
const ( // RFC8601 is the date/time format used by AWS. RFC8601 = "2006-01-02T15:04:05.000Z" // DryRun is the type of error thrown by AWS when a task fails // because it was run with the DryRun option but would have // otherwise succeeded. DryRun = "DryRunOperation" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PackerClean ¶
type PackerClean struct { Delete bool ExpirationDate time.Time Logger *zap.Logger EC2Client ec2iface.EC2API }
PackerClean is a generic struct used for the various functions.
func (*PackerClean) CleanTerminateInstance ¶
func (p *PackerClean) CleanTerminateInstance(instance *ec2.Instance) error
CleanTerminateInstance -- Terminates an instance and waits until it is gone before returning.
func (*PackerClean) GetPackerInstances ¶
func (p *PackerClean) GetPackerInstances() ([]*ec2.Instance, error)
GetPackerInstances -- find all running instances that are Packer builds older than X and returns them in a list
func (*PackerClean) PurgePackerResource ¶
func (p *PackerClean) PurgePackerResource(instance *ec2.Instance) error
PurgePackerResource -- takes an instance, collects the key and SG for it, terminates the instance, waits until it is dead, and then deletes the key pair and security group.
Click to show internal directories.
Click to hide internal directories.