Skip to content

Commit

Permalink
Add detailed comments for methods
Browse files Browse the repository at this point in the history
  • Loading branch information
robperc committed Jul 18, 2017
1 parent 28b6249 commit 0c27d6f
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ def lambda_handler(event, context):


def get_username_from_key(access_key_id):
""" Retrieves username last associated with specified IAM access key ID.
Args:
access_key_id (string): IAM access key ID to lookup user with.
Returns:
(string)
Username last associated with specified IAM access key ID.
"""
try:
response = iam.get_access_key_last_used(
AccessKeyId=access_key_id
Expand All @@ -33,6 +40,13 @@ def get_username_from_key(access_key_id):


def delete_exposed_key_pair(username, access_key_id):
""" Deletes IAM access key pair for specified user identified by access key ID.
Args:
username (string): Username of IAM user to delete key pair for.
access_key_id (string): IAM access key ID to identify key pair to delete.
Returns:
(None)
"""
try:
iam.delete_access_key(
UserName=username,
Expand Down

0 comments on commit 0c27d6f

Please sign in to comment.