Skip to content

Commit

Permalink
chore: Use region value from the configuration (#872)
Browse files Browse the repository at this point in the history
* chore(): Use the config region in key-manager

* fmt

* prints for debugging

* restore the app level aws config

* fmt

* remove space
  • Loading branch information
wojciechsromek authored Jan 2, 2025
1 parent d364891 commit 884e2a9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions deploy/e2e/iris-mpc-0.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ iris-mpc-0:
- name: SMPC__ENVIRONMENT
value: "$ENV"

- name: SMPC__AWS__REGION
value: "$AWS_REGION"

- name: SMPC__SERVICE__SERVICE_NAME
value: "smpcv2-server-$ENV"

Expand Down
3 changes: 3 additions & 0 deletions deploy/e2e/iris-mpc-1.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ iris-mpc-1:
- name: SMPC__ENVIRONMENT
value: "$ENV"

- name: SMPC__AWS__REGION
value: "$AWS_REGION"

- name: SMPC__SERVICE__SERVICE_NAME
value: "smpcv2-server-$ENV"

Expand Down
3 changes: 3 additions & 0 deletions deploy/e2e/iris-mpc-2.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ iris-mpc-2:
- name: SMPC__ENVIRONMENT
value: "$ENV"

- name: SMPC__AWS__REGION
value: "$AWS_REGION"

- name: SMPC__SERVICE__SERVICE_NAME
value: "smpcv2-server-$ENV"

Expand Down
5 changes: 5 additions & 0 deletions iris-mpc-common/src/helpers/key_pair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ impl SharesEncryptionKeyPairs {
.aws
.and_then(|aws| aws.region)
.unwrap_or_else(|| REGION.to_owned());
tracing::info!("Using region: {} for key pair download", region);
let region_provider = Region::new(region);
let shared_config = aws_config::from_env().region(region_provider).load().await;
let client = SecretsManagerClient::new(&shared_config);
Expand Down Expand Up @@ -199,6 +200,10 @@ async fn download_private_key_from_asm(
version_stage: &str,
) -> Result<String, SharesDecodingError> {
let private_key_secret_id: String = format!("{}/iris-mpc/ecdh-private-key-{}", env, node_id);
tracing::info!(
"Downloading private key from Secrets Manager: {}",
private_key_secret_id
);
match client
.get_secret_value()
.secret_id(private_key_secret_id)
Expand Down

0 comments on commit 884e2a9

Please sign in to comment.