Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider/aws: Ignore NoSuchEntity error when IAM user does not have login profile #9900

Merged

Conversation

minamijoyo
Copy link
Contributor

Fixes #9863

When IAM user does not have login profile, we shoud simply ignore it.

$ 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/05 23:34:25 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 (24.16s)
=== RUN   TestAccAWSUser_basic
--- PASS: TestAccAWSUser_basic (41.82s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    66.001s

@stack72
Copy link
Contributor

stack72 commented Nov 7, 2016

Hi @minamijoyo

Thanks for the PR here - it doesn't quite work as expected I am afraid - I am going to get this working based on your PR and then merge it in :)

Error applying plan:

1 error(s) occurred:

* aws_iam_user.user: Error deleting IAM User test-user: DeleteConflict: Cannot delete entity, must detach all policies first.
    status code: 409, request id: 24dc5ee9-a4d5-11e6-a6a6-27f653057c20

Thanks for the work here to help us diagnose the issue

Paul

@stack72
Copy link
Contributor

stack72 commented Nov 7, 2016

ok, I 100% take that back - it works 100% as intended :) I was using an attached policy rather than an access key and no login profile :)

Thanks for the work here!

Paul

@stack72
Copy link
Contributor

stack72 commented Nov 7, 2016

% 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/07 10:34:09 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 (15.12s)
=== RUN   TestAccAWSUser_basic
--- PASS: TestAccAWSUser_basic (31.08s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    46.219s

@stack72 stack72 merged commit f68d5e8 into hashicorp:master Nov 7, 2016
@minamijoyo
Copy link
Contributor Author

@stack72 Thank you 😄

gusmat pushed a commit to gusmat/terraform that referenced this pull request Dec 6, 2016
@ghost
Copy link

ghost commented Apr 20, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws_iam_user: Destroying users with force_destroy does not work
2 participants