hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.84k stars 9.19k forks source link

feat: mark password attribute of aws_iam_user_login_profile as sensitive #39991

Closed stefanfreitag closed 1 week ago

stefanfreitag commented 1 week ago

Description

As mentioned in #39907 the attribute password of the resource is not marked as sensitive. This implies that its value is displayed e.g. when running a terraform destroy command.

  # aws_iam_user_login_profile.this will be destroyed
  - resource "aws_iam_user_login_profile" "this" {
      - id              = "tf-bugreport-test" -> null
      - password        = "<redacted>" -> null
      - password_length = 20 -> null
      - user            = "tf-bugreport-test" -> null
    }

By marking this attribute as sensitive the output of same command changes to

  # aws_iam_user_login_profile.this will be destroyed
  - resource "aws_iam_user_login_profile" "this" {
      - id              = "tf-bugreport-test" -> null
      - password        = (sensitive value) -> null
      - password_length = 20 -> null
      - user            = "tf-bugreport-test" -> null
    }

The password is no longer displayed.

As part of this pull request I executed the existing tests related to the resource. I did not find any guidance on acceptance tests for this kind of change. If you could point me into a direction it would be great!

Relations

Closes #39907

References

Output from Acceptance Testing

❯ make testacc TESTS=TestAccIAMUserLoginProfile PKG=iam
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.2 test ./internal/service/iam/... -v -count 1 -parallel 5 -run='TestAccIAMUserLoginProfile'  -timeout 360m
2024/11/02 14:09:20 Initializing Terraform AWS Provider...
=== RUN   TestAccIAMUserLoginProfile_basic
=== PAUSE TestAccIAMUserLoginProfile_basic
=== RUN   TestAccIAMUserLoginProfile_keybase
=== PAUSE TestAccIAMUserLoginProfile_keybase
=== RUN   TestAccIAMUserLoginProfile_keybaseDoesntExist
=== PAUSE TestAccIAMUserLoginProfile_keybaseDoesntExist
=== RUN   TestAccIAMUserLoginProfile_notAKey
=== PAUSE TestAccIAMUserLoginProfile_notAKey
=== RUN   TestAccIAMUserLoginProfile_passwordLength
=== PAUSE TestAccIAMUserLoginProfile_passwordLength
=== RUN   TestAccIAMUserLoginProfile_nogpg
=== PAUSE TestAccIAMUserLoginProfile_nogpg
=== RUN   TestAccIAMUserLoginProfile_disappears
=== PAUSE TestAccIAMUserLoginProfile_disappears
=== RUN   TestAccIAMUserLoginProfile_passwordResetRequired
=== PAUSE TestAccIAMUserLoginProfile_passwordResetRequired
=== CONT  TestAccIAMUserLoginProfile_basic
=== CONT  TestAccIAMUserLoginProfile_passwordResetRequired
=== CONT  TestAccIAMUserLoginProfile_passwordLength
=== CONT  TestAccIAMUserLoginProfile_disappears
=== CONT  TestAccIAMUserLoginProfile_notAKey
--- PASS: TestAccIAMUserLoginProfile_notAKey (19.39s)
=== CONT  TestAccIAMUserLoginProfile_keybaseDoesntExist
--- PASS: TestAccIAMUserLoginProfile_keybaseDoesntExist (17.13s)
=== CONT  TestAccIAMUserLoginProfile_keybase
--- PASS: TestAccIAMUserLoginProfile_passwordLength (37.73s)
=== CONT  TestAccIAMUserLoginProfile_nogpg
--- PASS: TestAccIAMUserLoginProfile_disappears (38.60s)
--- PASS: TestAccIAMUserLoginProfile_basic (42.12s)
--- PASS: TestAccIAMUserLoginProfile_passwordResetRequired (42.23s)
--- PASS: TestAccIAMUserLoginProfile_keybase (31.25s)
--- PASS: TestAccIAMUserLoginProfile_nogpg (30.75s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/iam        68.698s
github-actions[bot] commented 1 week ago

Community Note

Voting for Prioritization

For Submitters

jar-b commented 1 week ago

Thanks for your contribution, @stefanfreitag! 👍

github-actions[bot] commented 4 days ago

This functionality has been released in v5.75.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!