views

package
v0.0.0-...-4748bbb Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmptySubnets

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

EmptySubnets is a view which shows subnets that are empty

func NewEmptySubnets

func NewEmptySubnets(subnets []*ec2.Subnet) *EmptySubnets

NewEmptySubnets creates a new empty subnets view

func (*EmptySubnets) Render

func (es *EmptySubnets) Render(w io.Writer)

Render implements views.View

type IAMAccessKeysAudit

type IAMAccessKeysAudit struct {
	Users    map[string][]*iam.AccessKeyMetadata
	LastUsed map[string]*iam.AccessKeyLastUsed
}

func (*IAMAccessKeysAudit) Print

func (v *IAMAccessKeysAudit) Print()

Print prints the table to stdout

type InstanceTypeReservationUtilization

type InstanceTypeReservationUtilization struct {
	InstanceType string
	NumReserved  float64
	NumRunning   float64
}

InstanceTypeReservationUtilization keeps track of how many of a particular Instance type are running

func (*InstanceTypeReservationUtilization) HasUnused

HasUnused returns whether or not the instance type has reservations that aren't currently being used.

func (*InstanceTypeReservationUtilization) String

func (*InstanceTypeReservationUtilization) Unreserved

Unreserved returns the difference between the number of running instances and the number of reserved instances. A negative result implies there are more instances reserved than running.

type InstancesBySubnet

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

InstancesBySubnet is a view for showing the instances grouped by subnet.

func NewInstancesBySubnet

func NewInstancesBySubnet(instances []*ec2.Instance, subnets []*ec2.Subnet) *InstancesBySubnet

NewInstancesBySubnet creates a new view from the instances and subnets

func (*InstancesBySubnet) AddInstance

func (ibs *InstancesBySubnet) AddInstance(i *ec2.Instance)

AddInstance adds a new instance to the view

func (*InstancesBySubnet) AddSubnet

func (ibs *InstancesBySubnet) AddSubnet(s *ec2.Subnet)

AddSubnet adds a new subnet to the view

func (*InstancesBySubnet) Print

func (ibs *InstancesBySubnet) Print()

Print prints the InstancesBySubnet view

type RDSReservationUtilization

type RDSReservationUtilization struct {
	InstanceTypeReservationUtilizations map[string]*InstanceTypeReservationUtilization
}

RDSReservationUtilization shows which instance types & families we are utilizing instances in.

func NewRDSReservationUtilization

func NewRDSReservationUtilization(running []*rds.DBInstance, reservations []*rds.ReservedDBInstance) *RDSReservationUtilization

NewRDSReservationUtilization Creates a new view for the reserved utilization.

func (*RDSReservationUtilization) Print

func (ru *RDSReservationUtilization) Print()

Print prints the table to stdout

func (*RDSReservationUtilization) SortedInstanceTypes

func (ru *RDSReservationUtilization) SortedInstanceTypes() []string

SortedInstanceTypes returns a sorted slice of the instance types

type RDSSnapshotAudit

type RDSSnapshotAudit struct {
	Snapshots []*rds.DBSnapshot
	Instances []*rds.DBInstance
}

RDSSnapshotAudit gives an overview of the RDS snapshots, with their instances, and how much storage is being used

func NewRDSSnapshotAudit

func NewRDSSnapshotAudit(snapshots []*rds.DBSnapshot, instances []*rds.DBInstance) *RDSSnapshotAudit

NewRDSSnapshotAudit returns an audit view for comparing snapshots vs running instances

func (*RDSSnapshotAudit) NumRunningInstances

func (audit *RDSSnapshotAudit) NumRunningInstances() int

NumRunningInstances returns the number of running instances

func (*RDSSnapshotAudit) NumSnapshots

func (audit *RDSSnapshotAudit) NumSnapshots() int

NumSnapshots returns the number of snapshots

func (*RDSSnapshotAudit) OldInstancesWithSnapshots

func (audit *RDSSnapshotAudit) OldInstancesWithSnapshots() map[string][]*rds.DBSnapshot

OldInstancesWithSnapshots returns a map whose keys are DBInstanceIdentifiers which no longer exist. The values are slices of *rds.DBSnapshots

func (*RDSSnapshotAudit) Render

func (audit *RDSSnapshotAudit) Render(w io.Writer)

Render renders the table to the io.Writer

func (*RDSSnapshotAudit) TotalRunningStorageGB

func (audit *RDSSnapshotAudit) TotalRunningStorageGB() int64

TotalRunningStorageGB returns the total storage of running intances in GB

func (*RDSSnapshotAudit) TotalVirtualSnapshotStorageGB

func (audit *RDSSnapshotAudit) TotalVirtualSnapshotStorageGB() int64

TotalVirtualSnapshotStorageGB returns the total storage of snapshots in GB. This is the "virtual" storage though as the snapshots only store deltas

type ReservationUtilization

type ReservationUtilization struct {
	Running                             []*ec2.Instance
	Reservations                        []*ec2.ReservedInstances
	InstanceTypeReservationUtilizations map[string]*InstanceTypeReservationUtilization
	// contains filtered or unexported fields
}

ReservationUtilization shows which instance types & families we are utilizing instances in.

func NewReservationUtilization

func NewReservationUtilization(running []*ec2.Instance, reservations []*ec2.ReservedInstances, opts ReservationUtilizationOptions) *ReservationUtilization

NewReservationUtilization Creates a new view for the reserved utilization.

func (*ReservationUtilization) Print

func (ru *ReservationUtilization) Print()

Print prints the table to stdout

func (*ReservationUtilization) SortedInstanceTypes

func (ru *ReservationUtilization) SortedInstanceTypes() []string

SortedInstanceTypes returns a sorted slice of the instance types

type ReservationUtilizationOptions

type ReservationUtilizationOptions struct {
	OnlyUnmatched bool
}

ReservationUtilizationOptions are options which modify the ReservationUtilization view.

type S3ReplicationAudit

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

S3ReplicationAudit is a S3ReplicationAudit View

func NewS3ReplicationAudit

func NewS3ReplicationAudit(buckets []*s3.Bucket, replications []*s3.GetBucketReplicationOutput) S3ReplicationAudit

NewS3ReplicationAudit initializes the S3 Replication Audit from the buckets.

func (*S3ReplicationAudit) Render

func (v *S3ReplicationAudit) Render(w io.Writer)

Render implments view.View and renders the table

type SecurityGroupAudit

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

SecurityGroupAudit is a view for auditing security groups.

func NewSecurityGroupAudit

func NewSecurityGroupAudit(securityGroups []*ec2.SecurityGroup, networkInterfaces []*ec2.NetworkInterface) *SecurityGroupAudit

NewSecurityGroupAudit creates and initializes a new security group audit

func (*SecurityGroupAudit) Print

func (sga *SecurityGroupAudit) Print()

Print prints the SecurityGroupAudit view

type VPCFreeSubnets

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

VPCFreeSubnets gives you available subnet ranges for a VPC

func NewVPCFreeSubnets

func NewVPCFreeSubnets(vpcs []*ec2.Vpc, subnets []*ec2.Subnet) *VPCFreeSubnets

NewVPCFreeSubnets creates a new view for showing free subnets in each VPC

func (*VPCFreeSubnets) Render

func (vfs *VPCFreeSubnets) Render(w io.Writer)

Render renders the view and implements view

type View

type View interface {
	Render(io.Writer)
}

View is an interface which supports the Render method.

Jump to

Keyboard shortcuts

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