diff --git a/moto/iam/responses.py b/moto/iam/responses.py index 947cccf3..086ba508 100644 --- a/moto/iam/responses.py +++ b/moto/iam/responses.py @@ -1779,12 +1779,12 @@ GET_ACCESS_KEY_LAST_USED_TEMPLATE = """ {{ user_name }} - {{% if last_used % }} + {% if last_used is defined %} {{ last_used }} - {{% else % }} + {% else %} N/A N/A - {{% endif %}} + {% endif %}