Skip to content

Commit a1d3bf8

Browse files
author
Chris Gilmer
committed
Add docs on troubleshooting
1 parent a3f7508 commit a1d3bf8

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,32 @@ set):
131131
```shell
132132
AWS_VAULT_KEYCHAIN_NAME=login aws-vault exec test-profile-name -- aws sts get-caller-identity
133133
```
134+
135+
### Troubleshooting
136+
137+
#### User partially creates MFA device
138+
139+
The user might find themselves in an odd situation where the virtual MFA device was created but not assigned to the
140+
user. This will prevent the user from coming back to the setup script and completing it. Here are steps to resolve if
141+
the vMFA was created with no assigned user:
142+
143+
```sh
144+
aws iam list-virtual-mfa-devices
145+
# Find device with serial format of `arn:aws:iam::<AWS_ACCOUNT_ID>:mfa/<IAM_USERNAME>`
146+
# It may be listed without a User associated with it.
147+
SERIAL=arn:aws:iam::<AWS_ACCOUNT_ID>:mfa/<IAM_USERNAME>
148+
aws iam delete-virtual-mfa-device --serial-number "$SERIAL"
149+
```
150+
151+
If the device was registered to a user it may need to be deactivated first, in which case its easier to find the
152+
`SERIAL` programatically:
153+
154+
155+
```sh
156+
export USERNAME=somebody
157+
SERIAL=$(aws iam list-mfa-devices --user-name "${USERNAME}" | jq -r ".MFADevices[].SerialNumber")
158+
aws iam deactivate-mfa-device --user-name "${USERNAME}" --serial-number "${SERIAL}"
159+
aws iam delete-virtual-mfa-device --serial-number "$SERIAL"
160+
```
161+
162+
Now the device should be completely removed. Have them re-run the script.

0 commit comments

Comments
 (0)