-
Notifications
You must be signed in to change notification settings - Fork 242
feat: create wrapper client for aws config for customizable defaults #6095
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
Conversation
/try |
Okay, starting a try! I'll update this comment once it's running...\n |
Dependency Review✅ No vulnerabilities or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Files
|
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.
Pull Request Overview
This PR introduces a custom AWS config wrapper to support configurable defaults (adaptive retry, increased attempts, fallback region) and proactive validation of credentials, and updates dependent crates to use the new wrapper.
- Introduces the new crate si-aws-config with a custom configuration loader and caller identity validation.
- Updates si-data-ssm, si-data-acmpca, data-warehouse-stream-client, and associated Buck and Cargo files to remove direct aws_config usage in favor of si-aws-config.
- Adjusts error handling in client constructors across multiple modules to propagate errors from the new wrapper.
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
third-party/rust/Cargo.toml | Added aws-sdk-sts dependency with specified features. |
lib/si-data-ssm/src/lib.rs | Updated SSM client initialization to use si-aws-config and proper error propagation. |
lib/si-data-ssm/Cargo.toml | Replaced direct aws-config dependency with si-aws-config. |
lib/si-data-ssm/BUCK | Updated Buck dependency reference from aws-config to si-aws-config. |
lib/si-data-acmpca/src/lib.rs | Updated ACM PCA client error handling to use si-aws-config and propagate errors. |
lib/si-data-acmpca/Cargo.toml | Replaced direct aws-config dependency with si-aws-config. |
lib/si-data-acmpca/BUCK | Updated Buck dependency reference to use si-aws-config. |
lib/si-aws-config/src/lib.rs | New implementation of the AWS config wrapper with adaptive retry, fallback region, and immediate credential validation. |
lib/si-aws-config/Cargo.toml | New Cargo configuration for the si-aws-config crate. |
lib/si-aws-config/BUCK | Buck build file for the new si-aws-config crate. |
lib/innit-server/src/server.rs | Updated usage of ParameterStoreClient and PrivateCertManagerClient to propagate errors. |
lib/innit-client/src/lib.rs | Updated certificate generation to use the new error propagation style. |
lib/forklift-server/src/server/app/billing_events.rs | Adjusted DataWarehouseStreamClient initialization to propagate errors properly. |
lib/data-warehouse-stream-client/src/lib.rs | Updated Firehose client initialization to use si-aws-config with error propagation. |
lib/data-warehouse-stream-client/Cargo.toml | Replaced direct aws-config dependency with si-aws-config. |
lib/data-warehouse-stream-client/BUCK | Updated Buck dependency reference to use si-aws-config. |
dev/Tiltfile | Added auto_init flag to resource configuration. |
Cargo.toml | Added si-aws-config to workspace members and updated dependency versions. |
Comments suppressed due to low confidence (2)
lib/si-data-ssm/src/lib.rs:52
- [nitpick] The error message contains duplicate wording ('Error error'). Consider revising it to 'AWS Config Error: {0}' for clarity.
#[error("AWS Config Error error: {0}")]
lib/si-data-acmpca/src/lib.rs:71
- [nitpick] The error message contains redundant wording ('Error error'). Consider revising it to 'AWS Config Error: {0}' for improved clarity.
#[error("AWS Config Error error: {0}")]
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.
Nice work!
let sts = aws_sdk_sts::Client::new(&config); | ||
let ident = sts | ||
.get_caller_identity() | ||
.send() |
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.
Was this default behavior before? Because I like that we can roughly confirm our identity this way!
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.
No, the default behavior is to gather credentials from various places in the environment and then carry on. It makes no effort to validate the creds until the first API call made using them. Here we'll at least test them on startup.
6017cf0
to
814e205
Compare
Adds a wrapper for the aws_config crate so we can supply different defaults (adaptive retry, more attempts, fallback region) and so we can validate the credentials are good as soon as we create them (rather than waiting until they are first used).