diff --git a/iris-mpc-common/src/helpers/key_pair.rs b/iris-mpc-common/src/helpers/key_pair.rs index cebf7e56c..dda1d9d66 100644 --- a/iris-mpc-common/src/helpers/key_pair.rs +++ b/iris-mpc-common/src/helpers/key_pair.rs @@ -83,7 +83,12 @@ impl Drop for SharesEncryptionKeyPairs { impl SharesEncryptionKeyPairs { pub async fn from_storage(config: Config) -> Result { - let region_provider = Region::new(REGION); + // use the configured region, fallback to the hardcoded value + let region = config + .aws + .and_then(|aws| aws.region) + .unwrap_or_else(|| REGION.to_owned()); + let region_provider = Region::new(region); let shared_config = aws_config::from_env().region(region_provider).load().await; let client = SecretsManagerClient::new(&shared_config);