ec2

package
v0.0.0-...-ebde46d Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Opt

type Opt func(*SnapshotManager)

Opt is the type for Options of the SnapshotManager

func WithBackupTag

func WithBackupTag(t string) Opt

WithBackupTag sets the backup tag key

func WithDeleteAfterTag

func WithDeleteAfterTag(tag string) Opt

WithDeleteAfterTag sets the tag key to be used for indication the deletion date

func WithRetentionTag

func WithRetentionTag(t string) Opt

WithRetentionTag sets the retention tag key

func WithSnapshotSuffix

func WithSnapshotSuffix(suf string) Opt

WithSnapshotSuffix sets the automated snapshot suffix

type RestoreManager

type RestoreManager struct {
	// contains filtered or unexported fields
}

RestoreManager manages a restore operation from an EBS snapshot

func NewRestoreManager

func NewRestoreManager(client *awsec2.EC2, snapshotID, az string, opts ...RestoreOption) *RestoreManager

NewRestoreManager creates a new RestoreManager with the given settings

func (*RestoreManager) Run

func (mgr *RestoreManager) Run(ctx context.Context) (string, error)

Run will perform the actual request and restore the volume

type RestoreOption

type RestoreOption func(*RestoreManager)

RestoreOption is an option passed to the RestoreManager

func RestoreWithEncrypted

func RestoreWithEncrypted(enc bool) RestoreOption

RestoreWithEncrypted sets whether the volume should be encrypted

func RestoreWithIOPS

func RestoreWithIOPS(v int64) RestoreOption

RestoreWithIOPS sets the IOPS to be provisioned for the EBS volume

func RestoreWithKMSKeyID

func RestoreWithKMSKeyID(id string) RestoreOption

RestoreWithKMSKeyID sets the id of KMS key to be used

func RestoreWithSize

func RestoreWithSize(v int64) RestoreOption

RestoreWithSize sets the size of the volume being restored

func RestoreWithType

func RestoreWithType(t string) RestoreOption

RestoreWithType sets the type of the volume

type SnapshotManager

type SnapshotManager struct {
	// contains filtered or unexported fields
}

SnapshotManager manages the snapshot creation and pruning of EC2 EBS-based snapshots

func NewSnapshotManager

func NewSnapshotManager(client *awsec2.EC2, datastore datastore.Datastore, opts ...Opt) *SnapshotManager

NewSnapshotManager creates a new SnapshotManager given an EC2 client and a set of Opts

func (*SnapshotManager) Prune

func (smgr *SnapshotManager) Prune(ctx context.Context) error

Prune deletes all matching EBS snapshots, i.e. snapshots with a delete after tag that is set to a date in the past

func (*SnapshotManager) Snapshot

func (smgr *SnapshotManager) Snapshot(ctx context.Context) error

Snapshot creates EBS snapshots for all matching EBS volumes, i.e. all EBS volumes having a Backup tag and optionally a retention tag set

Jump to

Keyboard shortcuts

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