terraform/website/source/docs/providers/aws/r
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
..
alb.html.markdown Merge branch 'master' of https://github.com/jvasallo/terraform into jvasallo-master 2016-10-27 11:00:48 +01:00
alb_listener.html.markdown
alb_listener_rule.html.markdown
alb_target_group.html.markdown provider/aws: Expose ARN suffix on ALB Target Group (#9734) 2016-10-31 17:05:06 +00:00
alb_target_group_attachment.html.markdown
ami.html.markdown
ami_copy.html.markdown
ami_from_instance.html.markdown
ami_launch_permission.html.markdown
api_gateway_account.html.markdown
api_gateway_api_key.html.markdown Exposed aws_api_gateway_api_key created_date & last_updated_date (#9530) 2016-11-14 12:03:56 +02:00
api_gateway_authorizer.html.markdown
api_gateway_base_path_mapping.html.markdown Corrected stage_name argument 2016-09-06 16:40:08 +01:00
api_gateway_client_certificate.html.markdown provider/aws: Add API Gateway Client Certificate 2016-09-12 10:09:47 +01:00
api_gateway_deployment.html.markdown Exposed aws_api_gateway_deployment.created_date attribute 2016-11-14 11:21:36 +01:00
api_gateway_domain_name.html.markdown Exposed aws_api_gw_domain_name.certificate_upload_date attribute (#9533) 2016-10-25 16:07:08 +01:00
api_gateway_integration.html.markdown Add new "ANY" as valid HTTP method to API Gateway validator. 2016-10-06 16:11:45 +01:00
api_gateway_integration_response.html.markdown Add new "ANY" as valid HTTP method to API Gateway validator. 2016-10-06 16:11:45 +01:00
api_gateway_method.html.markdown Add new "ANY" as valid HTTP method to API Gateway validator. 2016-10-06 16:11:45 +01:00
api_gateway_method_response.html.markdown Add new "ANY" as valid HTTP method to API Gateway validator. 2016-10-06 16:11:45 +01:00
api_gateway_model.html.markdown
api_gateway_resource.html.markdown
api_gateway_rest_api.html.markdown Exposed AWS API GW REST Api created_date attribute 2016-11-14 11:56:41 +01:00
app_cookie_stickiness_policy.html.markdown
appautoscaling_policy.html.markdown
appautoscaling_target.html.markdown
autoscaling_attachment.html.markdown provider/aws: aws_autoscaling_attachment resource (#9146) 2016-11-03 13:08:49 +00:00
autoscaling_group.html.markdown docs/aws: Document initial_lifecycle_hook in aws_autoscaling_group 2016-11-14 12:06:00 -08:00
autoscaling_lifecycle_hooks.html.markdown docs/aws: Document initial_lifecycle_hook in aws_autoscaling_group 2016-11-14 12:06:00 -08:00
autoscaling_notification.html.markdown
autoscaling_policy.html.markdown
autoscaling_schedule.html.markdown
cloudformation_stack.html.markdown Fixed the parameters structure 2016-10-23 19:13:45 -07:00
cloudfront_distribution.html.markdown Add 'tags' attribute to the docs for aws_cloudfront_distribution 2016-10-24 15:10:37 -07:00
cloudfront_origin_access_identity.html.markdown
cloudtrail.html.markdown
cloudwatch_event_rule.html.markdown
cloudwatch_event_target.html.markdown
cloudwatch_log_group.html.markdown
cloudwatch_log_metric_filter.html.markdown
cloudwatch_log_stream.html.markdown provider/aws: `aws_cloudwatch_log_stream` resource 2016-09-04 00:26:02 +03:00
cloudwatch_log_subscription_filter.html.markdown
cloudwatch_metric_alarm.html.markdown
code_commit_repository.html.markdown Remove Region Condition From CodeCommit Repo Resource (#8778) 2016-09-12 07:30:46 +01:00
code_commit_trigger.html.markdown Added Codecommit Trigger 2016-09-12 10:17:04 +05:30
codedeploy_app.html.markdown
codedeploy_deployment_group.html.markdown
customer_gateway.html.markdown
db_event_subscription.html.markdown provider/aws: Import aws_db_event_subscription 2016-10-04 15:24:30 -06:00
db_instance.html.markdown Point to CreateDBInstance docs for more info 2016-11-21 10:01:17 +11:00
db_option_group.html.markdown
db_parameter_group.html.markdown
db_security_group.html.markdown
db_subnet_group.html.markdown
default_network_acl.html.markdown Correct the name of the notes section mentioned 2016-11-18 09:55:37 -05:00
default_route_table.html.markdown docs: Fix misspelled words 2016-09-12 07:08:00 +01:00
default_security_group.html.markdown provider/aws: Fix documenation regarding default resources 2016-11-03 09:38:12 -05:00
directory_service_directory.html.markdown
dynamodb_table.html.markdown Add import documentation for DynamoDB Table (#10025) 2016-11-11 11:54:56 +02:00
ebs_volume.html.md
ecr_repository.html.markdown
ecr_repository_policy.html.markdown
ecs_cluster.html.markdown
ecs_service.html.markdown
ecs_task_definition.html.markdown Re-factor documentation for the aws_ecs_task_definition resource. 2016-10-19 16:29:43 +01:00
efs_file_system.html.markdown mostly typos in documens and aws autoscaling id instead of name 2016-09-30 22:41:15 +02:00
efs_mount_target.html.markdown
eip.html.markdown Remove references to documentation localised in French. 2016-10-24 11:59:03 +01:00
eip_association.html.markdown
elastic_beanstalk_application.html.markdown
elastic_beanstalk_configuration_template.html.markdown Remove references to documentation localised in French. 2016-10-24 11:59:03 +01:00
elastic_beanstalk_environment.html.markdown Remove references to documentation localised in French. 2016-10-24 11:59:03 +01:00
elastic_transcoder_pipeline.html.markdown
elastic_transcoder_preset.html.markdown
elasticache_cluster.html.markdown Remove references to documentation localised in French. 2016-10-24 11:59:03 +01:00
elasticache_parameter_group.html.markdown
elasticache_replication_group.html.markdown Document about ElastiCache Replication Group port (#9800) 2016-11-02 10:09:15 +00:00
elasticache_security_group.html.markdown
elasticache_subnet_group.html.markdown
elasticsearch_domain.html.markdown
elb.html.markdown Doc Update for ELB defaults 2016-11-15 15:00:13 -06:00
elb_attachment.html.markdown Docs typo - s/instaces/instances 2016-11-03 14:07:59 -07:00
emr_cluster.html.md EMR Cluster - core_instance_count doesn't actually refer to core instances 2016-11-09 08:47:23 -06:00
emr_instance_group.html.md re-go-fmt after rebase 2016-10-05 14:30:16 -05:00
flow_log.html.markdown aws_flow_docs 2016-09-23 11:18:17 -06:00
glacier_vault.html.markdown
iam_access_key.html.markdown
iam_account_password_policy.html.markdown provider/aws: New resource `aws_spot_datafeed_subscription` 2016-09-03 20:06:40 +03:00
iam_group.html.markdown Allow underscores in IAM user and group names (#9684) 2016-10-28 14:40:04 +02:00
iam_group_membership.html.markdown
iam_group_policy.html.markdown
iam_group_policy_attachment.markdown
iam_instance_profile.html.markdown
iam_policy.html.markdown Add name_prefix to aws_iam_policy (#10178) 2016-11-17 14:03:03 +02:00
iam_policy_attachment.html.markdown
iam_role.html.markdown Fixed ##10079 exposing aws_iam_role create_date attribute (#10091) 2016-11-14 11:33:53 +02:00
iam_role_policy.html.markdown
iam_role_policy_attachment.markdown
iam_saml_provider.html.markdown
iam_server_certificate.html.markdown
iam_user.html.markdown provider/aws: Remove IAM user's MFA devices with `force_destroy` #5908 (#10262) 2016-11-21 10:17:27 +02:00
iam_user_login_profile.html.markdown provider/aws: Docs for aws_iam_user_login_profile 2016-10-25 12:08:51 -05:00
iam_user_policy.html.markdown
iam_user_policy_attachment.markdown
iam_user_ssh_key.html.markdown
instance.html.markdown Merge pull request #9172 from dnABic/docs-p2 2016-10-21 10:10:27 -05:00
internet_gateway.html.markdown
key_pair.html.markdown provider/aws: Add key_name_prefix argument to aws_key_pair resource (#9993) 2016-11-09 15:35:51 +00:00
kinesis_firehose_delivery_stream.html.markdown Added retry_option for aws_kinesis_firehose_stream redshift_configuration 2016-11-15 10:55:02 -06:00
kinesis_stream.html.markdown
kms_alias.html.markdown
kms_key.html.markdown
lambda_alias.html.markdown Added "arn" attribute to AWS Lambda alias 2016-10-16 21:43:44 +09:00
lambda_event_source_mapping.html.markdown
lambda_function.html.markdown docs: Fix misspelled words 2016-09-12 07:08:00 +01:00
lambda_permission.html.markdown Update aws_lambda_permission for CloudWatch Events 2016-09-22 20:14:42 -04:00
launch_configuration.html.markdown Adding launch configuration documentation update (#10015) 2016-11-10 12:02:01 +00:00
lb_cookie_stickiness_policy.html.markdown
lb_ssl_negotiation_policy.html.markdown
load_balancer_backend_server_policy.html.markdown
load_balancer_listener_policy.html.markdown
load_balancer_policy.html.markdown docs: Fix misspelled words 2016-09-12 07:08:00 +01:00
main_route_table_assoc.html.markdown
nat_gateway.html.markdown
network_acl.html.markdown
network_acl_rule.html.markdown
network_interface.markdown
opsworks_application.html.markdown docs: Fix misspelled words 2016-09-12 07:08:00 +01:00
opsworks_custom_layer.html.markdown Add ability to import AWS OpsWorks Custom Layers 2016-10-07 11:57:11 +01:00
opsworks_ganglia_layer.html.markdown
opsworks_haproxy_layer.html.markdown
opsworks_instance.html.markdown
opsworks_java_app_layer.html.markdown
opsworks_memcached_layer.html.markdown
opsworks_mysql_layer.html.markdown
opsworks_nodejs_app_layer.html.markdown
opsworks_permission.html.markdown mostly typos in documens and aws autoscaling id instead of name 2016-09-30 22:41:15 +02:00
opsworks_php_app_layer.html.markdown
opsworks_rails_app_layer.html.markdown
opsworks_stack.html.markdown Add ability to import OpsWorks stacks 2016-09-29 11:44:58 +01:00
opsworks_static_web_layer.html.markdown
opsworks_user_profile.html.markdown
placement_group.html.markdown
proxy_protocol_policy.html.markdown
rds_cluster.html.markdown Remove references to documentation localised in French. 2016-10-24 11:59:03 +01:00
rds_cluster_instance.html.markdown aws: Fix docs after changing Aurora instance schema 2016-09-26 20:50:20 +01:00
rds_cluster_parameter_group.markdown
redshift_cluster.html.markdown Updated Redshift Documentation and Added Test Cases for Redshift Enchaned VPC routing 2016-11-08 18:13:10 +05:30
redshift_parameter_group.html.markdown
redshift_security_group.html.markdown Update redshift_security_group.html.markdown 2016-09-19 10:47:18 -07:00
redshift_subnet_group.html.markdown Updated the documentation to reflect that subnets_ids is required (#9817) 2016-11-02 21:43:26 +00:00
route.html.markdown
route53_delegation_set.html.markdown
route53_health_check.html.markdown Document the enable_sni attribute on the website. 2016-11-02 16:32:27 -07:00
route53_record.html.markdown
route53_zone.html.markdown Tiny typo (#9755) 2016-10-31 20:46:13 +00:00
route53_zone_association.html.markdown
route_table.html.markdown
route_table_association.html.markdown
s3_bucket.html.markdown AWS S3 bucket life_cycle rule IDs must be unique. 2016-09-23 15:09:25 -07:00
s3_bucket_notification.html.markdown Clarify how to notify multiple lambdas (#8854) 2016-09-15 15:28:07 -05:00
s3_bucket_object.html.markdown
s3_bucket_policy.html.markdown
security_group.html.markdown provider/aws: update AWS documentation on -1 protocol for Security Groups 2016-11-03 16:14:28 -05:00
security_group_rule.html.markdown Update the docs for the AWS security_group_rule resource. 2016-10-12 12:24:45 -07:00
ses_active_receipt_rule_set.html.markdown
ses_receipt_filter.html.markdown
ses_receipt_rule.html.markdown
ses_receipt_rule_set.html.markdown Update ses_receipt_rule_set.html.markdown 2016-09-13 17:19:04 +02:00
simpledb_domain.html.markdown
sns_topic.html.markdown
sns_topic_policy.html.markdown provider/aws: Add aws_sns_topic_policy 2016-09-04 18:34:24 +01:00
sns_topic_subscription.html.markdown "aws_sns_topic_subscription" add further clarification for cross account SNS topic to SQS queue subscription 2016-11-03 11:58:24 -04:00
spot_datafeed_subscription.html.markdown Update documentation for aws_spot_datafeed_subscription. 2016-11-07 15:48:11 -07:00
spot_fleet_request.html.markdown docs: Fix misspelled words 2016-09-12 07:08:00 +01:00
spot_instance_request.html.markdown
sqs_queue.html.markdown
sqs_queue_policy.html.markdown provider/aws: Add aws_sqs_queue_policy 2016-09-05 08:17:48 +01:00
ssm_activation.html.markdown New AWS resource `ssm_activation` (#9111) 2016-10-28 11:59:12 +02:00
ssm_association.html.markdown
ssm_document.html.markdown docs: Fix misspelled words 2016-09-12 07:08:00 +01:00
subnet.html.markdown
volume_attachment.html.markdown provider/aws: Provide the option to skip_destroy on aws_volume_attachment (#9792) 2016-11-02 15:29:37 +00:00
vpc.html.markdown Remove references to documentation localised in French. 2016-10-24 11:59:03 +01:00
vpc_dhcp_options.html.markdown
vpc_dhcp_options_association.html.markdown
vpc_endpoint.html.markdown Correct 'VPN Endpoints' to 'VPC Endpoints' (#9887) 2016-11-04 19:47:52 +00:00
vpc_peering.html.markdown aws_vpc_peering_connection ambiguous language 2016-11-05 19:38:07 +01:00
vpn_connection.html.markdown provider/aws: Setting static_routes_only on import of vpn_connection (#9802) 2016-11-07 16:12:41 +00:00
vpn_connection_route.html.markdown
vpn_gateway.html.markdown
vpn_gateway_attachment.html.markdown
waf_byte_match_set.html.markdown docs/aws: Fixing the AWS WAF Documentation 2016-11-01 19:42:56 +00:00
waf_ipset.html.markdown docs/aws: Fixing the AWS WAF Documentation 2016-11-01 19:42:56 +00:00
waf_rule.html.markdown docs/aws: Fixing the AWS WAF Documentation 2016-11-01 19:42:56 +00:00
waf_size_constraint_set.html.markdown docs/aws: Fixing the AWS WAF Documentation 2016-11-01 19:42:56 +00:00
waf_sql_injection_match_set.html.markdown docs/aws: Fixing the AWS WAF Documentation 2016-11-01 19:42:56 +00:00
waf_web_acl.html.markdown docs/aws: Fixing the AWS WAF Documentation 2016-11-01 19:42:56 +00:00
waf_xss_match_set.html.markdown docs/aws: Fixing the AWS WAF Documentation 2016-11-01 19:42:56 +00:00