Example #1
0
func NewFromEnv() *Client {
	cl := &Client{
		Client: aws.NewFromEnv(),
	}
	if reg := os.Getenv("AWS_DEFAULT_REGION"); reg != "" {
		cl.CustomEndpointHost = "s3-" + reg + ".amazonaws.com"
	}
	return cl
}
Example #2
0
func cloudwatchList() error {
	client := cloudwatch.Client{Client: aws.NewFromEnv()}
	rsp, e := client.ListMetrics()
	if e != nil {
		return e
	}
	table := gocli.NewTable()
	for _, m := range rsp.Metrics {
		table.Add(m.Namespace, m.MetricName)
		for _, d := range m.Dimensions {
			table.Add("", d.Name, d.Value)
		}
	}
	fmt.Println(table)
	return nil
}
Example #3
0
func NewFromEnv() *Client {
	return &Client{Client: aws.NewFromEnv()}
}
Example #4
0
func NewFromEnv() *Client {
	return &Client{
		aws.NewFromEnv(),
	}
}