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

aws/endpoints: Remove types used for exposing iteration types over partitions, regions, and service models. #512

Merged
merged 8 commits into from
Mar 20, 2020

Conversation

skmcgrail
Copy link
Member

This PR further cleans up the endpoints package to only expose the default generated resolver based on the endpoint model. This removes supporting types that were used to iterate over the model, and that were inherently tied to and were exposing the underlying data model.

@skmcgrail skmcgrail changed the title aws/endpoints: aws/endpoints: Remove types used for exposing iteration types over partitions, regions, and service models. aws/endpoints: Remove types used for exposing iteration types over partitions, regions, and service models. Mar 18, 2020
@skmcgrail skmcgrail added the breaking-change Issue requires a breaking change to remediate. label Mar 18, 2020
@skmcgrail skmcgrail merged commit 917ce45 into aws:master Mar 20, 2020
@skmcgrail skmcgrail deleted the endpoints/removeConstants branch March 20, 2020 16:17
jasdel added a commit that referenced this pull request Apr 21, 2020
===

Breaking Change
---
* `aws/endpoints`: Several functions and types have been removed
  * Removes `DecodeModel` and `DecodeModelOptions` from the package ([#509](#509))
  * Remove Region Constants, Partition Constants, and types use for exploring the endpoint data model ([#512](#512))
* `service/s3/s3crypto`: Package and associated encryption/decryption clients have been removed from the SDK ([#511](#511))
* `aws/external`: Removes several export constants and types ([#508](#508))
  * No longer exports AWS environment constants used by the external environment configuration loader
  * `DefaultSharedConfigProfile` is now defined an exported constant
* `aws`: `ErrMissingRegion`, `ErrMissingEndpoint`, `ErrStaticCredentialsEmpty` are now concrete error types ([#510](#510))

Services
---
* Synced the V2 SDK with latest AWS service API definitions.

SDK Features
---
* `aws/signer/v4`: New methods `SignHTTP` and `PresignHTTP` have been added ([#519](#519))
  * `SignHTTP` replaces `Sign`, and usage of `Sign` should be migrated before it's removal at a later date
  * `PresignHTTP` replaces `Presign`, and usage of `Presign` should be migrated before it's removal at a later date
  * `DisableRequestBodyOverwrite` and `UnsignedPayload` are now deprecated options and have no effect on `SignHTTP` or `PresignHTTP`. These options will be removed at a later date.
* `aws/external`: Add Support for setting a default fallback region and resolving region from EC2 IMDS ([#523](#523))
  * `WithDefaultRegion` helper has been added which can be passed to `LoadDefaultAWSConfig`
    * This helper can be used to configure a default fallback region in the event a region fails to be resolved from other sources
  * Support has been added to resolve region using EC2 IMDS when available
    * The IMDS region will be used if region as not found configured in either the shared config or the process environment.
  * Fixes [#244](#244)
  * Fixes [#515](#515)
SDK Enhancements
---
* `service/dynamodb/expression`: Add IsSet helper for ConditionBuilder and KeyConditionBuilder ([#494](#494))
  * Adds a IsSet helper for ConditionBuilder and KeyConditionBuilder to make it easier to determine if the condition builders have any conditions added to them.
  * Implements [#493](#493).
* `internal/ini`: Normalize Section keys to lowercase ([#495](#495))
  * Update's SDK's ini utility to store all keys as lowercase. This brings the SDK inline with the AWS CLI's behavior.

SDK Bugs
---
* `internal/sdk`: Fix SDK's UUID utility to handle partial read ([#536](#536))
  * Fixes the SDK's UUID utility to correctly handle partial reads from its crypto rand source. This error was sometimes causing the SDK's InvocationID value to fail to be obtained, due to a partial read from crypto.Rand.
  * Fix [#534](#534)
* `aws/defaults`: Fix request metadata headers causing signature errors ([#536](#536))
    * Fixes the SDK's adding the request metadata headers in the wrong location within the request handler stack. This created a situation where a request that was retried would sign the new attempt using the old value of the header. The header value would then be changed before sending the request.
    * Fix [#533](#533)
    * Fix [#521](#521)
jasdel added a commit that referenced this pull request Apr 22, 2020
Breaking Change
---
* `aws/endpoints`: Several functions and types have been removed
  * Removes `DecodeModel` and `DecodeModelOptions` from the package ([#509](#509))
  * Remove Region Constants, Partition Constants, and types use for exploring the endpoint data model ([#512](#512))
* `service/s3/s3crypto`: Package and associated encryption/decryption clients have been removed from the SDK ([#511](#511))
* `aws/external`: Removes several export constants and types ([#508](#508))
  * No longer exports AWS environment constants used by the external environment configuration loader
  * `DefaultSharedConfigProfile` is now defined an exported constant
* `aws`: `ErrMissingRegion`, `ErrMissingEndpoint`, `ErrStaticCredentialsEmpty` are now concrete error types ([#510](#510))

Services
---
* Synced the V2 SDK with latest AWS service API definitions.

SDK Features
---
* `aws/signer/v4`: New methods `SignHTTP` and `PresignHTTP` have been added ([#519](#519))
  * `SignHTTP` replaces `Sign`, and usage of `Sign` should be migrated before it's removal at a later date
  * `PresignHTTP` replaces `Presign`, and usage of `Presign` should be migrated before it's removal at a later date
  * `DisableRequestBodyOverwrite` and `UnsignedPayload` are now deprecated options and have no effect on `SignHTTP` or `PresignHTTP`. These options will be removed at a later date.
* `aws/external`: Add Support for setting a default fallback region and resolving region from EC2 IMDS ([#523](#523))
  * `WithDefaultRegion` helper has been added which can be passed to `LoadDefaultAWSConfig`
    * This helper can be used to configure a default fallback region in the event a region fails to be resolved from other sources
  * Support has been added to resolve region using EC2 IMDS when available
    * The IMDS region will be used if region as not found configured in either the shared config or the process environment.
  * Fixes [#244](#244)
  * Fixes [#515](#515)

SDK Enhancements
---
* `service/dynamodb/expression`: Add IsSet helper for ConditionBuilder and KeyConditionBuilder ([#494](#494))
  * Adds a IsSet helper for ConditionBuilder and KeyConditionBuilder to make it easier to determine if the condition builders have any conditions added to them.
  * Implements [#493](#493).
* `internal/ini`: Normalize Section keys to lowercase ([#495](#495))
  * Update's SDK's ini utility to store all keys as lowercase. This brings the SDK inline with the AWS CLI's behavior.


SDK Bugs
---
* `internal/sdk`: Fix SDK's UUID utility to handle partial read ([#536](#536))
  * Fixes the SDK's UUID utility to correctly handle partial reads from its crypto rand source. This error was sometimes causing the SDK's InvocationID value to fail to be obtained, due to a partial read from crypto.Rand.
  * Fix [#534](#534)
* `aws/defaults`: Fix request metadata headers causing signature errors ([#536](#536))
    * Fixes the SDK's adding the request metadata headers in the wrong location within the request handler stack. This created a situation where a request that was retried would sign the new attempt using the old value of the header. The header value would then be changed before sending the request.
    * Fix [#533](#533)
    * Fix [#521](#521)
@flyinprogrammer
Copy link
Contributor

You might want to fix your README:

https://github.com/aws/aws-sdk-go-v2/blame/master/README.md#L68

@jcarter3
Copy link

I know I'm late to the party since this is already merged, but upon updating versions of the SDK I had a lot of code that broke due to this. I have some lambdas that iterate over all regions and do some work in each one, and it was implemented by iterating over all the regions in all the partitions. But now those are no longer exposed. Is there an alternative way to do this? I supposed I can just build and maintain a hardcoded list, but using the exports on the endpoint package seemed harmless enough at the time.

@bobheadxi
Copy link

bobheadxi commented May 21, 2020

What was the reason for removing this? #512 (comment) and #557 both point out use cases for this functionality, and given the general lack of multi-region functionality available in the API this is pretty much the only way to do anything outside of a single region

edit: that said, https://pkg.go.dev/github.com/aws/[email protected]/service/ec2?tab=doc#Client.DescribeRegionsRequest hopefully does a similar thing 🤔

@kaihendry
Copy link

Breaking changes are nasty undefined: endpoints.UsWest2RegionID, though there doesn't appear to any documentation how to fix code that depended on setting say cfg.Region = endpoints.UsWest2RegionID to send email, or am I missing something?

Thank you

jasdel added a commit to jasdel/aws-sdk-go-v2 that referenced this pull request Jun 17, 2020
Fixes aws#557 by removing out dated example documentation from the SDK's
endpoints package and README. The feature to enumerate regions and
services was removed in aws#512 pending further design and development of
service specific endpoint metadata.
skmcgrail pushed a commit that referenced this pull request Jun 17, 2020
Fixes #557 by removing out dated example documentation from the SDK's
endpoints package and README. The feature to enumerate regions and
services was removed in #512 pending further design and development of
service specific endpoint metadata.
@dustin-decker
Copy link

dustin-decker commented Aug 20, 2020

Documentation still mentions things removed by this, and there is no clear equivalent functionality:

https://docs.aws.amazon.com/sdk-for-go/v2/api/
https://docs.aws.amazon.com/sdk-for-go/v2/api/aws/endpoints/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change Issue requires a breaking change to remediate.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants