Skip to content

Commit

Permalink
reverted change to AWS_Config sts__session_account_id and sts__caller…
Browse files Browse the repository at this point in the history
…_identity_user which had quite a number of side effects
  • Loading branch information
DinisCruz committed Sep 10, 2024
1 parent 5aad265 commit f0a1b9c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions osbot_aws/AWS_Config.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ def set_lambda_role_name (self, value): os.environ['OSBOT_LAMBDA_ROLE_NAM
def set_bot_name (self, value): os.environ['OSBOT_NAME' ] = value ; return value

def sts__session_account_id(self): # to handle when the AWS_ACCOUNT_ID is not set
if self.aws_configured():
from osbot_aws.aws.sts.STS import STS # the use of this method is not advised
return STS().current_account_id() # since this is quite an expensive method
#if self.aws_configured(): # todo: find an efficient way to handle this since this doesn't work when a role is attached to a lambda function or EC2 instance
from osbot_aws.aws.sts.STS import STS # the use of this method is not advised
return STS().current_account_id() # since this is quite an expensive method

def sts__caller_identity_user(self):
if self.aws_configured():
from osbot_aws.aws.sts.STS import STS #
return STS().caller_identity_user() #
#if self.aws_configured(): # todo: find an efficient way to handle this since this doesn't work when a role is attached to a lambda function or EC2 instance
from osbot_aws.aws.sts.STS import STS #
return STS().caller_identity_user() #

# helper methods
def account_id (self):
Expand Down

0 comments on commit f0a1b9c

Please sign in to comment.