Skip to content

Commit

Permalink
check if AWS CLI is configured for account access
Browse files Browse the repository at this point in the history
  • Loading branch information
lxg committed Oct 18, 2023
1 parent 53a10ff commit 3512ff4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ask_bedrock/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ def converse(context: str):
config = create_config(None)
put_config(context, config)

sts = boto3.client('sts')
try:
sts.get_caller_identity()
except Exception as e:
click.secho(f"Credentials are NOT valid: {e}. You may need to check your local AWS CLI configuration.")
return

start_conversation(config)


Expand Down

0 comments on commit 3512ff4

Please sign in to comment.