Skip to content

In aws_sdk_organizations list_accounts doesn't return accounts with ID's beginning with "0" #1222

@cariosciot

Description

@cariosciot

Describe the bug

In aws_sdk_organizations list_accounts doesn't return information for account with ID's beginning either "0"

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

list_accounts ought to return all accounts for an organization regardless of the first digit of the ID

Current Behavior

list_accounts only returns account ID's that do not begin with 0.

Reproduction Steps

For use in an organization account that has a member account with an ID beginning with "0"

use aws_config::{meta::region::RegionProviderChain, BehaviorVersion};


#[tokio::main]
async fn main() {
    let region_provider = RegionProviderChain::default_provider().or_else("us-east-1");
    let config = aws_config::defaults(BehaviorVersion::latest())
        .region(region_provider)
        .load()
        .await;

    let org_client = aws_sdk_organizations::Client::new(&config);
    let accounts = match org_client.list_accounts().send().await {
        Ok(accounts) => accounts,
        Err(e) => panic!("Error: {}", e),
    };
    for account in accounts.accounts() {
        println!("{} - {}", account.id().unwrap(), account.name().unwrap());
    }
}

Possible Solution

No response

Additional Information/Context

No response

Version

├── aws-config v1.5.10
│   ├── aws-credential-types v1.2.1
│   │   ├── aws-smithy-async v1.2.2
│   │   ├── aws-smithy-runtime-api v1.7.3
│   │   │   ├── aws-smithy-async v1.2.2 (*)
│   │   │   ├── aws-smithy-types v1.2.10
│   │   ├── aws-smithy-types v1.2.10 (*)
│   ├── aws-runtime v1.4.4
│   │   ├── aws-credential-types v1.2.1 (*)
│   │   ├── aws-sigv4 v1.2.6
│   │   │   ├── aws-credential-types v1.2.1 (*)
│   │   │   ├── aws-smithy-http v0.60.11
│   │   │   │   ├── aws-smithy-runtime-api v1.7.3 (*)
│   │   │   │   ├── aws-smithy-types v1.2.10 (*)
│   │   │   ├── aws-smithy-runtime-api v1.7.3 (*)
│   │   │   ├── aws-smithy-types v1.2.10 (*)
│   │   ├── aws-smithy-async v1.2.2 (*)
│   │   ├── aws-smithy-http v0.60.11 (*)
│   │   ├── aws-smithy-runtime v1.7.5
│   │   │   ├── aws-smithy-async v1.2.2 (*)
│   │   │   ├── aws-smithy-http v0.60.11 (*)
│   │   │   ├── aws-smithy-runtime-api v1.7.3 (*)
│   │   │   ├── aws-smithy-types v1.2.10 (*)
│   │   ├── aws-smithy-runtime-api v1.7.3 (*)
│   │   ├── aws-smithy-types v1.2.10 (*)
│   │   ├── aws-types v1.3.3
│   │   │   ├── aws-credential-types v1.2.1 (*)
│   │   │   ├── aws-smithy-async v1.2.2 (*)
│   │   │   ├── aws-smithy-runtime-api v1.7.3 (*)
│   │   │   ├── aws-smithy-types v1.2.10 (*)
│   ├── aws-sdk-sso v1.50.0
│   │   ├── aws-credential-types v1.2.1 (*)
│   │   ├── aws-runtime v1.4.4 (*)
│   │   ├── aws-smithy-async v1.2.2 (*)
│   │   ├── aws-smithy-http v0.60.11 (*)
│   │   ├── aws-smithy-json v0.61.1
│   │   │   └── aws-smithy-types v1.2.10 (*)
│   │   ├── aws-smithy-runtime v1.7.5 (*)
│   │   ├── aws-smithy-runtime-api v1.7.3 (*)
│   │   ├── aws-smithy-types v1.2.10 (*)
│   │   ├── aws-types v1.3.3 (*)
│   ├── aws-sdk-ssooidc v1.51.0
│   │   ├── aws-credential-types v1.2.1 (*)
│   │   ├── aws-runtime v1.4.4 (*)
│   │   ├── aws-smithy-async v1.2.2 (*)
│   │   ├── aws-smithy-http v0.60.11 (*)
│   │   ├── aws-smithy-json v0.61.1 (*)
│   │   ├── aws-smithy-runtime v1.7.5 (*)
│   │   ├── aws-smithy-runtime-api v1.7.3 (*)
│   │   ├── aws-smithy-types v1.2.10 (*)
│   │   ├── aws-types v1.3.3 (*)
│   ├── aws-sdk-sts v1.51.0
│   │   ├── aws-credential-types v1.2.1 (*)
│   │   ├── aws-runtime v1.4.4 (*)
│   │   ├── aws-smithy-async v1.2.2 (*)
│   │   ├── aws-smithy-http v0.60.11 (*)
│   │   ├── aws-smithy-json v0.61.1 (*)
│   │   ├── aws-smithy-query v0.60.7
│   │   │   ├── aws-smithy-types v1.2.10 (*)
│   │   ├── aws-smithy-runtime v1.7.5 (*)
│   │   ├── aws-smithy-runtime-api v1.7.3 (*)
│   │   ├── aws-smithy-types v1.2.10 (*)
│   │   ├── aws-smithy-xml v0.60.9
│   │   ├── aws-types v1.3.3 (*)
│   ├── aws-smithy-async v1.2.2 (*)
│   ├── aws-smithy-http v0.60.11 (*)
│   ├── aws-smithy-json v0.60.7
│   │   └── aws-smithy-types v1.2.10 (*)
│   ├── aws-smithy-runtime v1.7.5 (*)
│   ├── aws-smithy-runtime-api v1.7.3 (*)
│   ├── aws-smithy-types v1.2.10 (*)
│   ├── aws-types v1.3.3 (*)
├── aws-sdk-organizations v1.57.0
│   ├── aws-credential-types v1.2.1 (*)
│   ├── aws-runtime v1.4.4 (*)
│   ├── aws-smithy-async v1.2.2 (*)
│   ├── aws-smithy-http v0.60.11 (*)
│   ├── aws-smithy-json v0.61.1 (*)
│   ├── aws-smithy-runtime v1.7.5 (*)
│   ├── aws-smithy-runtime-api v1.7.3 (*)
│   ├── aws-smithy-types v1.2.10 (*)
│   ├── aws-types v1.3.3 (*)



### Environment details (OS name and version, etc.)

MacOS - 15.2 (24C101)

### Logs

_No response_

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.p2This is a standard priority issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions