Skip to content

Conversation

@kai-ion
Copy link
Contributor

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

Issue #, if available:

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.

@kai-ion kai-ion force-pushed the cailinn branch 6 times, most recently from f02edd8 to b0be9f4 Compare July 31, 2025 18:19
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

feat: Add IMDS configuration support to credential provider chain

- Add CredentialProviderConfiguration struct with IMDS timeout and retry settings
- Add constructor to DefaultAWSCredentialsProviderChain accepting CredentialProviderConfiguration
- Add constructor to InstanceProfileCredentialsProvider accepting CredentialProviderConfiguration
- Add constructor to EC2InstanceProfileConfigLoader accepting CredentialProviderConfiguration
- Add constructor to EC2MetadataClient accepting CredentialProviderConfiguration with IMDS timeout/retry configuration
- Enable IMDS configuration to flow through: CredentialProviderConfiguration → InstanceProfileCredentialsProvider → EC2InstanceProfileConfigLoader → EC2MetadataClient
- Reduce object creation redundancy by passing configuration directly through the chain

fix disableImdsvV1 member

added new include

feat: Add IMDS configuration support for AWS_METADATA_SERVICE_TIMEOUT

Add support for AWS_METADATA_SERVICE_TIMEOUT and AWS_METADATA_SERVICE_NUM_ATTEMPTS
environment variables and config file settings to configure IMDS client behavior.

- Add imdsConfig struct to ClientConfiguration.credentialProviderConfig
- Support AWS_METADATA_SERVICE_TIMEOUT env var and metadata_service_timeout config
- Support AWS_METADATA_SERVICE_NUM_ATTEMPTS env var and metadata_service_num_attempts config
- Add InstanceProfileCredentialsProvider constructor accepting ClientConfiguration
- Add EC2InstanceProfileConfigLoader constructor accepting CredentialProviderConfiguration
- Update EC2MetadataClient to use configured timeout and retry values
- Use StringUtils::ConvertToInt32 for parsing instead of std::stol

Resolves customer request for configurable IMDS timeout settings.

fixed snake case

removed m_disableIMDSV1 and comment

recreated retry strategy during client configuration

updated forward declaration

fixed nip

New Max Attemp Retry Strategy

updated conflicts

updated conflicts

nit

DisableIMDSV1
@kai-ion kai-ion merged commit 0c5ab1e into main Aug 1, 2025
5 of 6 checks passed
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