terraform/builtin/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
..
archive provider/archive: Converting to datasource. (#8492) 2016-10-25 15:59:06 +01:00
atlas
aws provider/aws: Remove IAM user's MFA devices with `force_destroy` #5908 (#10262) 2016-11-21 10:17:27 +02:00
azure
azurerm Merge pull request #10032 from hashicorp/jbardin/vet 2016-11-14 08:49:16 -05:00
bitbucket
chef provider/chef: Updating the provider_test comments to remove a company name (#10197) 2016-11-18 10:53:21 +02:00
clc
cloudflare
cloudstack Remove the need for specifying a network ID (#10204) 2016-11-18 08:20:31 +01:00
cobbler
consul Fixes for consul_service resource (#9366) 2016-10-26 13:07:00 +01:00
datadog provider/datadog: Reduce diff on thresholds 2016-10-20 10:22:24 -05:00
digitalocean Fix future vet errors in providers 2016-11-10 18:10:43 -05:00
dme
dnsimple
docker provider/docker: Fixes for docker_container host object and documentation (#9367) 2016-10-27 10:54:05 +01:00
dyn
fastly
github provider/github: Creating a github repository before adding a label (#10213) 2016-11-18 13:38:46 +02:00
google Merge pull request #10117 from cblecker/f-gke-node-scopes 2016-11-18 20:19:26 -08:00
grafana
heroku
influxdb
librato
logentries
mailgun
mysql
nomad providers/nomad: use DefaultConfig to intialize all fields 2016-11-19 10:20:54 -08:00
null
openstack provider/openstack: Add 'value_specs' option to 'openstack_fw_firewall_v1' resource 2016-11-05 10:17:33 +00:00
packet
pagerduty Remove the unnecessary use of &schema.Schema 2016-10-24 16:43:53 +02:00
postgresql provider/postgresql: Fixing up the PG Extension test 2016-11-03 12:06:51 +00:00
powerdns
rabbitmq Fix vet issues 2016-10-18 11:11:12 -04:00
random provider/random: Separate read from create 2016-11-06 17:05:11 -06:00
rundeck
scaleway provider/scaleway: improve volume attachment (#10084) 2016-11-17 15:08:05 +02:00
softlayer
statuscake
template Remove sthulb/mine/multipart 2016-11-04 11:23:21 +00:00
terraform
test
tls
triton
ultradns
vault provider/vault: vault_generic_secret data source 2016-10-29 23:16:57 -07:00
vcd
vsphere