awsadvisor

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2016 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OK   int = 0
	WARN int = 1
	ERR  int = 2
	UNK  int = 3
)

Variables

This section is empty.

Functions

func GetTag

func GetTag(tags []*ec2.Tag, key string) string

Types

type AWSClient

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

type Ami

type Ami struct {
	Ami_id string
}

type AwsAuth

type AwsAuth struct {
	Users        *iam.ListUsersOutput
	UsersDetails *iam.GetAccountAuthorizationDetailsOutput
	CredReport   []*UserReport
	// contains filtered or unexported fields
}

func (*AwsAuth) CheckPasswordPolicy

func (i *AwsAuth) CheckPasswordPolicy(meta interface{}) string

func (*AwsAuth) GetCredentialsReport

func (i *AwsAuth) GetCredentialsReport(meta interface{})

func (*AwsAuth) GetUsers

func (i *AwsAuth) GetUsers(meta interface{})

func (*AwsAuth) GetUsersDetails

func (i *AwsAuth) GetUsersDetails(meta interface{})

func (*AwsAuth) User_has_expired_key

func (i *AwsAuth) User_has_expired_key(meta interface{}, username string, exp_days int16) string

func (*AwsAuth) User_has_mfa

func (i *AwsAuth) User_has_mfa(meta interface{}, username string) bool

func (*AwsAuth) User_has_password

func (i *AwsAuth) User_has_password(meta interface{}, username string) bool

type Billing

type Billing struct {
	Metric, Namespace, DimensionName, DimensionVal string
	Starting                                       int
	Period                                         int64
	Max_bill                                       map[string]float32
}

func (*Billing) GetMetrics

func (b *Billing) GetMetrics(meta interface{}, service_name string)

type Config

type Config struct {
	Awsconf string
	Profile string
	Region  string
	Cfgfile string
	Conf    yamlConfig
}

func (Config) Ami_is_approved

func (c Config) Ami_is_approved(ami string) bool

func (*Config) Connect

func (c *Config) Connect() interface{}

func (Config) Instance_is_excluded

func (c Config) Instance_is_excluded(role string) bool

func (Config) Sg_is_excluded

func (c Config) Sg_is_excluded(sg_id, proto string, port int64) bool

func (Config) User_is_allowed

func (c Config) User_is_allowed(user string) bool

type Cwatch

type Cwatch struct {
	Metric, Namespace, DimensionName, DimensionVal string
	Starting                                       int
	Period                                         int64
}

func (*Cwatch) GetMetrics

func (c *Cwatch) GetMetrics(meta interface{}) (*cloudwatch.GetMetricStatisticsOutput, error)

type EC2

type EC2 struct {
	Instances       *ec2.DescribeInstancesOutput
	Elbs            *elb.DescribeLoadBalancersOutput
	Autoscaled      *autoscaling.DescribeAutoScalingInstancesOutput
	Security_groups *ec2.DescribeSecurityGroupsOutput
	Volumes         *ec2.DescribeVolumesOutput
	// contains filtered or unexported fields
}

func (*EC2) Cloudtrail_is_enabled

func (e *EC2) Cloudtrail_is_enabled(meta interface{}) bool

func (*EC2) GetElbs

func (e *EC2) GetElbs(meta interface{})

func (*EC2) GetInstances

func (e *EC2) GetInstances(meta interface{})

func (*EC2) GetSgs

func (a *EC2) GetSgs(meta interface{})

func (*EC2) GetVolumes

func (e *EC2) GetVolumes(meta interface{})

func (*EC2) IsAutoscaled

func (e *EC2) IsAutoscaled(id string) bool

func (*EC2) Is_attached_to_elb

func (ec2 *EC2) Is_attached_to_elb(sg_id string) string

func (*EC2) Is_attached_to_instance

func (ec2 *EC2) Is_attached_to_instance(sg_id string) string

type EC2Costs

type EC2Costs struct {
	Ondemand map[string]map[string]map[string]struct {
		Region         string
		Price_per_hour float32
		Period         int16
	}
	Reserved map[string]map[string]map[string][]*struct {
		Region         string
		Price_per_hour float32
		Period         int16
	}
	EBS map[string]map[string]struct {
		Region             string
		Price_per_gbmonth  float32
		Price_per_iopmonth float32
	}
}

func (*EC2Costs) GetEBSCost

func (ec2cost *EC2Costs) GetEBSCost(region, voltype string, size, months_run, iops int64) float32

func (*EC2Costs) GetEstimate

func (ec2cost *EC2Costs) GetEstimate(hours_run int64, instance_size, region, platform string) *Estimates

func (*EC2Costs) ParsePrices

func (ec2costs *EC2Costs) ParsePrices(prices_filename string)

type Estimates

type Estimates struct {
	Current_cost  float32
	Reserved_cost map[int16]Reservation
}

type Instance

type Instance struct {
	Name string
	Min  float32
	Max  float32
}

type Output

type Output struct {
	Info_msgs          []string
	Security_err_msgs  []string
	Security_warn_msgs []string
	Utilisation_msgs   []string
	Billing_msgs       []string
	Billing_values     map[string]float32
	Ecode              int
}

func (*Output) End

func (o *Output) End(mode, metric, profile string, account_name string) int

func (*Output) SetError

func (o *Output) SetError()

func (*Output) SetUnknown

func (o *Output) SetUnknown()

func (*Output) SetWarn

func (o *Output) SetWarn()

type PublicInst

type PublicInst struct {
	Role string
}

type Reservation

type Reservation struct {
	Term_cost         float32
	Cost_saving_after int16
	Diff_with_10h     float32
}

type Role

type Role struct {
	Name string
}

type SecurityGroup

type SecurityGroup struct {
	Securitygroup string
	Id            string
	Proto         string
	Port          int64
}

type User

type User struct {
	Username string
}

type UserReport

type UserReport struct {
	UserName         string
	PassLastRotation time.Time
	Key1LastRotation time.Time
	Key2LastRotation time.Time
}

Jump to

Keyboard shortcuts

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