packerjanitor

package
v0.0.0-...-e620c05 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2023 License: BSD-3-Clause Imports: 6 Imported by: 0

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.

Jump to

Keyboard shortcuts

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