Skip to content

C++ support AWS_METADATA_SERVICE_TIMEOUT #3493

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

C++ support AWS_METADATA_SERVICE_TIMEOUT #3493

wants to merge 1 commit into from

Conversation

kai-ion
Copy link

@kai-ion kai-ion commented Jul 23, 2025

Issue #, if available:
CPP-43300

Description of changes:
Implement a new configuration support for IMDS (Instance Metadata Service), specifically support for environment variable AWS_METADATA_SERVICE_TIMEOUT and AWS_METADATA_SERVICE_NUM_ATTEMPTS . Reference for Amazon EC2 instance metadata.

Check all that applies:

  • Did a review by yourself.
  • Added proper tests to cover this PR. (If tests are not applicable, explain.)
  • Checked if this PR is a breaking (APIs have been changed) change.
  • Checked if this PR will not introduce cross-platform inconsistent behavior.
  • Checked if this PR would require a ReadMe/Wiki update.

Check which platforms you have built SDK on to verify the correctness of this PR.

  • Linux
  • Windows
  • Android
  • MacOS
  • IOS
  • Other Platforms

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@kai-ion kai-ion force-pushed the cailinn branch 2 times, most recently from a1482df to 35b7c3a Compare July 25, 2025 15:35
Copy link
Contributor

@sbiscigl sbiscigl left a comment

Choose a reason for hiding this comment

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

you dont actually pass the configuration to the credentials provider chain initialization so it wont be used. we need that to happen so that the value is used.

@@ -440,7 +440,22 @@ namespace Aws
*/
ResponseChecksumValidation responseChecksumValidation = ResponseChecksumValidation::WHEN_SUPPORTED;
} checksumConfig;


Copy link
Contributor

Choose a reason for hiding this comment

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

i think you moved this to credentialProviderConfig, so this doesnt need to exist anymore?

Copy link
Author

Choose a reason for hiding this comment

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

Removed duplicate imdsConfig struct

@@ -458,7 +473,7 @@ namespace Aws
* Configuration that is specifically used for the windows http client
*/
struct WinHTTPOptions {
/**
/**`
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: accidentally char

Copy link
Author

Choose a reason for hiding this comment

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

opps, removed the char

Add ClientConfiguration support for IMDS settings and update related classes

Fix: Shared pointer bug in AWSCredentialsProvider

allocator mismatch bug fix, change type using c_str()

new configuration support for IMDSConfig

Add ClientConfiguration support for IMDS settings and update related classes

Fix: Shared pointer bug in AWSCredentialsProvider

allocator mismatch bug fix, change type using c_str()

Fix shared pointer bug and update IMDS config structure

- Fix std::stol compilation error with Aws::String by using .c_str()
- Update IMDS configuration to use credentialProviderConfig.imdsConfig structure
- Add proper environment variable support for AWS_METADATA_SERVICE_TIMEOUT and AWS_METADATA_SERVICE_NUM_ATTEMPTS

Update IMDS configuration and credentials provider

fix: Remove duplicate IMDS config struct and fix comment syntax
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.

2 participants