aws

package
v1.7.0-uptimefronte.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssumeRole

func AssumeRole(roleArn string, region string, sessionName string) (*session.Session, error)

func CEClientFromEnv added in v1.5.0

func CEClientFromEnv() (*costexplorer.CostExplorer, error)

CEClientFromEnv returns a cost explorer client

func CWClientFromEnv added in v1.5.0

func CWClientFromEnv(region string) (*cloudwatch.CloudWatch, error)

CWClientFromEnv returns a cloudwatch client

func CostAndUsage

func CostAndUsage(startDate time.Time, endDate time.Time, granularity string, dateFormat string) (*costexplorer.GetCostAndUsageOutput, error)

func CostAndUsageInput

func CostAndUsageInput(startDate time.Time, endDate time.Time, granularity string, dateFormat string) *costexplorer.GetCostAndUsageInput

func GetListOfMetrics added in v1.5.0

func GetListOfMetrics(cw *cloudwatch.CloudWatch) (metrics []*cloudwatch.Metric)

GetListOfMetrics returns all metrics that are tracking uptime percentages within this account which can then be used to get the statistics to show uptime amount

func GetMetricsStats added in v1.5.0

func GetMetricsStats(cw *cloudwatch.CloudWatch,
	metrics []*cloudwatch.Metric,
	start time.Time,
	end time.Time,
) (datapoints []*cloudwatch.Datapoint, err error)

GetMetricsStats returns all data points for the health check metrics - so allows us to track the % uptime of the service

As the namespace and metrics are identical, we can do one call to hte api by merging the dimension values together

func NewSession

func NewSession(id string, secret string, token string, region string) (*session.Session, error)

func NewSessionFromEnv

func NewSessionFromEnv() (*session.Session, error)

func NewSessionFromEnvWithRegion

func NewSessionFromEnvWithRegion(region string) (*session.Session, error)

func RoleArn

func RoleArn(account string, role string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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