-
Notifications
You must be signed in to change notification settings - Fork 231
add AWS_RECOMMENDED as partitional endpoint pattern #2575
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -269,9 +269,7 @@ Trait value | |
- Description | ||
* - endpointPatternType | ||
- ``string`` | ||
- **Required** The pattern type to use for the partition endpoint. This value can be set to ``service_dnsSuffix`` to | ||
use the ``https://{service}.{dnsSuffix}`` pattern or ``service_region_dnsSuffix`` to use | ||
``https://{service}.{region}.{dnsSuffix}``. | ||
- **Required** The pattern type to use for the partition endpoint. This value should be set to ``aws_recommended`` in almost all cases. | ||
* - partitionEndpointSpecialCases | ||
- ``map`` of partition to `PartitionEndpointSpecialCase object`_ | ||
- A map of partition to partition endpoint special cases - partitions that do not follow the | ||
|
@@ -282,13 +280,9 @@ Conflicts with | |
:ref:`aws.endpoints#standardRegionalEndpoints-trait` | ||
|
||
Partitional services (also known as "global" services) resolve a single endpoint per partition. | ||
That single endpoint is located in the partition's ``defaultGlobalRegion``. Partitional | ||
services should follow one of two standard patterns: | ||
That single endpoint is located in the partition's ``defaultGlobalRegion``. | ||
|
||
- ``service_dnsSuffix``: ``https://{service}.{dnsSuffix}`` | ||
- ``service_region_dnsSuffix``: ``https://{service}.{region}.{dnsSuffix}`` | ||
|
||
The following example defines a partitional service that uses ``{service}.{dnsSuffix}``: | ||
The following example defines a partitional service that uses AWS recommended patterns for each partition: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we provide documentation on what those are? At least for AWS partition. We provide a list of the "standard patterns" eg here: https://smithy.io/2.0/aws/aws-endpoints-region.html#aws-endpoints-standardregionalendpoints-trait There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's fairly complex though, and currently only captured on an internal AWS document, which I don't think is fit for the public docs. If you think we should go the full mile and put the detailed pattern cases in the docs, we can do that though There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And just adding aws partition is a little misleading since aws partition is itself nonstandard There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah thats fair - I think its reasonable to leave it unspecified here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If anyone asks, we can presumably link them to the authoritative doc for clarity :) |
||
|
||
.. code-block:: smithy | ||
|
||
|
@@ -298,19 +292,19 @@ The following example defines a partitional service that uses ``{service}.{dnsSu | |
|
||
use aws.endpoints#standardPartitionalEndpoints | ||
|
||
@standardPartitionalEndpoints(endpointPatternType: "service_dnsSuffix") | ||
@standardPartitionalEndpoints(endpointPatternType: "aws_recommended") | ||
service MyService { | ||
version: "2020-04-02" | ||
} | ||
|
||
Services should follow the standard patterns; however, occasionally there are special cases. | ||
Services should follow the standard patterns set by the DNS naming guidelines; however, occasionally there are special cases. | ||
The following example defines a partitional service that uses a special case pattern in | ||
the ``aws`` partition and uses a non-standard global region in the ``aws-cn`` partition: | ||
|
||
.. code-block:: smithy | ||
|
||
@standardPartitionalEndpoints( | ||
endpointPatternType: "service_dnsSuffix", | ||
endpointPatternType: "aws_recommended", | ||
partitionEndpointSpecialCases: { | ||
aws: [{endpoint: "https://myservice.global.amazonaws.com"}], | ||
aws-cn: [{region: "cn-north-1"}] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we still require this to be set? We could default to using recommended
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I don't have a strong preference. The only thing I had in mind was that it might lead to a small bug downstream in some code that expects it to always be nonnull if we miss changing it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah - I dont have a strong preference either. Its more explicit to require it and the documentation here and on the trait itself makes it clear what to use.