Skip to content

Commit

Permalink
Merge pull request #744 from kukushking/fix/sts-region
Browse files Browse the repository at this point in the history
fix: sts pass toolchain region
  • Loading branch information
dgraeber authored Nov 1, 2024
2 parents 89631bc + 5e31b4e commit fba3f62
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a Ch
- Added ability to disable env replacement in module parameters
- Updating bootstrap docs with minimum permissions
- Update manifest example module versions
- Update session manager to pass toolchain role region to sts

### Fixes

Expand Down
2 changes: 2 additions & 0 deletions seedfarmer/services/session_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ def get_deployment_session(self, account_id: str, region_name: str) -> Session:
session_key = f"{account_id}-{region_name}"
project_name = self.config["project_name"]
qualifier = self.config.get("qualifier") if self.config.get("qualifier") else None
toolchain_region = self.config.get("toolchain_region")
if not self.created:
raise seedfarmer.errors.InvalidConfigurationError("The SessionManager object was never properly created...")
if session_key not in self.sessions.keys():
Expand All @@ -152,6 +153,7 @@ def get_deployment_session(self, account_id: str, region_name: str) -> Session:
aws_access_key_id=toolchain_role["Credentials"]["AccessKeyId"],
aws_secret_access_key=toolchain_role["Credentials"]["SecretAccessKey"],
aws_session_token=toolchain_role["Credentials"]["SessionToken"],
region_name=toolchain_region if toolchain_region else region_name,
)
partition = sts_toolchain_client.get_caller_identity()["Arn"].split(":")[1]
deployment_role_arn = get_deployment_role_arn(
Expand Down

0 comments on commit fba3f62

Please sign in to comment.