Skip to content

Commit

Permalink
cw metrics working only in us-east-1 fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
SooLee committed May 6, 2020
1 parent f192ea0 commit 9d3d378
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tibanna/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Version information."""

# The following line *must* be the last in the module, exactly as formatted:
__version__ = "0.17.2"
__version__ = "0.17.3"
5 changes: 4 additions & 1 deletion tibanna/cw_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
upload,
read_s3
)
from .vars import (
AWS_REGION
)
# from datetime import timezone
from datetime import datetime
from datetime import timedelta
Expand All @@ -17,7 +20,7 @@ class TibannaResource(object):
def __init__(self, instance_id, filesystem, starttime, endtime=datetime.utcnow()):
self.instance_id = instance_id
self.filesystem = filesystem
self.client = boto3.client('cloudwatch', region_name='us-east-1')
self.client = boto3.client('cloudwatch', region_name=AWS_REGION)
# get resource metrics
nTimeChunks = (endtime - starttime) / timedelta(days=1)
# self.total_minutes = (endtime - starttime) / timedelta(minutes=1)
Expand Down
8 changes: 6 additions & 2 deletions tibanna/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
import os
import mimetypes
from uuid import uuid4, UUID
from .vars import _tibanna, EXECUTION_ARN
from .vars import (
_tibanna,
EXECUTION_ARN,
AWS_REGION
)


LOG = logging.getLogger(__name__)
Expand Down Expand Up @@ -48,7 +52,7 @@ def _tibanna_settings(settings_patch=None, force_inplace=False, env=''):

def randomize_run_name(run_name, sfn):
arn = EXECUTION_ARN(run_name, sfn)
client = boto3.client('stepfunctions', region_name='us-east-1')
client = boto3.client('stepfunctions', region_name=AWS_REGION)
try:
response = client.describe_execution(
executionArn=arn
Expand Down

0 comments on commit 9d3d378

Please sign in to comment.