Skip to content

Add support for default configuration modes #2624

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

Merged
merged 25 commits into from
Dec 21, 2021
Merged

Conversation

alextwoods
Copy link
Contributor

Adds support for the default_mode configuration value that standardizes SDK default configurations.

Add a new aws-defaults pseudo gem (similar to seahorse and sts/sso) in core which has:

  • DefaultsModeConfigResolver - responsible for logic to resolve defaults from a defaults mode (as well as environment detection).
  • DefaultsModeConfiguration module - documentation and config values code generated from the cross SDK values.

default_mode is added as an option by the DefaultsMode plugin. Resolution of defaults is done through updates to the default blocks on the appropriate existing config options.

This change also adds support for the ssl_timeout config option for net http.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

  1. To make sure we include your contribution in the release notes, please make sure to add description entry for your changes in the "unreleased changes" section of the CHANGELOG.md file (at corresponding gem). For the description entry, please make sure it lives in one line and starts with Feature or Issue in the correct format.

  2. For generated code changes, please checkout below instructions first:
    https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md

Thank you for your contribution!

@alextwoods
Copy link
Contributor Author

Reminder: Confirm core version requirements before merge/release.

@alextwoods alextwoods marked this pull request as ready for review December 16, 2021 17:37
Copy link
Contributor

@mullermp mullermp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

puts "Loading defaults from: #{defaults_file}"
defaults = JSON.load(File.read(defaults_file))

default_mode_docs = ["<p>The following `:default_mode` values are supported: </p>"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these hardcoded strings live in the actual documentation, and maybe just code generate multiple dynamic sections like all of the modes and configuration maps?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah - I think that makes sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NVM - this doesn't work as we need all of the links to be processed together by kramdown.

@@ -63,6 +63,20 @@ module S3
'https://s3.us-east-1.amazonaws.com/')
end

it 'can be set through defaults mode' do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you update all of the plugin tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah - every option that has changed has a new test.

@alextwoods alextwoods merged commit 378dfa6 into version-3 Dec 21, 2021
@alextwoods alextwoods deleted the default_config branch December 21, 2021 17:34
@ixti
Copy link

ixti commented Mar 17, 2024

It's a bit unclear how to use default config mode.

@mullermp
Copy link
Contributor

You can set the defaults_mode option to any of the keys under this modes key in this JSON:

It is just a canned way of overwriting some other config options. You may be better off just overwriting any options you want instead.

@ixti
Copy link

ixti commented Mar 22, 2024

Thank you!

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.

3 participants