Skip to content

add user agent business metric for account id endpoints #3381

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 1 commit into from
May 22, 2025

Conversation

sbiscigl
Copy link
Contributor

@sbiscigl sbiscigl commented Apr 16, 2025

Description of changes:

Adds business metrics for the account id endpoint feature. Moves account id configuraiton from client specific paramters to general parameters as we should have initially.

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.

@sbiscigl sbiscigl force-pushed the account-id-business-metric branch from 0177284 to a2db6cf Compare May 1, 2025 15:08
@sbiscigl sbiscigl force-pushed the account-id-business-metric branch 4 times, most recently from 92af8c2 to d808ae8 Compare May 21, 2025 19:55
}

ClientConfiguration::ClientConfiguration()
{
this->disableIMDS = false;
setLegacyClientConfigurationParameters(*this);
setConfigFromEnvOrProfile(*this);;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

interesting fact -- this meant functionally that the disableIMDSv1 configuration did not work if a user set a region in configuration

@sbiscigl sbiscigl marked this pull request as ready for review May 21, 2025 19:58
Aws::String accountId;

/**
* The AccountId Endpoint Mode.
Copy link
Contributor

Choose a reason for hiding this comment

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

the comparison is done by

strcmp(mapping.first, accountIdMode.c_str()) == 0; });

i.e. not case insensitive.

In an ideal world, I'd suggest to use an enum here.
On practice, please just add a comment with possible allowed values and the requirements of the lowercase.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree this is a better user experience, however this would be backwards breaking because on main because of how codegen is currently generating it.

#include <aws/core/Aws.h>
#include <aws/dynamodb/DynamoDBClient.h>

using namespace Aws;
using namespace Aws::DynamoDB;

auto main() -> int {
  SDKOptions options;
  InitAPI(options);
  {
    DynamoDBClientConfiguration config;
    config.accountIdEndpointMode = "preferred";
    DynamoDBClient client{config};
  }
  ShutdownAPI(options);
  return 0;
}

In an ideal world/On practice

yep yep, will add comment regarding

@sbiscigl sbiscigl force-pushed the account-id-business-metric branch 2 times, most recently from f5568c5 to 61b1cbe Compare May 21, 2025 20:59
@sbiscigl sbiscigl force-pushed the account-id-business-metric branch from 61b1cbe to 5f9d664 Compare May 21, 2025 21:05
@sbiscigl sbiscigl merged commit 91dffc8 into main May 22, 2025
3 of 4 checks passed
@sbiscigl sbiscigl deleted the account-id-business-metric branch May 22, 2025 13:50
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