Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

service/s3: Add support for Access Point resources #2985

Merged
merged 3 commits into from
Dec 3, 2019

Conversation

jasdel
Copy link
Contributor

@jasdel jasdel commented Dec 3, 2019

Adds support for using Access Point resource with Amazon S3 API operation calls. The Access Point resource are identified by an Amazon Resource Name (ARN).

To make operation calls to an S3 Access Point instead of a S3 Bucket, provide the Access Point ARN string as the value of the Bucket parameter. You can create an Access Point for your bucket with the Amazon S3 Control API. The Access Point ARN can be obtained from the S3 Control API. You should avoid building the ARN directly.

apResp, err := ctrClient.CreateAccessPoint(&s3control.CreateAccessPointInput{
    AccountId: aws.String("123456789012"),
    Bucket:    aws.String("myBucket"),
    Name:      aws.String("myAccessPoint"),
})

resp, err := client.GetObject(&s3.GetObjectInput{
    Bucket: aws.String("arn:aws:s3:us-west-2:123456789012:accesspoint/myAccessPoint"),
    Key: aws.String("myObject"),
})

See https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html for more information on ARNs.

skmcgrail and others added 3 commits December 3, 2019 09:52
Adds support for using Access Point resource with Amazon S3 API
operation calls. The Access Point resource are identified by an Amazon
Resource Name (ARN).

To make operation calls to an S3 Access Point instead of a S3 Bucket,
provide the Access Point ARN string as the value of the Bucket
parameter. You can create an Access Point for your bucket with the Amazon
S3 Control API. The Access Point ARN can be obtained from the S3 Control
API. You should avoid building the ARN directly.

```go
apResp, err := ctrClient.CreateAccessPoint(&s3control.CreateAccessPointInput{
    AccountId: aws.String("123456789012"),
    Bucket:    aws.String("myBucket"),
    Name:      aws.String("myAccessPoint"),
})

resp, err := client.GetObject(&s3.GetObjectInput{
    Bucket: aws.String("arn:aws:s3:us-west-2:123456789012:accesspoint/myAccessPoint"),
    Key: aws.String("myObject"),
})
```

See https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
for more information on ARNs.
@jasdel jasdel requested a review from skmcgrail December 3, 2019 19:10
@jasdel jasdel self-assigned this Dec 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants