Created
September 6, 2021 06:08
-
-
Save ollytheninja/0c6c0ff4724b1fc9f7ad05382bcc386b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
import botocore | |
def validate_key(id, secret): | |
sts = boto3.client('sts', aws_access_key_id=id, aws_secret_access_key=secret) | |
try: | |
identity = sts.get_caller_identity() | |
print('Identity ARN: ' + identity['Arn']) | |
except botocore.exceptions.ClientError as e: | |
print("Probably not valid") | |
print(e) | |
if __name__ == "__main__": | |
validate_key(input("AWS KEY: "), input("AWS SECRET: ")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment