Skip to content

Commit

Permalink
Release v1.35.0 (#3569)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
aws-sdk-go-automation committed Sep 30, 2020
1 parent 235bdca commit 3ddfe5c
Show file tree
Hide file tree
Showing 80 changed files with 26,168 additions and 6,549 deletions.
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
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.

Release v1.34.34 (2020-09-29)
===

Expand Down
48 changes: 45 additions & 3 deletions aws/endpoints/defaults.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion aws/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ package aws
const SDKName = "aws-sdk-go"

// SDKVersion is the version of this SDK
const SDKVersion = "1.34.34"
const SDKVersion = "1.35.0"
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,28 @@ func (a AccessPointARN) GetARN() arn.ARN {

// ParseAccessPointResource attempts to parse the ARN's resource as an
// AccessPoint resource.
//
// Supported Access point resource format:
// - Access point format: arn:{partition}:s3:{region}:{accountId}:accesspoint/{accesspointName}
// - example: arn.aws.s3.us-west-2.012345678901:accesspoint/myaccesspoint
//
func ParseAccessPointResource(a arn.ARN, resParts []string) (AccessPointARN, error) {
if len(a.Region) == 0 {
return AccessPointARN{}, InvalidARNError{a, "region not set"}
return AccessPointARN{}, InvalidARNError{ARN: a, Reason: "region not set"}
}
if len(a.AccountID) == 0 {
return AccessPointARN{}, InvalidARNError{a, "account-id not set"}
return AccessPointARN{}, InvalidARNError{ARN: a, Reason: "account-id not set"}
}
if len(resParts) == 0 {
return AccessPointARN{}, InvalidARNError{a, "resource-id not set"}
return AccessPointARN{}, InvalidARNError{ARN: a, Reason: "resource-id not set"}
}
if len(resParts) > 1 {
return AccessPointARN{}, InvalidARNError{a, "sub resource not supported"}
return AccessPointARN{}, InvalidARNError{ARN: a, Reason: "sub resource not supported"}
}

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

return AccessPointARN{
Expand Down
13 changes: 8 additions & 5 deletions service/s3/internal/arn/arn.go → internal/s3shared/arn/arn.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package arn

import (
"fmt"
"strings"

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

if len(a.Partition) == 0 {
return nil, InvalidARNError{a, "partition not set"}
return nil, InvalidARNError{ARN: a, Reason: "partition not set"}
}
if a.Service != "s3" {
return nil, InvalidARNError{a, "service is not S3"}

if a.Service != "s3" && a.Service != "s3-outposts" {
return nil, InvalidARNError{ARN: a, Reason: "service is not supported"}
}
if len(a.Resource) == 0 {
return nil, InvalidARNError{a, "resource not set"}
return nil, InvalidARNError{ARN: a, Reason: "resource not set"}
}

return resParser(a)
Expand Down Expand Up @@ -66,6 +68,7 @@ type InvalidARNError struct {
Reason string
}

// Error returns a string denoting the occurred InvalidARNError
func (e InvalidARNError) Error() string {
return "invalid Amazon S3 ARN, " + e.Reason + ", " + e.ARN.String()
return fmt.Sprintf("invalid Amazon %s ARN, %s, %s", e.ARN.Service, e.Reason, e.ARN.String())
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func TestParseResource(t *testing.T) {
},
"Not S3 ARN": {
Input: "arn:aws:sqs:us-west-2:012345678901:accesspoint",
ExpectErr: "service is not S3",
ExpectErr: "service is not supported",
},
"No Resource": {
Input: "arn:aws:s3:us-west-2:012345678901:",
Expand Down Expand Up @@ -120,7 +120,7 @@ func mappedResourceParser(kinds map[string]func(arn.ARN, []string) (Resource, er

fn, ok := kinds[parts[0]]
if !ok {
return nil, InvalidARNError{a, "unknown resource type"}
return nil, InvalidARNError{ARN: a, Reason: "unknown resource type"}
}
return fn(a, parts[1:])
}
Expand Down
126 changes: 126 additions & 0 deletions internal/s3shared/arn/outpost_arn.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
package arn

import (
"strings"

"github.com/aws/aws-sdk-go/aws/arn"
)

// OutpostARN interface that should be satisfied by outpost ARNs
type OutpostARN interface {
Resource
GetOutpostID() string
}

// ParseOutpostARNResource will parse a provided ARNs resource using the appropriate ARN format
// and return a specific OutpostARN type
//
// Currently supported outpost ARN formats:
// * Outpost AccessPoint ARN format:
// - ARN format: arn:{partition}:s3-outposts:{region}:{accountId}:outpost/{outpostId}/accesspoint/{accesspointName}
// - example: arn:aws:s3-outposts:us-west-2:012345678901:outpost/op-1234567890123456/accesspoint/myaccesspoint
//
// * Outpost Bucket ARN format:
// - ARN format: arn:{partition}:s3-outposts:{region}:{accountId}:outpost/{outpostId}/bucket/{bucketName}
// - example: arn:aws:s3-outposts:us-west-2:012345678901:outpost/op-1234567890123456/bucket/mybucket
//
// Other outpost ARN formats may be supported and added in the future.
//
func ParseOutpostARNResource(a arn.ARN, resParts []string) (OutpostARN, error) {
if len(a.Region) == 0 {
return nil, InvalidARNError{ARN: a, Reason: "region not set"}
}

if len(a.AccountID) == 0 {
return nil, InvalidARNError{ARN: a, Reason: "account-id not set"}
}

// verify if outpost id is present and valid
if len(resParts) == 0 || len(strings.TrimSpace(resParts[0])) == 0 {
return nil, InvalidARNError{ARN: a, Reason: "outpost resource-id not set"}
}

// verify possible resource type exists
if len(resParts) < 3 {
return nil, InvalidARNError{
ARN: a, Reason: "incomplete outpost resource type. Expected bucket or access-point resource to be present",
}
}

// Since we know this is a OutpostARN fetch outpostID
outpostID := strings.TrimSpace(resParts[0])

switch resParts[1] {
case "accesspoint":
accesspointARN, err := ParseAccessPointResource(a, resParts[2:])
if err != nil {
return OutpostAccessPointARN{}, err
}
return OutpostAccessPointARN{
AccessPointARN: accesspointARN,
OutpostID: outpostID,
}, nil

case "bucket":
bucketName, err := parseBucketResource(a, resParts[2:])
if err != nil {
return nil, err
}
return OutpostBucketARN{
ARN: a,
BucketName: bucketName,
OutpostID: outpostID,
}, nil

default:
return nil, InvalidARNError{ARN: a, Reason: "unknown resource set for outpost ARN"}
}
}

// OutpostAccessPointARN represents outpost access point ARN.
type OutpostAccessPointARN struct {
AccessPointARN
OutpostID string
}

// GetOutpostID returns the outpost id of outpost access point arn
func (o OutpostAccessPointARN) GetOutpostID() string {
return o.OutpostID
}

// OutpostBucketARN represents the outpost bucket ARN.
type OutpostBucketARN struct {
arn.ARN
BucketName string
OutpostID string
}

// GetOutpostID returns the outpost id of outpost bucket arn
func (o OutpostBucketARN) GetOutpostID() string {
return o.OutpostID
}

// GetARN retrives the base ARN from outpost bucket ARN resource
func (o OutpostBucketARN) GetARN() arn.ARN {
return o.ARN
}

// parseBucketResource attempts to parse the ARN's bucket resource and retrieve the
// bucket resource id.
//
// parseBucketResource only parses the bucket resource id.
//
func parseBucketResource(a arn.ARN, resParts []string) (bucketName string, err error) {
if len(resParts) == 0 {
return bucketName, InvalidARNError{ARN: a, Reason: "bucket resource-id not set"}
}
if len(resParts) > 1 {
return bucketName, InvalidARNError{ARN: a, Reason: "sub resource not supported"}
}

bucketName = strings.TrimSpace(resParts[0])
if len(bucketName) == 0 {
return bucketName, InvalidARNError{ARN: a, Reason: "bucket resource-id not set"}
}
return bucketName, err
}
Loading

0 comments on commit 3ddfe5c

Please sign in to comment.