Files
opentf/website/source/docs/providers
Richard Henning 2a5e1d400d provider/aws: Remove IAM user's MFA devices with force_destroy #5908 (#10262)
When `force_destroy` was specifed on an `aws_iam_user` resource, only IAM
access keys and the login profile were destroyed. If a multi-factor auth
device had been activated for that user, deletion would fail as follows:

```
* aws_iam_user.testuser1: Error deleting IAM User testuser1: DeleteConflict: Cannot delete entity, must delete MFA device first.
    status code: 409, request id: aa41b1b7-ac4d-11e6-bb3f-3b4c7a310c65
```

This commit iterates over any of the user's MFA devices and deactivates
them before deleting the user. It follows a pattern similar to that used
to remove users' IAM access keys before deletion.

```
$ make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSUser_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/11/20 17:09:00 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSUser_ -timeout 120m
=== RUN   TestAccAWSUser_importBasic
--- PASS: TestAccAWSUser_importBasic (5.70s)
=== RUN   TestAccAWSUser_basic
--- PASS: TestAccAWSUser_basic (11.12s)
PASS
ok  	github.com/rhenning/terraform/builtin/providers/aws	20.840s
```
2016-11-21 10:17:27 +02:00
..
2016-11-18 14:30:54 +02:00
2016-10-22 18:35:37 +02:00
2016-09-12 07:08:00 +01:00
2016-09-12 07:08:00 +01:00
2016-11-08 16:08:46 +01:00
2016-07-27 12:30:07 +01:00
2015-07-31 08:39:52 -04:00
2015-08-14 18:56:57 -03:00
2016-09-12 07:08:00 +01:00
2016-10-24 10:34:06 -07:00
2016-08-20 12:03:20 +01:00
2016-09-01 19:04:41 +00:00
2016-10-24 14:14:49 -07:00
2016-03-20 12:10:59 -05:00
2016-11-15 13:49:01 -06:00