diff --git a/.env.test b/.env.test index c80d4784..73d1d6da 100644 --- a/.env.test +++ b/.env.test @@ -3,7 +3,7 @@ AWS_ACCESS_KEY_ID=AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY=AWS_SECRET_ACCESS_KEY -AWS_REGION=us-west-1 +AWS_REGION=us-east-1 # For Aws sdk AWS_ENDPOINT_URL=http://localhost.localstack.cloud:4566 # For Omniqueue @@ -19,7 +19,7 @@ MADARA_ORCHESTRATOR_EVENT_BRIDGE_TRIGGER_POLICY_NAME=madara-orchestrator-worker- #### ALERTS #### -MADARA_ORCHESTRATOR_AWS_SNS_ARN=arn:aws:sns:us-west-1:000000000000:madara-orchestrator-arn +MADARA_ORCHESTRATOR_AWS_SNS_ARN=arn:aws:sns:us-east-1:000000000000:madara-orchestrator-arn #### DATA AVAILABILITY #### @@ -66,7 +66,7 @@ MADARA_ORCHESTRATOR_ATLANTIC_RPC_NODE_URL=http://127.0.0.1:8545 MADARA_ORCHESTRATOR_SQS_PREFIX=madara_orchestrator MADARA_ORCHESTRATOR_SQS_SUFFIX=queue MADARA_ORCHESTRATOR_EVENT_BRIDGE_TARGET_QUEUE_NAME=madara_orchestrator_worker_trigger_queue -MADARA_ORCHESTRATOR_SQS_BASE_QUEUE_URL=http://sqs.us-west-1.localhost.localstack.cloud:4566/000000000000 +MADARA_ORCHESTRATOR_SQS_BASE_QUEUE_URL=http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000 #### SETTLEMENT #### diff --git a/crates/orchestrator/src/data_storage/aws_s3/mod.rs b/crates/orchestrator/src/data_storage/aws_s3/mod.rs index a94b2a1c..342e64e9 100644 --- a/crates/orchestrator/src/data_storage/aws_s3/mod.rs +++ b/crates/orchestrator/src/data_storage/aws_s3/mod.rs @@ -35,14 +35,11 @@ impl AWSS3 { // this is necessary for it to work with localstack in test cases s3_config_builder.set_force_path_style(Some(true)); let client = Client::from_conf(s3_config_builder.build()); - + let region_str = aws_config.region().expect("Could not get region as string").to_string(); - let location_constraint: BucketLocationConstraint = BucketLocationConstraint::from_str(region_str.as_str()).expect("Could not get location constraint from region string"); - Self { - client, - bucket: s3_config.bucket_name.clone(), - bucket_location_constraint: location_constraint, - } + let location_constraint: BucketLocationConstraint = BucketLocationConstraint::from_str(region_str.as_str()) + .expect("Could not get location constraint from region string"); + Self { client, bucket: s3_config.bucket_name.clone(), bucket_location_constraint: location_constraint } } } @@ -90,11 +87,15 @@ impl DataStorage for AWSS3 { } async fn create_bucket(&self, bucket_name: &str) -> Result<()> { - let create_bucket_config = Some( - CreateBucketConfiguration::builder() - .location_constraint(self.bucket_location_constraint.clone()) - .build(), - ); + let create_bucket_config = if self.bucket_location_constraint.as_str() == "us-east-1" { + Some(CreateBucketConfiguration::builder().build()) + } else { + Some( + CreateBucketConfiguration::builder() + .location_constraint(self.bucket_location_constraint.clone()) + .build(), + ) + }; self.client .create_bucket()