Skip to content
This repository was archived by the owner on Jul 31, 2025. It is now read-only.

Commit ad96c19

Browse files
committed
syncing from tip
2 parents 0bda570 + 6e42625 commit ad96c19

File tree

69 files changed

+8637
-3536
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+8637
-3536
lines changed

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ matrix:
2626
- os: linux
2727
sudo: required
2828
go: 1.10.x
29+
- os: linux
30+
sudo: required
31+
go: 1.11.x
2932
- os: linux
3033
sudo: required
3134
go: tip
@@ -37,6 +40,8 @@ matrix:
3740
go: 1.9.x
3841
- os: osx
3942
go: 1.10.x
43+
- os: osx
44+
go: 1.11.x
4045
- os: osx
4146
go: tip
4247

CHANGELOG.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,48 @@
1+
Release v1.15.55 (2018-10-15)
2+
===
3+
4+
### Service Client Updates
5+
* `service/lambda`: Updates service API and documentation
6+
* Documentation updates for lambda
7+
* `service/rds`: Updates service API and documentation
8+
* This release adds a new parameter to specify the DB instance or cluster parameter group for restore from DB snapshot and restore to point int time operations. For more information, see Amazon RDS Documentation.
9+
* `service/servicecatalog`: Updates service API, documentation, and paginators
10+
* AWS Service Catalog enables you to reduce administrative maintenance and end-user training while adhering to compliance and security measures. With service actions, you as the administrator can enable end users to perform operational tasks, troubleshoot issues, run approved commands, or request permissions within Service Catalog. Service actions are defined using AWS Systems Manager documents, where you have access to pre-defined actions that implement AWS best practices, such asEC2 stop and reboot, as well as the ability to define custom actions.
11+
12+
Release v1.15.54 (2018-10-12)
13+
===
14+
15+
### Service Client Updates
16+
* `service/cloudtrail`: Updates service API and documentation
17+
* The LookupEvents API now supports two new attribute keys: ReadOnly and AccessKeyId
18+
19+
### SDK Enhancements
20+
* `aws/session`: Add support for credential source(#2201)
21+
* Allows for shared config file to contain `credential_source` with any of the given values `EcsContainer`, `Environment` or `Ec2InstanceMetadata`
22+
23+
Release v1.15.53 (2018-10-11)
24+
===
25+
26+
### Service Client Updates
27+
* `service/athena`: Updates service API and documentation
28+
* 1. GetQueryExecution API changes to return statementType of a submitted Athena query. 2. GetQueryResults API changes to return the number of rows added to a table when a CTAS query is executed.
29+
* `service/directconnect`: Updates service API and documentation
30+
* This release adds support for Jumbo Frames over AWS Direct Connect. You can now set MTU value when creating new virtual interfaces. This release also includes a new API to modify MTU value of existing virtual interfaces.
31+
* `service/ec2`: Updates service API
32+
* You can now launch the smaller-sized G3 instance called g3s.xlarge. G3s.xlarge provides 4 vCPU, 30.5 GB RAM and a NVIDIA Tesla M60 GPU. It is ideal for remote workstations, engineering and architectural applications, and 3D visualizations and rendering for visual effects.
33+
* `service/mediaconvert`: Updates service paginators
34+
* Added Paginators for all the MediaConvert list operations
35+
* `service/transcribe`: Updates service API and documentation
36+
37+
Release v1.15.52 (2018-10-10)
38+
===
39+
40+
### Service Client Updates
41+
* `service/comprehend`: Updates service API
42+
* `service/es`: Updates service API and documentation
43+
* Amazon Elasticsearch Service now supports customer-scheduled service software updates. When new service software becomes available, you can request an update to your domain and benefit from new features more quickly. If you take no action, we update the service software automatically after a certain time frame.
44+
* `service/transcribe`: Updates service API and documentation
45+
146
Release v1.15.51 (2018-10-09)
247
===
348

Makefile

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ ci-test-generate-validate:
8585
integration: get-deps-tests integ-custom smoke-tests performance
8686

8787
integ-custom:
88-
go test -tags "integration" ./awstesting/integration/customizations/...
88+
go test -tags "integration" -v ./awstesting/integration/customizations/...
8989

9090
cleanup-integ:
9191
go run -tags "integration" ./awstesting/cmd/bucket_cleanup/main.go "aws-sdk-go-integration"
@@ -134,19 +134,26 @@ sandbox-test-go18: sandbox-build-go18
134134
docker run -t aws-sdk-go-1.8
135135

136136
sandbox-build-go19:
137-
docker build -f ./awstesting/sandbox/Dockerfile.test.go1.8 -t "aws-sdk-go-1.9" .
137+
docker build -f ./awstesting/sandbox/Dockerfile.test.go1.9 -t "aws-sdk-go-1.9" .
138138
sandbox-go19: sandbox-build-go19
139139
docker run -i -t aws-sdk-go-1.9 bash
140140
sandbox-test-go19: sandbox-build-go19
141141
docker run -t aws-sdk-go-1.9
142142

143143
sandbox-build-go110:
144-
docker build -f ./awstesting/sandbox/Dockerfile.test.go1.8 -t "aws-sdk-go-1.10" .
144+
docker build -f ./awstesting/sandbox/Dockerfile.test.go1.10 -t "aws-sdk-go-1.10" .
145145
sandbox-go110: sandbox-build-go110
146146
docker run -i -t aws-sdk-go-1.10 bash
147147
sandbox-test-go110: sandbox-build-go110
148148
docker run -t aws-sdk-go-1.10
149149

150+
sandbox-build-go111:
151+
docker build -f ./awstesting/sandbox/Dockerfile.test.go1.11 -t "aws-sdk-go-1.11" .
152+
sandbox-go111: sandbox-build-go111
153+
docker run -i -t aws-sdk-go-1.11 bash
154+
sandbox-test-go111: sandbox-build-go111
155+
docker run -t aws-sdk-go-1.11
156+
150157
sandbox-build-gotip:
151158
@echo "Run make update-aws-golang-tip, if this test fails because missing aws-golang:tip container"
152159
docker build -f ./awstesting/sandbox/Dockerfile.test.gotip -t "aws-sdk-go-tip" .
@@ -193,7 +200,7 @@ get-deps-tests:
193200

194201
get-deps-verify:
195202
@echo "go get SDK verification utilities"
196-
@if [ \( -z "${SDK_GO_1_4}" \) -a \( -z "${SDK_GO_1_5}" \) ]; then go get github.com/golang/lint/golint; else echo "skipped getting golint"; fi
203+
@if [ \( -z "${SDK_GO_1_4}" \) -a \( -z "${SDK_GO_1_5}" \) ]; then go get golang.org/x/lint/golint; else echo "skipped getting golint"; fi
197204

198205
bench:
199206
@echo "go bench SDK packages"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![API Reference](http://img.shields.io/badge/api-reference-blue.svg)](http://docs.aws.amazon.com/sdk-for-go/api) [![Join the chat at https://gitter.im/aws/aws-sdk-go](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/aws/aws-sdk-go?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status](https://img.shields.io/travis/aws/aws-sdk-go.svg)](https://travis-ci.org/aws/aws-sdk-go) [![Apache V2 License](http://img.shields.io/badge/license-Apache%20V2-blue.svg)](https://github.com/aws/aws-sdk-go/blob/master/LICENSE.txt)
1+
[![API Reference](https://img.shields.io/badge/api-reference-blue.svg)](https://docs.aws.amazon.com/sdk-for-go/api) [![Join the chat at https://gitter.im/aws/aws-sdk-go](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/aws/aws-sdk-go?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status](https://img.shields.io/travis/aws/aws-sdk-go.svg)](https://travis-ci.org/aws/aws-sdk-go) [![Apache V2 License](https://img.shields.io/badge/license-Apache%20V2-blue.svg)](https://github.com/aws/aws-sdk-go/blob/master/LICENSE.txt)
22

33
# AWS SDK for Go
44

aws/csm/metric.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,6 @@ type metric struct {
4848
DNSLatency *int `json:"DnsLatency,omitempty"`
4949
TCPLatency *int `json:"TcpLatency,omitempty"`
5050
SSLLatency *int `json:"SslLatency,omitempty"`
51+
52+
MaxRetriesExceeded *int `json:"MaxRetriesExceeded,omitempty"`
5153
}

aws/csm/reporter.go

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,16 @@ func (rep *Reporter) sendAPICallMetric(r *request.Request) {
112112

113113
now := time.Now()
114114
m := metric{
115-
ClientID: aws.String(rep.clientID),
116-
API: aws.String(r.Operation.Name),
117-
Service: aws.String(r.ClientInfo.ServiceID),
118-
Timestamp: (*metricTime)(&now),
119-
Type: aws.String("ApiCall"),
120-
AttemptCount: aws.Int(r.RetryCount + 1),
121-
Region: r.Config.Region,
122-
Latency: aws.Int(int(time.Now().Sub(r.Time) / time.Millisecond)),
123-
XAmzRequestID: aws.String(r.RequestID),
115+
ClientID: aws.String(rep.clientID),
116+
API: aws.String(r.Operation.Name),
117+
Service: aws.String(r.ClientInfo.ServiceID),
118+
Timestamp: (*metricTime)(&now),
119+
Type: aws.String("ApiCall"),
120+
AttemptCount: aws.Int(r.RetryCount + 1),
121+
Region: r.Config.Region,
122+
Latency: aws.Int(int(time.Now().Sub(r.Time) / time.Millisecond)),
123+
XAmzRequestID: aws.String(r.RequestID),
124+
MaxRetriesExceeded: aws.Int(boolIntValue(r.RetryCount >= r.MaxRetries())),
124125
}
125126

126127
// TODO: Probably want to figure something out for logging dropped
@@ -230,3 +231,12 @@ func (rep *Reporter) InjectHandlers(handlers *request.Handlers) {
230231

231232
handlers.AfterRetry.PushFrontNamed(apiCallAttemptHandler)
232233
}
234+
235+
// boolIntValue return 1 for true and 0 for false.
236+
func boolIntValue(b bool) int {
237+
if b {
238+
return 1
239+
}
240+
241+
return 0
242+
}

aws/csm/reporter_internal_test.go

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
package csm
2+
3+
import (
4+
"net/http"
5+
"testing"
6+
7+
"github.com/aws/aws-sdk-go/aws"
8+
"github.com/aws/aws-sdk-go/aws/client"
9+
"github.com/aws/aws-sdk-go/aws/client/metadata"
10+
"github.com/aws/aws-sdk-go/aws/credentials"
11+
"github.com/aws/aws-sdk-go/aws/defaults"
12+
"github.com/aws/aws-sdk-go/aws/request"
13+
)
14+
15+
func TestMaxRetriesExceeded(t *testing.T) {
16+
md := metadata.ClientInfo{
17+
Endpoint: "http://127.0.0.1",
18+
}
19+
20+
cfg := aws.Config{
21+
Region: aws.String("foo"),
22+
Credentials: credentials.NewStaticCredentials("", "", ""),
23+
}
24+
25+
op := &request.Operation{}
26+
cases := []struct {
27+
name string
28+
httpStatusCode int
29+
expectedMaxRetriesValue int
30+
expectedMetrics int
31+
}{
32+
{
33+
name: "max retry reached",
34+
httpStatusCode: http.StatusBadGateway,
35+
expectedMaxRetriesValue: 1,
36+
},
37+
{
38+
name: "status ok",
39+
httpStatusCode: http.StatusOK,
40+
expectedMaxRetriesValue: 0,
41+
},
42+
}
43+
44+
for _, c := range cases {
45+
r := request.New(cfg, md, defaults.Handlers(), client.DefaultRetryer{NumMaxRetries: 2}, op, nil, nil)
46+
reporter := newReporter("", "")
47+
r.Handlers.Send.Clear()
48+
reporter.InjectHandlers(&r.Handlers)
49+
50+
r.Handlers.Send.PushBack(func(r *request.Request) {
51+
r.HTTPResponse = &http.Response{
52+
StatusCode: c.httpStatusCode,
53+
}
54+
})
55+
r.Send()
56+
57+
for {
58+
m := <-reporter.metricsCh.ch
59+
60+
if *m.Type != "ApiCall" {
61+
// ignore non-ApiCall metrics since MaxRetriesExceeded is only on ApiCall events
62+
continue
63+
}
64+
65+
if val := *m.MaxRetriesExceeded; val != c.expectedMaxRetriesValue {
66+
t.Errorf("%s: expected %d, but received %d", c.name, c.expectedMaxRetriesValue, val)
67+
}
68+
69+
break
70+
}
71+
}
72+
}

aws/csm/reporter_test.go

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package csm_test
22

33
import (
44
"fmt"
5-
"net"
65
"net/http"
76
"net/http/httptest"
87
"strings"
@@ -18,41 +17,6 @@ import (
1817
"github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
1918
)
2019

21-
func startUDPServer(done chan struct{}, fn func([]byte)) (string, error) {
22-
addr, err := net.ResolveUDPAddr("udp", "127.0.0.1:0")
23-
if err != nil {
24-
return "", err
25-
}
26-
27-
conn, err := net.ListenUDP("udp", addr)
28-
if err != nil {
29-
return "", err
30-
}
31-
32-
buf := make([]byte, 1024)
33-
i := 0
34-
go func() {
35-
defer conn.Close()
36-
for {
37-
i++
38-
select {
39-
case <-done:
40-
return
41-
default:
42-
}
43-
44-
n, _, err := conn.ReadFromUDP(buf)
45-
fn(buf[:n])
46-
47-
if err != nil {
48-
panic(err)
49-
}
50-
}
51-
}()
52-
53-
return conn.LocalAddr().String(), nil
54-
}
55-
5620
func TestReportingMetrics(t *testing.T) {
5721
reporter := csm.Get()
5822
if reporter == nil {

aws/defaults/defaults.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"github.com/aws/aws-sdk-go/aws/ec2metadata"
2525
"github.com/aws/aws-sdk-go/aws/endpoints"
2626
"github.com/aws/aws-sdk-go/aws/request"
27+
"github.com/aws/aws-sdk-go/internal/shareddefaults"
2728
)
2829

2930
// A Defaults provides a collection of default values for SDK clients.
@@ -114,7 +115,6 @@ func CredProviders(cfg *aws.Config, handlers request.Handlers) []credentials.Pro
114115
const (
115116
httpProviderAuthorizationEnvVar = "AWS_CONTAINER_AUTHORIZATION_TOKEN"
116117
httpProviderEnvVar = "AWS_CONTAINER_CREDENTIALS_FULL_URI"
117-
ecsCredsProviderEnvVar = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"
118118
)
119119

120120
// RemoteCredProvider returns a credentials provider for the default remote
@@ -124,8 +124,8 @@ func RemoteCredProvider(cfg aws.Config, handlers request.Handlers) credentials.P
124124
return localHTTPCredProvider(cfg, handlers, u)
125125
}
126126

127-
if uri := os.Getenv(ecsCredsProviderEnvVar); len(uri) > 0 {
128-
u := fmt.Sprintf("http://169.254.170.2%s", uri)
127+
if uri := os.Getenv(shareddefaults.ECSCredsProviderEnvVar); len(uri) > 0 {
128+
u := fmt.Sprintf("%s%s", shareddefaults.ECSContainerCredentialsURI, uri)
129129
return httpCredProvider(cfg, handlers, u)
130130
}
131131

aws/defaults/defaults_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds"
1111
"github.com/aws/aws-sdk-go/aws/credentials/endpointcreds"
1212
"github.com/aws/aws-sdk-go/aws/request"
13+
"github.com/aws/aws-sdk-go/internal/shareddefaults"
1314
)
1415

1516
func TestHTTPCredProvider(t *testing.T) {
@@ -90,7 +91,7 @@ func TestHTTPCredProvider(t *testing.T) {
9091

9192
func TestECSCredProvider(t *testing.T) {
9293
defer os.Clearenv()
93-
os.Setenv(ecsCredsProviderEnvVar, "/abc/123")
94+
os.Setenv(shareddefaults.ECSCredsProviderEnvVar, "/abc/123")
9495

9596
provider := RemoteCredProvider(aws.Config{}, request.Handlers{})
9697
if provider == nil {

0 commit comments

Comments
 (0)