Skip to content

Commit 3ddfe5c

Browse files
Release v1.35.0 (#3569)
Release v1.35.0 (2020-09-30) === ### Service Client Updates * `service/application-autoscaling`: Updates service API and documentation * `service/datasync`: Updates service API and documentation * `service/directconnect`: Updates service documentation * Documentation updates for AWS Direct Connect. * `service/elasticmapreduce`: Updates service API and documentation * Amazon EMR customers can now use EC2 placement group to influence the placement of master nodes in a high-availability (HA) cluster across distinct underlying hardware to improve cluster availability. * `service/imagebuilder`: Updates service API and documentation * `service/iot`: Updates service API and documentation * AWS IoT Rules Engine adds Timestream action. The Timestream rule action lets you stream time-series data from IoT sensors and applications to Amazon Timestream databases for time series analysis. * `service/mediaconnect`: Updates service API, documentation, and paginators * `service/pinpoint`: Updates service API and documentation * Amazon Pinpoint - Features - Customers can start a journey based on an event being triggered by an endpoint or user. * `service/s3`: Updates service API, documentation, and examples * Amazon S3 on Outposts expands object storage to on-premises AWS Outposts environments, enabling you to store and retrieve objects using S3 APIs and features. * `service/s3outposts`: Adds new service * `service/securityhub`: Updates service API and documentation ### SDK Features * `service/s3`: Adds support for outposts access point ARNs. * `service/s3control`: Adds support for S3 on outposts access point and S3 on outposts bucket ARNs.
1 parent 235bdca commit 3ddfe5c

Some content is hidden

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

80 files changed

+26168
-6549
lines changed

CHANGELOG.md

+25
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
Release v1.35.0 (2020-09-30)
2+
===
3+
4+
### Service Client Updates
5+
* `service/application-autoscaling`: Updates service API and documentation
6+
* `service/datasync`: Updates service API and documentation
7+
* `service/directconnect`: Updates service documentation
8+
* Documentation updates for AWS Direct Connect.
9+
* `service/elasticmapreduce`: Updates service API and documentation
10+
* Amazon EMR customers can now use EC2 placement group to influence the placement of master nodes in a high-availability (HA) cluster across distinct underlying hardware to improve cluster availability.
11+
* `service/imagebuilder`: Updates service API and documentation
12+
* `service/iot`: Updates service API and documentation
13+
* AWS IoT Rules Engine adds Timestream action. The Timestream rule action lets you stream time-series data from IoT sensors and applications to Amazon Timestream databases for time series analysis.
14+
* `service/mediaconnect`: Updates service API, documentation, and paginators
15+
* `service/pinpoint`: Updates service API and documentation
16+
* Amazon Pinpoint - Features - Customers can start a journey based on an event being triggered by an endpoint or user.
17+
* `service/s3`: Updates service API, documentation, and examples
18+
* Amazon S3 on Outposts expands object storage to on-premises AWS Outposts environments, enabling you to store and retrieve objects using S3 APIs and features.
19+
* `service/s3outposts`: Adds new service
20+
* `service/securityhub`: Updates service API and documentation
21+
22+
### SDK Features
23+
* `service/s3`: Adds support for outposts access point ARNs.
24+
* `service/s3control`: Adds support for S3 on outposts access point and S3 on outposts bucket ARNs.
25+
126
Release v1.34.34 (2020-09-29)
227
===
328

aws/endpoints/defaults.go

+45-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

aws/version.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ package aws
55
const SDKName = "aws-sdk-go"
66

77
// SDKVersion is the version of this SDK
8-
const SDKVersion = "1.34.34"
8+
const SDKVersion = "1.35.0"

service/s3/internal/arn/accesspoint_arn.go renamed to internal/s3shared/arn/accesspoint_arn.go

+10-5
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,28 @@ func (a AccessPointARN) GetARN() arn.ARN {
1919

2020
// ParseAccessPointResource attempts to parse the ARN's resource as an
2121
// AccessPoint resource.
22+
//
23+
// Supported Access point resource format:
24+
// - Access point format: arn:{partition}:s3:{region}:{accountId}:accesspoint/{accesspointName}
25+
// - example: arn.aws.s3.us-west-2.012345678901:accesspoint/myaccesspoint
26+
//
2227
func ParseAccessPointResource(a arn.ARN, resParts []string) (AccessPointARN, error) {
2328
if len(a.Region) == 0 {
24-
return AccessPointARN{}, InvalidARNError{a, "region not set"}
29+
return AccessPointARN{}, InvalidARNError{ARN: a, Reason: "region not set"}
2530
}
2631
if len(a.AccountID) == 0 {
27-
return AccessPointARN{}, InvalidARNError{a, "account-id not set"}
32+
return AccessPointARN{}, InvalidARNError{ARN: a, Reason: "account-id not set"}
2833
}
2934
if len(resParts) == 0 {
30-
return AccessPointARN{}, InvalidARNError{a, "resource-id not set"}
35+
return AccessPointARN{}, InvalidARNError{ARN: a, Reason: "resource-id not set"}
3136
}
3237
if len(resParts) > 1 {
33-
return AccessPointARN{}, InvalidARNError{a, "sub resource not supported"}
38+
return AccessPointARN{}, InvalidARNError{ARN: a, Reason: "sub resource not supported"}
3439
}
3540

3641
resID := resParts[0]
3742
if len(strings.TrimSpace(resID)) == 0 {
38-
return AccessPointARN{}, InvalidARNError{a, "resource-id not set"}
43+
return AccessPointARN{}, InvalidARNError{ARN: a, Reason: "resource-id not set"}
3944
}
4045

4146
return AccessPointARN{

service/s3/internal/arn/arn.go renamed to internal/s3shared/arn/arn.go

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package arn
22

33
import (
4+
"fmt"
45
"strings"
56

67
"github.com/aws/aws-sdk-go/aws/arn"
@@ -25,13 +26,14 @@ func ParseResource(s string, resParser ResourceParser) (resARN Resource, err err
2526
}
2627

2728
if len(a.Partition) == 0 {
28-
return nil, InvalidARNError{a, "partition not set"}
29+
return nil, InvalidARNError{ARN: a, Reason: "partition not set"}
2930
}
30-
if a.Service != "s3" {
31-
return nil, InvalidARNError{a, "service is not S3"}
31+
32+
if a.Service != "s3" && a.Service != "s3-outposts" {
33+
return nil, InvalidARNError{ARN: a, Reason: "service is not supported"}
3234
}
3335
if len(a.Resource) == 0 {
34-
return nil, InvalidARNError{a, "resource not set"}
36+
return nil, InvalidARNError{ARN: a, Reason: "resource not set"}
3537
}
3638

3739
return resParser(a)
@@ -66,6 +68,7 @@ type InvalidARNError struct {
6668
Reason string
6769
}
6870

71+
// Error returns a string denoting the occurred InvalidARNError
6972
func (e InvalidARNError) Error() string {
70-
return "invalid Amazon S3 ARN, " + e.Reason + ", " + e.ARN.String()
73+
return fmt.Sprintf("invalid Amazon %s ARN, %s, %s", e.ARN.Service, e.Reason, e.ARN.String())
7174
}

service/s3/internal/arn/arn_test.go renamed to internal/s3shared/arn/arn_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func TestParseResource(t *testing.T) {
2727
},
2828
"Not S3 ARN": {
2929
Input: "arn:aws:sqs:us-west-2:012345678901:accesspoint",
30-
ExpectErr: "service is not S3",
30+
ExpectErr: "service is not supported",
3131
},
3232
"No Resource": {
3333
Input: "arn:aws:s3:us-west-2:012345678901:",
@@ -120,7 +120,7 @@ func mappedResourceParser(kinds map[string]func(arn.ARN, []string) (Resource, er
120120

121121
fn, ok := kinds[parts[0]]
122122
if !ok {
123-
return nil, InvalidARNError{a, "unknown resource type"}
123+
return nil, InvalidARNError{ARN: a, Reason: "unknown resource type"}
124124
}
125125
return fn(a, parts[1:])
126126
}

internal/s3shared/arn/outpost_arn.go

+126
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
package arn
2+
3+
import (
4+
"strings"
5+
6+
"github.com/aws/aws-sdk-go/aws/arn"
7+
)
8+
9+
// OutpostARN interface that should be satisfied by outpost ARNs
10+
type OutpostARN interface {
11+
Resource
12+
GetOutpostID() string
13+
}
14+
15+
// ParseOutpostARNResource will parse a provided ARNs resource using the appropriate ARN format
16+
// and return a specific OutpostARN type
17+
//
18+
// Currently supported outpost ARN formats:
19+
// * Outpost AccessPoint ARN format:
20+
// - ARN format: arn:{partition}:s3-outposts:{region}:{accountId}:outpost/{outpostId}/accesspoint/{accesspointName}
21+
// - example: arn:aws:s3-outposts:us-west-2:012345678901:outpost/op-1234567890123456/accesspoint/myaccesspoint
22+
//
23+
// * Outpost Bucket ARN format:
24+
// - ARN format: arn:{partition}:s3-outposts:{region}:{accountId}:outpost/{outpostId}/bucket/{bucketName}
25+
// - example: arn:aws:s3-outposts:us-west-2:012345678901:outpost/op-1234567890123456/bucket/mybucket
26+
//
27+
// Other outpost ARN formats may be supported and added in the future.
28+
//
29+
func ParseOutpostARNResource(a arn.ARN, resParts []string) (OutpostARN, error) {
30+
if len(a.Region) == 0 {
31+
return nil, InvalidARNError{ARN: a, Reason: "region not set"}
32+
}
33+
34+
if len(a.AccountID) == 0 {
35+
return nil, InvalidARNError{ARN: a, Reason: "account-id not set"}
36+
}
37+
38+
// verify if outpost id is present and valid
39+
if len(resParts) == 0 || len(strings.TrimSpace(resParts[0])) == 0 {
40+
return nil, InvalidARNError{ARN: a, Reason: "outpost resource-id not set"}
41+
}
42+
43+
// verify possible resource type exists
44+
if len(resParts) < 3 {
45+
return nil, InvalidARNError{
46+
ARN: a, Reason: "incomplete outpost resource type. Expected bucket or access-point resource to be present",
47+
}
48+
}
49+
50+
// Since we know this is a OutpostARN fetch outpostID
51+
outpostID := strings.TrimSpace(resParts[0])
52+
53+
switch resParts[1] {
54+
case "accesspoint":
55+
accesspointARN, err := ParseAccessPointResource(a, resParts[2:])
56+
if err != nil {
57+
return OutpostAccessPointARN{}, err
58+
}
59+
return OutpostAccessPointARN{
60+
AccessPointARN: accesspointARN,
61+
OutpostID: outpostID,
62+
}, nil
63+
64+
case "bucket":
65+
bucketName, err := parseBucketResource(a, resParts[2:])
66+
if err != nil {
67+
return nil, err
68+
}
69+
return OutpostBucketARN{
70+
ARN: a,
71+
BucketName: bucketName,
72+
OutpostID: outpostID,
73+
}, nil
74+
75+
default:
76+
return nil, InvalidARNError{ARN: a, Reason: "unknown resource set for outpost ARN"}
77+
}
78+
}
79+
80+
// OutpostAccessPointARN represents outpost access point ARN.
81+
type OutpostAccessPointARN struct {
82+
AccessPointARN
83+
OutpostID string
84+
}
85+
86+
// GetOutpostID returns the outpost id of outpost access point arn
87+
func (o OutpostAccessPointARN) GetOutpostID() string {
88+
return o.OutpostID
89+
}
90+
91+
// OutpostBucketARN represents the outpost bucket ARN.
92+
type OutpostBucketARN struct {
93+
arn.ARN
94+
BucketName string
95+
OutpostID string
96+
}
97+
98+
// GetOutpostID returns the outpost id of outpost bucket arn
99+
func (o OutpostBucketARN) GetOutpostID() string {
100+
return o.OutpostID
101+
}
102+
103+
// GetARN retrives the base ARN from outpost bucket ARN resource
104+
func (o OutpostBucketARN) GetARN() arn.ARN {
105+
return o.ARN
106+
}
107+
108+
// parseBucketResource attempts to parse the ARN's bucket resource and retrieve the
109+
// bucket resource id.
110+
//
111+
// parseBucketResource only parses the bucket resource id.
112+
//
113+
func parseBucketResource(a arn.ARN, resParts []string) (bucketName string, err error) {
114+
if len(resParts) == 0 {
115+
return bucketName, InvalidARNError{ARN: a, Reason: "bucket resource-id not set"}
116+
}
117+
if len(resParts) > 1 {
118+
return bucketName, InvalidARNError{ARN: a, Reason: "sub resource not supported"}
119+
}
120+
121+
bucketName = strings.TrimSpace(resParts[0])
122+
if len(bucketName) == 0 {
123+
return bucketName, InvalidARNError{ARN: a, Reason: "bucket resource-id not set"}
124+
}
125+
return bucketName, err
126+
}

0 commit comments

Comments
 (0)