GitHub user fstephany created a discussion: Accessing a table stored in AWS 
S3Tables

I'm trying to access a table stored in a S3Table bucket. 

Here's how I try:

```
let cfg = aws_config::from_env()
    .profile_name("<aws-profile>")
    .load()
    .await;
let s3_tables_client = Client::new(&cfg);
let catalog = S3TablesCatalogBuilder::default()
    .with_client(s3_tables_client)
    .load(
        "s3tables_catalog",
        HashMap::from([
            (
                S3TABLES_CATALOG_PROP_TABLE_BUCKET_ARN.to_string(),
                
"arn:aws:s3tables:eu-central-1:<account-id>:bucket/<bucket-identifier>".to_string(),
            ),
            ("region_name".to_string(), "eu-central-1".to_string()),
            ("profile_name".to_string(), "<aws-profile>".to_string()),
        ]),
    )
    .await?;

println!("Loading Table");

let ns_id = NamespaceIdent::new("<namespace>".to_owned());
println!(
    "<namespace> namespace exists: {}",
    catalog.namespace_exists(&ns_id).await?
);

let lf_identifier = TableIdent::new(ns_id.clone(), "<table_id>".to_owned());

match catalog.load_table(&lf_identifier).await {
    Ok(table) => println!("Table: {table:?}"),
    Err(err) => println!("Could not get table: {err:?}"),
};
```

When running this. I get the correct output for the list of tables in the 
namespace but execution when calling `load_table` with the following:

> Could not get table: Unexpected => Failure in doing io operation
> Source: ConfigInvalid (permanent) at Builder::build, context: { service: s3 } 
> => region is missing. Please find it by S3::detect_region() or set them in 
> env.

If I run the script with the env var `AWS_PROFILE` set to the same profile than 
the one specified when creating the client, I get the following error:

> Could not get table: Unexpected => Failure in doing io operation
> Source: Unexpected (persistent) at read, context: { called: 
> reqsign::LoadCredential, service: s3, path: metadata/<some-identifier>.json, 
> range: 0- } => loading credential to sign http request, source: error sending 
> request for url (http://169.254.169.254/latest/api/token): error sending 
> request for url (http://169.254.169.254/latest/api/token): operation timed out

The profile uses AWS SSO and a session is active. It looks like the AWS 
authentication from the AWS SDK is not passed upon the internals of 
iceberg-rust?

Any pointer on how to get this working?






GitHub link: https://github.com/apache/iceberg-rust/discussions/2182

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to