aws-samples / aws-iam-access-key-auto-rotation

This set of CloudFormation templates and Python scripts will set up an auto-rotation function that will automatically rotate your AWS IAM User Access Keys every 90 days.
MIT No Attribution
140 stars 130 forks source link

ParamValidationError: Parameter validation failed #3

Closed johnvroblesjr closed 3 years ago

johnvroblesjr commented 3 years ago

Hi, I have followed the setup but encountered this error, can you help me what's wrong? I am not very familiar with lambda.

[ERROR] ParamValidationError: Parameter validation failed: Invalid type for parameter AccessKeyId, value: {'UserName': 'iam-user', 'AccessKeyId': 'XXXXXXXXXXXXXXXXX', 'Status': 'Inactive', 'CreateDate': datetime.datetime(2020, 9, 29, 11, 29, 30, tzinfo=tzlocal())}, type: <class 'dict'>, valid types: <class 'str'> Traceback (most recent call last): File "/var/task/main.py", line 107, in lambda_handler process_user(user, response) File "/var/task/main.py", line 223, in process_user iam.delete_access_key(UserName=user_name, File "/var/runtime/botocore/client.py", line 357, in _api_call return self._make_api_call(operation_name, kwargs) File "/var/runtime/botocore/client.py", line 648, in _make_api_call request_dict = self._convert_to_request_dict( File "/var/runtime/botocore/client.py", line 696, in _convert_to_request_dict request_dict = self._serializer.serialize_to_request( File "/var/runtime/botocore/validate.py", line 297, in serialize_to_request raise ParamValidationError(report=report.generate_report())

johnvroblesjr commented 3 years ago

fixed.

bumblebee939 commented 3 years ago

@johnvroblesjr Could you please tell how did you fix this one ?