func NewFromEnv() *Client { cl := &Client{ Client: aws.NewFromEnv(), } if reg := os.Getenv("AWS_DEFAULT_REGION"); reg != "" { cl.CustomEndpointHost = "s3-" + reg + ".amazonaws.com" } return cl }
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 }
func NewFromEnv() *Client { return &Client{Client: aws.NewFromEnv()} }
func NewFromEnv() *Client { return &Client{ aws.NewFromEnv(), } }