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

aws_iam_user_login_profile Automatically Imports Existing Infrastructure During Resource Creation #7536

Closed
bflad opened this issue Feb 13, 2019 · 1 comment · Fixed by #7745
Labels
bug Addresses a defect in current functionality. service/iam Issues and PRs that pertain to the iam service. technical-debt Addresses areas of the codebase that need refactoring or redesign.
Milestone

Comments

@bflad
Copy link
Contributor

bflad commented Feb 13, 2019

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Affected Resource(s)

  • aws_iam_user_login_profile

Terraform Configuration Files

resource "aws_iam_user_login_profile" "example" {
  user    = "${aws_iam_user.example.name}"
  pgp_key = "..."
}

Expected Behavior

If the IAM User already exists and has an existing Login Profile, Terraform should error during resource creation and require terraform import.

Actual Behavior

Terraform silently assumes management of existing IAM User Login Profile during resource creation.

Steps to Reproduce

  1. Create IAM User with Login Profile
  2. terraform apply above configuration with no existing state

Important Factoids

Requiring resource import is a general design tenet of Terraform to ensure operators understand existing infrastructure and to deter attempting to manage the same infrastructure in two places.

@bflad bflad added bug Addresses a defect in current functionality. service/iam Issues and PRs that pertain to the iam service. technical-debt Addresses areas of the codebase that need refactoring or redesign. labels Feb 13, 2019
@bflad bflad added this to the v2.0.0 milestone Feb 13, 2019
bflad added a commit that referenced this issue Feb 27, 2019
…esource recreation, and require import for existing infrastructure

References:
* #7536
* #3856

Output from acceptance testing:

```
--- PASS: TestAccAWSUserLoginProfile_notAKey (7.29s)
--- PASS: TestAccAWSUserLoginProfile_keybaseDoesntExist (7.36s)
--- PASS: TestAccAWSUserLoginProfile_PasswordLength (16.86s)
--- PASS: TestAccAWSUserLoginProfile_keybase (16.93s)
--- PASS: TestAccAWSUserLoginProfile_basic (24.81s)
```
@ghost
Copy link

ghost commented Mar 31, 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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/iam Issues and PRs that pertain to the iam service. technical-debt Addresses areas of the codebase that need refactoring or redesign.
Projects
None yet
1 participant