Skip to content
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

Let the AWS SDK determine the default region. #5317

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions test/src/unit-capi-config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,6 @@ void check_save_to_file() {
ss << "vfs.s3.object_canned_acl NOT_SET\n";
ss << "vfs.s3.proxy_port 0\n";
ss << "vfs.s3.proxy_scheme http\n";
ss << "vfs.s3.region us-east-1\n";
ss << "vfs.s3.request_timeout_ms 3000\n";
ss << "vfs.s3.requester_pays false\n";
ss << "vfs.s3.scheme https\n";
Expand Down Expand Up @@ -465,22 +464,22 @@ TEST_CASE("C API: Test config", "[capi][config]") {
CHECK(!strcmp(value, "5368709120"));

// Set valid, defaulting parameter
rc = tiledb_config_set(config, "vfs.s3.region", "pluto", &error);
rc = tiledb_config_set(config, "sm.consolidation.mode", "commits", &error);
CHECK(rc == TILEDB_OK);
CHECK(error == nullptr);
rc = tiledb_config_get(config, "vfs.s3.region", &value, &error);
rc = tiledb_config_get(config, "sm.consolidation.mode", &value, &error);
CHECK(rc == TILEDB_OK);
CHECK(error == nullptr);
CHECK(!strcmp(value, "pluto"));
CHECK(!strcmp(value, "commits"));

// Unset valid, defaulting parameter
rc = tiledb_config_unset(config, "vfs.s3.region", &error);
rc = tiledb_config_unset(config, "sm.consolidation.mode", &error);
CHECK(rc == TILEDB_OK);
CHECK(error == nullptr);
rc = tiledb_config_get(config, "vfs.s3.region", &value, &error);
rc = tiledb_config_get(config, "sm.consolidation.mode", &value, &error);
CHECK(rc == TILEDB_OK);
CHECK(error == nullptr);
CHECK(!strcmp(value, "us-east-1"));
CHECK(!strcmp(value, "fragments"));

// Set valid, non-defaulting parameter
rc = tiledb_config_set(config, "foo", "123", &error);
Expand Down Expand Up @@ -723,7 +722,7 @@ TEST_CASE("C API: Test config iter", "[capi][config]") {
all_param_values["vfs.file.posix_file_permissions"] = "644";
all_param_values["vfs.file.posix_directory_permissions"] = "755";
all_param_values["vfs.s3.scheme"] = "https";
all_param_values["vfs.s3.region"] = "us-east-1";
all_param_values["vfs.s3.region"] = "";
all_param_values["vfs.s3.aws_access_key_id"] = "";
all_param_values["vfs.s3.aws_secret_access_key"] = "";
all_param_values["vfs.s3.aws_session_token"] = "";
Expand Down Expand Up @@ -798,7 +797,7 @@ TEST_CASE("C API: Test config iter", "[capi][config]") {
vfs_param_values["file.posix_file_permissions"] = "644";
vfs_param_values["file.posix_directory_permissions"] = "755";
vfs_param_values["s3.scheme"] = "https";
vfs_param_values["s3.region"] = "us-east-1";
vfs_param_values["s3.region"] = "";
vfs_param_values["s3.aws_access_key_id"] = "";
vfs_param_values["s3.aws_secret_access_key"] = "";
vfs_param_values["s3.aws_session_token"] = "";
Expand Down Expand Up @@ -867,7 +866,7 @@ TEST_CASE("C API: Test config iter", "[capi][config]") {

std::map<std::string, std::string> s3_param_values;
s3_param_values["scheme"] = "https";
s3_param_values["region"] = "us-east-1";
s3_param_values["region"] = "";
s3_param_values["aws_access_key_id"] = "";
s3_param_values["aws_secret_access_key"] = "";
s3_param_values["aws_session_token"] = "";
Expand Down
3 changes: 1 addition & 2 deletions test/src/unit-s3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ TEST_CASE_METHOD(S3Fx, "Test S3 multiupload abort path", "[s3]") {
}
}

TEST_CASE_METHOD(
S3Fx, "Test S3 setting bucket/object canned acls", "[s3][config]") {
TEST_CASE("Test S3 setting bucket/object canned acls", "[s3][config]") {
Config config;
REQUIRE(config.set("vfs.s3.bucket_canned_acl", "private_").ok());
REQUIRE(config.set("vfs.s3.bucket_canned_acl", "public_read").ok());
Expand Down
5 changes: 4 additions & 1 deletion tiledb/api/c_api/config/config_api_external.h
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,10 @@ TILEDB_EXPORT void tiledb_config_free(tiledb_config_t** config) TILEDB_NOEXCEPT;
* **Default**: "10737418240"
* - `vfs.s3.region` <br>
* The S3 region, if S3 is enabled. <br>
* **Default**: us-east-1
* If empty, the region will be determined by the AWS SDK using sources such
* as environment variables, profile configuration, or instance metadata.
* <br>
* **Default**: ""
* - `vfs.s3.aws_access_key_id` <br>
* Set the AWS_ACCESS_KEY_ID <br>
* **Default**: ""
Expand Down
2 changes: 1 addition & 1 deletion tiledb/sm/config/config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ const std::string Config::VFS_GCS_MULTI_PART_SIZE = "5242880";
const std::string Config::VFS_GCS_USE_MULTI_PART_UPLOAD = "true";
const std::string Config::VFS_GCS_REQUEST_TIMEOUT_MS = "3000";
const std::string Config::VFS_GCS_MAX_DIRECT_UPLOAD_SIZE = "10737418240";
const std::string Config::VFS_S3_REGION = "us-east-1";
const std::string Config::VFS_S3_REGION = "";
const std::string Config::VFS_S3_AWS_ACCESS_KEY_ID = "";
const std::string Config::VFS_S3_AWS_SECRET_ACCESS_KEY = "";
const std::string Config::VFS_S3_AWS_SESSION_TOKEN = "";
Expand Down
7 changes: 5 additions & 2 deletions tiledb/sm/cpp_api/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ struct ConfigProxy {
* conf["vfs.s3.region"] = "us-east-1a";
* conf["vfs.s3.use_virtual_addressing"] = "true";
* Context ctx(conf);
* // array/kv operations with ctx
* // array operations with ctx
* @endcode
* */
class Config {
Expand Down Expand Up @@ -671,7 +671,10 @@ class Config {
* **Default**: "10737418240"
* - `vfs.s3.region` <br>
* The S3 region, if S3 is enabled. <br>
* **Default**: us-east-1
* If empty, the region will be determined by the AWS SDK using sources
* such as environment variables, profile configuration, or instance
* metadata. <br>
* **Default**: ""
* - `vfs.s3.aws_access_key_id` <br>
* Set the AWS_ACCESS_KEY_ID <br>
* **Default**: ""
Expand Down
Loading