Skip to content

Commit

Permalink
using boto3 session region directly for log configuration region (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroEsquivel authored Dec 6, 2022
1 parent 4d7c7ec commit 81ab2bc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [UNRELEASED]

### Changed

- Using region value directly from boto3 session to configure logging to support cases where user supplied region is empty

## [0.27.0] - 2022-11-28

### Changed
Expand Down
7 changes: 5 additions & 2 deletions covalent_awsbatch_plugin/awsbatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,10 @@ async def submit_task(self, task_metadata: Dict, identity: Dict) -> Any:
account = identity["Account"]

self._debug_log("Submitting task...")
batch = boto3.Session(**self.boto_session_options()).client("batch")
boto_session = boto3.Session(**self.boto_session_options())
batch = boto_session.client("batch")

region = boto_session.region_name

resources = [
{"type": "VCPU", "value": str(int(self.vcpu))},
Expand Down Expand Up @@ -263,7 +266,7 @@ async def submit_task(self, task_metadata: Dict, identity: Dict) -> Any:
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-region": self.region,
"awslogs-region": region,
"awslogs-group": self.log_group_name,
"awslogs-create-group": "true",
"awslogs-stream-prefix": "covalent-batch",
Expand Down

0 comments on commit 81ab2bc

Please sign in to comment.