aws

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Disk

type Disk struct {
	types.Volume
	// contains filtered or unexported fields
}

Disk holds information about an AWS EC2 volume.

func (*Disk) CreatedAt

func (d *Disk) CreatedAt() time.Time

CreatedAt returns the time when the AWS EC2 volume was created.

func (*Disk) DiskType added in v0.0.2

func (d *Disk) DiskType() unused.DiskType

DiskType Type returns the type of this AWS EC2 volume.

func (*Disk) ID

func (d *Disk) ID() string

ID returns the volume ID of this AWS EC2 volume.

func (*Disk) LastUsedAt

func (d *Disk) LastUsedAt() time.Time

LastUsedAt returns a zero time.Time value, as AWS does not provide this information.

func (*Disk) Meta

func (d *Disk) Meta() unused.Meta

Meta returns the disk metadata.

func (*Disk) Name

func (d *Disk) Name() string

Name returns the name of this AWS EC2 volume.

AWS EC2 volumes do not have a name property, instead they store the name in tags. This method will try to find the Name or CSIVolumeName, otherwise it will return empty.

func (*Disk) Provider

func (d *Disk) Provider() unused.Provider

Provider returns a reference to the provider used to instantiate this disk.

func (*Disk) SizeGB added in v0.0.2

func (d *Disk) SizeGB() int

SizeGB returns the size of this AWS EC2 volume in GB.

type Provider

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

Provider implements unused.Provider for AWS.

func NewProvider

func NewProvider(logger *logfmt.Logger, client *ec2.Client, meta unused.Meta) (*Provider, error)

NewProvider creates a new AWS unused.Provider.

A valid EC2 client must be supplied in order to list the unused resources. The metadata passed will be used to identify the provider.

func (*Provider) Delete

func (p *Provider) Delete(ctx context.Context, disk unused.Disk) error

Delete deletes the given disk from AWS.

func (*Provider) ListUnusedDisks

func (p *Provider) ListUnusedDisks(ctx context.Context) (unused.Disks, error)

ListUnusedDisks returns all the AWS EC2 volumes that are available, ie. not used by any other resource.

func (*Provider) Meta

func (p *Provider) Meta() unused.Meta

Meta returns the provider metadata.

func (*Provider) Name

func (p *Provider) Name() string

Name returns AWS.

Jump to

Keyboard shortcuts

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