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/s3control: GetAccessPointPolicy S3 on Outposts Endpoint Customization Not Occurring #3598

Closed
3 tasks done
bflad opened this issue Oct 15, 2020 · 3 comments · Fixed by #3601
Closed
3 tasks done
Labels
bug This issue is a bug. closing-soon This issue will automatically close in 4 days unless further comments are made.

Comments

@bflad
Copy link
Contributor

bflad commented Oct 15, 2020

Confirm by changing [ ] to [x] below to ensure that it's a bug:

Describe the bug

When issuing the GetAccessPointPolicy call, passing an ARN in the Name field is not transforming the request to contain the proper HTTP headers (e.g. Host: s3-outposts.us-west-2.amazonaws.com and X-Amz-Outpost-Id) for S3 on Outposts.

Version of AWS SDK for Go?

v1.35.5

Version of Go (go version)?

go version go1.15.2 darwin/amd64

To Reproduce (observed behavior)

_, err := conn.GetAccessPointPolicy(&s3control.GetAccessPointPolicyInput{
	AccountId: aws.String("123456789012"),
	Name:      aws.String("arn:aws:s3-outposts:us-west-2:12345679012:outpost/op-1234567890123456/accesspoint/example"),
})
2020/10/15 13:30:51 [DEBUG] [aws-sdk-go] DEBUG: Request S3 Control/GetAccessPointPolicy Details:
---[ REQUEST POST-SIGN ]-----------------------------
GET /v20180820/accesspoint/arn%3Aaws%3As3-outposts%3Aus-west-2%3A123456789012%3Aoutpost%2Fop-0cc27b83880c7d8e9%2Faccesspoint%2Fexample/policy HTTP/1.1
Host: 123456789012.s3-control.us-west-2.amazonaws.com
User-Agent: aws-sdk-go/1.35.2 (go1.14.9; darwin; amd64) APN/1.0 HashiCorp/1.0 Terraform/0.13.4 (+https://www.terraform.io)
...
X-Amz-Account-Id: 123456789012
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Date: 20201015T173051Z

Which results in:

2020/10/15 13:30:52 [DEBUG] [aws-sdk-go] <?xml version="1.0" encoding="UTF-8"?>
<ErrorResponse><Error><Code>InvalidURI</Code><Message>Couldn't parse the specified URI.</Message><URI>accesspoint/arn:aws:s3-outposts:us-west-2:12345678012:outpost/op-1234567890123456/accesspoint/example/policy</URI></Error><RequestId>1378EFEEB028D62D</RequestId><HostId>C+McQGMbNY/GE/agmaZQ8pfiMcP4FVbHz62LckFp1NWAQOOJLxY8PEaQInDVAjkkcpSZ+lkxEU8=</HostId></ErrorResponse>

Expected behavior

Working behavior similar to GetAccessPoint:

_, err := conn.GetAccessPoint(&s3control.GetAccessPointInput{
	AccountId: aws.String("123456789012"),
	Name:      aws.String("arn:aws:s3-outposts:us-west-2:12345679012:outpost/op-1234567890123456/accesspoint/example"),
})
2020/10/15 13:30:51 [DEBUG] [aws-sdk-go] DEBUG: Request S3 Control/GetAccessPoint Details:
---[ REQUEST POST-SIGN ]-----------------------------
GET /v20180820/accesspoint/example HTTP/1.1
Host: s3-outposts.us-west-2.amazonaws.com
User-Agent: aws-sdk-go/1.35.2 (go1.14.9; darwin; amd64) APN/1.0 HashiCorp/1.0 Terraform/0.13.4 (+https://www.terraform.io)
...
X-Amz-Account-Id: 123456789012
X-Amz-Date: 20201015T173051Z
X-Amz-Outpost-Id: op-1234567890123456

With a successful response.

Additional context

These lines look like they are missing the Input suffix in the s3control customizations:

// List of input shapes that use accesspoint names as arnable fields
accessPointNameArnables := map[string]struct{}{
"GetAccessPointInput": {},
"DeleteAccessPointInput": {},
"PutAccessPointPolicy": {},
"GetAccessPointPolicy": {},
"DeleteAccessPointPolicy": {},
}

@bflad bflad added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 15, 2020
bflad added a commit to bflad/aws-sdk-go that referenced this issue Oct 15, 2020
… and PutAccessPointPolicy operations not routing properly for S3 on Outposts

Reference: aws#3598
bflad added a commit to bflad/aws-sdk-go that referenced this issue Oct 15, 2020
… and PutAccessPointPolicy operations not routing properly for S3 on Outposts

Reference: aws#3598
@bflad
Copy link
Contributor Author

bflad commented Oct 15, 2020

Maybe this will fix it: #3599

skotambkar pushed a commit that referenced this issue Oct 15, 2020
…perly for S3 on Outposts (#3599)

Fixes operations: GetAccessPointPolicy, DeleteAccessPointPolicy, and PutAccessPointPolicy 
Reference: #3598
@KaibaLopez
Copy link
Contributor

Hi @skotambkar ,
The PR has been accepted and merged so I'll be closing this issue, thanks for bringing it up and submitting the PR.

@KaibaLopez KaibaLopez added closing-soon This issue will automatically close in 4 days unless further comments are made. and removed needs-triage This issue or PR still needs to be triaged. labels Oct 16, 2020
aws-sdk-go-automation pushed a commit that referenced this issue Oct 16, 2020
===

### Service Client Updates
* `service/medialive`: Updates service API, documentation, and paginators
  * The AWS Elemental MediaLive APIs and SDKs now support the ability to transfer the ownership of MediaLive Link devices across AWS accounts.
* `service/organizations`: Updates service documentation
  * Documentation updates for AWS Organizations.

### SDK Bugs
* `s3control`: Fixes bug in SDK that caused GetAccessPointPolicy, DeleteAccessPointPolicy, and PutAccessPointPolicy operations to not route properly for S3 on Outposts. ([#3599](#3599))
  * Fixes [#3598](#3598).
aws-sdk-go-automation added a commit that referenced this issue Oct 16, 2020
Release v1.35.9 (2020-10-16)
===

### Service Client Updates
* `service/medialive`: Updates service API, documentation, and paginators
  * The AWS Elemental MediaLive APIs and SDKs now support the ability to transfer the ownership of MediaLive Link devices across AWS accounts.
* `service/organizations`: Updates service documentation
  * Documentation updates for AWS Organizations.

### SDK Bugs
* `s3control`: Fixes bug in SDK that caused GetAccessPointPolicy, DeleteAccessPointPolicy, and PutAccessPointPolicy operations to not route properly for S3 on Outposts. ([#3599](#3599))
  * Fixes [#3598](#3598).
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. closing-soon This issue will automatically close in 4 days unless further comments are made.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants