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

Add authentication_mode to aws_elasticache_user #28928

Merged
merged 14 commits into from Mar 15, 2023

Conversation

cscacun
Copy link

@cscacun cscacun commented Jan 17, 2023

Description

With IAM Authentication one can authenticate a connection to ElastiCache for Redis using AWS IAM identities, when the cluster is configured to use Redis version 7 or above (https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/auth-iam.html)

For this to work, one has to create an aws_elasticache_user with authentication_mode.type = iam.
This PR adds authentication_mode as an argument to aws_elasticache_user. The possible values for authentication_mode.type are password, no-password-required or iam. If type = password, then the passwords should be provided in the authentication_mode.passwords field

  authentication_mode {
    type      = "iam"
  }	

  authentication_mode {
    type             = "password"
    passwords  =  ["password123456789"]
  }	

  authentication_mode {
    type      = "no-password-required"
  }	

Relations

Resolves #28471
Resolves #27909
Resolves #29160
Resolves #28996

References

https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/auth-iam.html
https://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/API_CreateUser.html
https://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/API_AuthenticationMode.html

Output from Acceptance Testing

I could not run ALL the acceptance tests or even all the acceptance within the elasticache package because I was hitting limits on the AWS account.
However I ran all acceptance tests where aws_elasticache_user are created/used. Please find the output below

make testacc TESTS=TestAccElastiCacheReplicationGroup_updateUserGroups PKG=elasticache
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/elasticache/... -v -count 1 -parallel 20 -run='TestAccElastiCacheReplicationGroup_updateUserGroups'  -timeout 180m
=== RUN   TestAccElastiCacheReplicationGroup_updateUserGroups
=== PAUSE TestAccElastiCacheReplicationGroup_updateUserGroups
=== CONT  TestAccElastiCacheReplicationGroup_updateUserGroups
--- PASS: TestAccElastiCacheReplicationGroup_updateUserGroups (1101.53s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/elasticache	1125.431s
make testacc TESTS=TestAccElastiCacheUser PKG=elasticache
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/elasticache/... -v -count 1 -parallel 20 -run='TestAccElastiCacheUser'  -timeout 180m
=== RUN   TestAccElastiCacheUserDataSource_basic
=== PAUSE TestAccElastiCacheUserDataSource_basic
=== RUN   TestAccElastiCacheUserGroupAssociation_basic
=== PAUSE TestAccElastiCacheUserGroupAssociation_basic
=== RUN   TestAccElastiCacheUserGroupAssociation_update
=== PAUSE TestAccElastiCacheUserGroupAssociation_update
=== RUN   TestAccElastiCacheUserGroupAssociation_disappears
=== PAUSE TestAccElastiCacheUserGroupAssociation_disappears
=== RUN   TestAccElastiCacheUserGroupAssociation_multiple
=== PAUSE TestAccElastiCacheUserGroupAssociation_multiple
=== RUN   TestAccElastiCacheUserGroup_basic
=== PAUSE TestAccElastiCacheUserGroup_basic
=== RUN   TestAccElastiCacheUserGroup_update
=== PAUSE TestAccElastiCacheUserGroup_update
=== RUN   TestAccElastiCacheUserGroup_tags
=== PAUSE TestAccElastiCacheUserGroup_tags
=== RUN   TestAccElastiCacheUserGroup_disappears
=== PAUSE TestAccElastiCacheUserGroup_disappears
=== RUN   TestAccElastiCacheUser_basic
=== PAUSE TestAccElastiCacheUser_basic
=== RUN   TestAccElastiCacheUser_password_auth_mode
=== PAUSE TestAccElastiCacheUser_password_auth_mode
=== RUN   TestAccElastiCacheUser_iam_auth_mode
=== PAUSE TestAccElastiCacheUser_iam_auth_mode
=== RUN   TestAccElastiCacheUser_update
=== PAUSE TestAccElastiCacheUser_update
=== RUN   TestAccElastiCacheUser_update_password_auth_mode
=== PAUSE TestAccElastiCacheUser_update_password_auth_mode
=== RUN   TestAccElastiCacheUser_tags
=== PAUSE TestAccElastiCacheUser_tags
=== RUN   TestAccElastiCacheUser_disappears
=== PAUSE TestAccElastiCacheUser_disappears
=== CONT  TestAccElastiCacheUserDataSource_basic
=== CONT  TestAccElastiCacheUser_update
=== CONT  TestAccElastiCacheUser_password_auth_mode
=== CONT  TestAccElastiCacheUserGroupAssociation_basic
=== CONT  TestAccElastiCacheUserGroup_disappears
=== CONT  TestAccElastiCacheUser_iam_auth_mode
=== CONT  TestAccElastiCacheUser_tags
=== CONT  TestAccElastiCacheUser_disappears
=== CONT  TestAccElastiCacheUserGroupAssociation_multiple
=== CONT  TestAccElastiCacheUserGroup_tags
=== CONT  TestAccElastiCacheUserGroup_update
=== CONT  TestAccElastiCacheUserGroup_basic
=== CONT  TestAccElastiCacheUser_update_password_auth_mode
=== CONT  TestAccElastiCacheUserGroupAssociation_update
=== CONT  TestAccElastiCacheUserGroupAssociation_disappears
=== CONT  TestAccElastiCacheUser_basic
--- PASS: TestAccElastiCacheUserDataSource_basic (39.09s)
--- PASS: TestAccElastiCacheUser_basic (44.47s)
--- PASS: TestAccElastiCacheUser_password_auth_mode (44.73s)
--- PASS: TestAccElastiCacheUser_iam_auth_mode (45.21s)
--- PASS: TestAccElastiCacheUser_disappears (49.74s)
--- PASS: TestAccElastiCacheUser_update (100.57s)
--- PASS: TestAccElastiCacheUser_tags (101.94s)
--- PASS: TestAccElastiCacheUserGroup_tags (162.10s)
--- PASS: TestAccElastiCacheUserGroup_disappears (162.73s)
--- PASS: TestAccElastiCacheUserGroup_basic (165.46s)
--- PASS: TestAccElastiCacheUser_update_password_auth_mode (165.81s)
--- PASS: TestAccElastiCacheUserGroup_update (285.54s)
--- PASS: TestAccElastiCacheUserGroupAssociation_disappears (287.73s)
--- PASS: TestAccElastiCacheUserGroupAssociation_basic (291.13s)
--- PASS: TestAccElastiCacheUserGroupAssociation_update (403.80s)
--- PASS: TestAccElastiCacheUserGroupAssociation_multiple (405.45s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/elasticache	429.600s

@github-actions
Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added service/elasticache Issues and PRs that pertain to the elasticache service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. size/L Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. labels Jan 17, 2023
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome @cscacun 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTOR guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@github-actions github-actions bot added the documentation Introduces or discusses updates to documentation. label Jan 17, 2023
@justinretzolk justinretzolk added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Jan 17, 2023
@cscacun
Copy link
Author

cscacun commented Jan 18, 2023

@justinretzolk i was wondering if this PR is missing anything to be reviewed

@justinretzolk
Copy link
Member

Hey @cscacun 👋 On a brief look, everything looks prepped for review to me! At this point, we'll get this reviewed for merge as soon as it's able to be prioritized. We prioritize by count of 👍 reactions and a few other things, which is detailed in our prioritization guide if you're interested.

@borgessc
Copy link

I would like to see this feature merged as soon as possible since is very welcome to avoid API calls via the local-exec function to change the elasticache_user.

@justinretzolk let us know when this will be available.

@cscacun
Copy link
Author

cscacun commented Jan 31, 2023

@justinretzolk sorry to bug you, was wondering if you would have a very rough estimation for this review? if the queue before this one is too long, ill consider some workarounds

@justinretzolk
Copy link
Member

justinretzolk commented Feb 2, 2023

Hey @cscacun 👋 Thanks for following up here! I've updated the PR description to include a couple of additional issues that were filed requesting this. I still can't give a timeline on this (even a rough one), as I'd rather not make you a promise we can't keep. That said, I did follow up on this internally as well, to work on getting it prioritized given the number of upvotes and additional issues. We'll follow up with more details as soon as we've got a better idea on a timeline. Thank you again very much for taking the time to raise this PR, and for your patience as we work to prioritize it!

Copy link
Contributor

@schuylr schuylr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assisting with running tests. Test runs show failures and a possible regression on existing resources (see below).

terraform-provider-aws % make testacc TESTS=TestAccElastiCacheUser PKG=elasticache 
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/elasticache/... -v -count 1 -parallel 20 -run='TestAccElastiCacheUser'  -timeout 180m
=== RUN   TestAccElastiCacheUserDataSource_basic
=== PAUSE TestAccElastiCacheUserDataSource_basic
=== RUN   TestAccElastiCacheUserGroupAssociation_basic
=== PAUSE TestAccElastiCacheUserGroupAssociation_basic
=== RUN   TestAccElastiCacheUserGroupAssociation_update
=== PAUSE TestAccElastiCacheUserGroupAssociation_update
=== RUN   TestAccElastiCacheUserGroupAssociation_disappears
=== PAUSE TestAccElastiCacheUserGroupAssociation_disappears
=== RUN   TestAccElastiCacheUserGroupAssociation_multiple
=== PAUSE TestAccElastiCacheUserGroupAssociation_multiple
=== RUN   TestAccElastiCacheUserGroup_basic
=== PAUSE TestAccElastiCacheUserGroup_basic
=== RUN   TestAccElastiCacheUserGroup_update
=== PAUSE TestAccElastiCacheUserGroup_update
=== RUN   TestAccElastiCacheUserGroup_tags
=== PAUSE TestAccElastiCacheUserGroup_tags
=== RUN   TestAccElastiCacheUserGroup_disappears
=== PAUSE TestAccElastiCacheUserGroup_disappears
=== RUN   TestAccElastiCacheUser_basic
=== PAUSE TestAccElastiCacheUser_basic
=== RUN   TestAccElastiCacheUserWithPasswordAuthMode_basic
=== PAUSE TestAccElastiCacheUserWithPasswordAuthMode_basic
=== RUN   TestAccElastiCacheUserWithIamAuthMode_basic
=== PAUSE TestAccElastiCacheUserWithIamAuthMode_basic
=== RUN   TestAccElastiCacheUserWithNoPassRequiredAuthMode_basic
=== PAUSE TestAccElastiCacheUserWithNoPassRequiredAuthMode_basic
=== RUN   TestAccElastiCacheUser_update
=== PAUSE TestAccElastiCacheUser_update
=== RUN   TestAccElastiCacheUserWithPasswordAuthMode_update_password
=== PAUSE TestAccElastiCacheUserWithPasswordAuthMode_update_password
=== RUN   TestAccElastiCacheUser_tags
=== PAUSE TestAccElastiCacheUser_tags
=== RUN   TestAccElastiCacheUser_disappears
=== PAUSE TestAccElastiCacheUser_disappears
=== CONT  TestAccElastiCacheUserDataSource_basic
=== CONT  TestAccElastiCacheUser_basic
=== CONT  TestAccElastiCacheUserGroup_disappears
=== CONT  TestAccElastiCacheUserWithPasswordAuthMode_update_password
=== CONT  TestAccElastiCacheUserGroupAssociation_disappears
=== CONT  TestAccElastiCacheUserGroup_basic
=== CONT  TestAccElastiCacheUserWithIamAuthMode_basic
=== CONT  TestAccElastiCacheUserGroupAssociation_multiple
=== CONT  TestAccElastiCacheUserGroupAssociation_update
=== CONT  TestAccElastiCacheUserWithNoPassRequiredAuthMode_basic
=== CONT  TestAccElastiCacheUserGroup_tags
=== CONT  TestAccElastiCacheUserGroup_update
=== CONT  TestAccElastiCacheUserWithPasswordAuthMode_basic
=== CONT  TestAccElastiCacheUserGroupAssociation_basic
=== CONT  TestAccElastiCacheUser_update
=== CONT  TestAccElastiCacheUser_disappears
=== CONT  TestAccElastiCacheUser_tags
=== CONT  TestAccElastiCacheUserGroupAssociation_update
    user_group_association_test.go:58: Step 1/2 error: Error running apply: exit status 1
        
        Error: error creating ElastiCache User: InvalidParameter: 1 validation error(s) found.
        - minimum field size of 1, CreateUserInput.AuthenticationMode.Passwords.
        
        
          with aws_elasticache_user.test1,
          on terraform_plugin_test.tf line 11, in resource "aws_elasticache_user" "test1":
          11: resource "aws_elasticache_user" "test1" {
        
        
        Error: error creating ElastiCache User: InvalidParameter: 1 validation error(s) found.
        - minimum field size of 1, CreateUserInput.AuthenticationMode.Passwords.
        
        
          with aws_elasticache_user.test2,
          on terraform_plugin_test.tf line 19, in resource "aws_elasticache_user" "test2":
          19: resource "aws_elasticache_user" "test2" {
        
        
        Error: error creating ElastiCache User: InvalidParameter: 1 validation error(s) found.
        - minimum field size of 1, CreateUserInput.AuthenticationMode.Passwords.
        
        
          with aws_elasticache_user.test3,
          on terraform_plugin_test.tf line 37, in resource "aws_elasticache_user" "test3":
          37: resource "aws_elasticache_user" "test3" {
        
=== CONT  TestAccElastiCacheUser_basic
    user_test.go:24: Step 1/2 error: Error running apply: exit status 1
        
        Error: error creating ElastiCache User: InvalidParameter: 1 validation error(s) found.
        - minimum field size of 1, CreateUserInput.AuthenticationMode.Passwords.
        
        
          with aws_elasticache_user.test,
          on terraform_plugin_test.tf line 11, in resource "aws_elasticache_user" "test":
          11: resource "aws_elasticache_user" "test" {
        
=== CONT  TestAccElastiCacheUserGroupAssociation_multiple
    user_group_association_test.go:115: Step 1/2 error: Error running apply: exit status 1
        
        Error: error creating ElastiCache User: InvalidParameter: 1 validation error(s) found.
        - minimum field size of 1, CreateUserInput.AuthenticationMode.Passwords.
        
        
          with aws_elasticache_user.test1,
          on terraform_plugin_test.tf line 11, in resource "aws_elasticache_user" "test1":
          11: resource "aws_elasticache_user" "test1" {
        
        
        Error: error creating ElastiCache User: InvalidParameter: 1 validation error(s) found.
        - minimum field size of 1, CreateUserInput.AuthenticationMode.Passwords.
        
        
          with aws_elasticache_user.test2,
          on terraform_plugin_test.tf line 19, in resource "aws_elasticache_user" "test2":
          19: resource "aws_elasticache_user" "test2" {
        
        
        Error: error creating ElastiCache User: InvalidParameter: 1 validation error(s) found.
        - minimum field size of 1, CreateUserInput.AuthenticationMode.Passwords.
        
        
          with aws_elasticache_user.test3,
          on terraform_plugin_test.tf line 37, in resource "aws_elasticache_user" "test3":
          37: resource "aws_elasticache_user" "test3" {
        
=== CONT  TestAccElastiCacheUserWithNoPassRequiredAuthMode_basic
    user_test.go:121: Step 1/2 error: Error running apply: exit status 1
        
        Error: error creating ElastiCache User: InvalidParameter: 1 validation error(s) found.
        - minimum field size of 1, CreateUserInput.AuthenticationMode.Passwords.
        
        
          with aws_elasticache_user.test,
          on terraform_plugin_test.tf line 11, in resource "aws_elasticache_user" "test":
          11: resource "aws_elasticache_user" "test" {
        
=== CONT  TestAccElastiCacheUser_update
    user_test.go:151: Step 1/3 error: Error running apply: exit status 1
        
        Error: error creating ElastiCache User: InvalidParameter: 1 validation error(s) found.
        - minimum field size of 1, CreateUserInput.AuthenticationMode.Passwords.
        
        
          with aws_elasticache_user.test,
          on terraform_plugin_test.tf line 11, in resource "aws_elasticache_user" "test":
          11: resource "aws_elasticache_user" "test" {
        
=== CONT  TestAccElastiCacheUser_tags
    user_test.go:222: Step 1/3 error: Error running apply: exit status 1
        
        Error: error creating ElastiCache User: InvalidParameter: 1 validation error(s) found.
        - minimum field size of 1, CreateUserInput.AuthenticationMode.Passwords.
        
        
          with aws_elasticache_user.test,
          on terraform_plugin_test.tf line 11, in resource "aws_elasticache_user" "test":
          11: resource "aws_elasticache_user" "test" {
        
=== CONT  TestAccElastiCacheUserWithIamAuthMode_basic
    user_test.go:91: Step 1/2 error: Error running apply: exit status 1
        
        Error: error creating ElastiCache User: InvalidParameter: 1 validation error(s) found.
        - minimum field size of 1, CreateUserInput.AuthenticationMode.Passwords.
        
        
          with aws_elasticache_user.test,
          on terraform_plugin_test.tf line 11, in resource "aws_elasticache_user" "test":
          11: resource "aws_elasticache_user" "test" {
        
=== CONT  TestAccElastiCacheUserGroupAssociation_disappears
    user_group_association_test.go:88: Step 1/1 error: Error running apply: exit status 1
        
        Error: error creating ElastiCache User: InvalidParameter: 1 validation error(s) found.
        - minimum field size of 1, CreateUserInput.AuthenticationMode.Passwords.
        
        
          with aws_elasticache_user.test1,
          on terraform_plugin_test.tf line 11, in resource "aws_elasticache_user" "test1":
          11: resource "aws_elasticache_user" "test1" {
        
        
        Error: error creating ElastiCache User: InvalidParameter: 1 validation error(s) found.
        - minimum field size of 1, CreateUserInput.AuthenticationMode.Passwords.
        
        
          with aws_elasticache_user.test2,
          on terraform_plugin_test.tf line 19, in resource "aws_elasticache_user" "test2":
          19: resource "aws_elasticache_user" "test2" {
        
=== CONT  TestAccElastiCacheUser_disappears
    user_test.go:272: Step 1/1 error: Error running apply: exit status 1
        
        Error: error creating ElastiCache User: InvalidParameter: 1 validation error(s) found.
        - minimum field size of 1, CreateUserInput.AuthenticationMode.Passwords.
        
        
          with aws_elasticache_user.test,
          on terraform_plugin_test.tf line 11, in resource "aws_elasticache_user" "test":
          11: resource "aws_elasticache_user" "test" {
        
=== CONT  TestAccElastiCacheUserDataSource_basic
    user_data_source_test.go:18: Step 1/1 error: Error running apply: exit status 1
        
        Error: error creating ElastiCache User: InvalidParameter: 1 validation error(s) found.
        - minimum field size of 1, CreateUserInput.AuthenticationMode.Passwords.
        
        
          with aws_elasticache_user.test-basic,
          on terraform_plugin_test.tf line 2, in resource "aws_elasticache_user" "test-basic":
           2: resource "aws_elasticache_user" "test-basic" {
        
=== CONT  TestAccElastiCacheUserGroup_disappears
    user_group_test.go:134: Step 1/1 error: Error running apply: exit status 1
        
        Error: error creating ElastiCache User: InvalidParameter: 1 validation error(s) found.
        - minimum field size of 1, CreateUserInput.AuthenticationMode.Passwords.
        
        
          with aws_elasticache_user.test1,
          on terraform_plugin_test.tf line 11, in resource "aws_elasticache_user" "test1":
          11: resource "aws_elasticache_user" "test1" {
        
        
        Error: error creating ElastiCache User: InvalidParameter: 1 validation error(s) found.
        - minimum field size of 1, CreateUserInput.AuthenticationMode.Passwords.
        
        
          with aws_elasticache_user.test2,
          on terraform_plugin_test.tf line 19, in resource "aws_elasticache_user" "test2":
          19: resource "aws_elasticache_user" "test2" {
        
=== CONT  TestAccElastiCacheUserGroup_update
    user_group_test.go:52: Step 1/3 error: Error running apply: exit status 1
        
        Error: error creating ElastiCache User: InvalidParameter: 1 validation error(s) found.
        - minimum field size of 1, CreateUserInput.AuthenticationMode.Passwords.
        
        
          with aws_elasticache_user.test1,
          on terraform_plugin_test.tf line 11, in resource "aws_elasticache_user" "test1":
          11: resource "aws_elasticache_user" "test1" {
        
        
        Error: error creating ElastiCache User: InvalidParameter: 1 validation error(s) found.
        - minimum field size of 1, CreateUserInput.AuthenticationMode.Passwords.
        
        
          with aws_elasticache_user.test2,
          on terraform_plugin_test.tf line 19, in resource "aws_elasticache_user" "test2":
          19: resource "aws_elasticache_user" "test2" {
        
=== CONT  TestAccElastiCacheUserGroupAssociation_basic
    user_group_association_test.go:27: Step 1/2 error: Error running apply: exit status 1
        
        Error: error creating ElastiCache User: InvalidParameter: 1 validation error(s) found.
        - minimum field size of 1, CreateUserInput.AuthenticationMode.Passwords.
        
        
          with aws_elasticache_user.test1,
          on terraform_plugin_test.tf line 11, in resource "aws_elasticache_user" "test1":
          11: resource "aws_elasticache_user" "test1" {
        
        
        Error: error creating ElastiCache User: InvalidParameter: 1 validation error(s) found.
        - minimum field size of 1, CreateUserInput.AuthenticationMode.Passwords.
        
        
          with aws_elasticache_user.test2,
          on terraform_plugin_test.tf line 19, in resource "aws_elasticache_user" "test2":
          19: resource "aws_elasticache_user" "test2" {
        
=== CONT  TestAccElastiCacheUserGroup_tags
    user_group_test.go:94: Step 1/3 error: Error running apply: exit status 1
        
        Error: error creating ElastiCache User: InvalidParameter: 1 validation error(s) found.
        - minimum field size of 1, CreateUserInput.AuthenticationMode.Passwords.
        
        
          with aws_elasticache_user.test1,
          on terraform_plugin_test.tf line 11, in resource "aws_elasticache_user" "test1":
          11: resource "aws_elasticache_user" "test1" {
        
=== CONT  TestAccElastiCacheUserGroup_basic
    user_group_test.go:23: Step 1/2 error: Error running apply: exit status 1
        
        Error: error creating ElastiCache User: InvalidParameter: 1 validation error(s) found.
        - minimum field size of 1, CreateUserInput.AuthenticationMode.Passwords.
        
        
          with aws_elasticache_user.test1,
          on terraform_plugin_test.tf line 11, in resource "aws_elasticache_user" "test1":
          11: resource "aws_elasticache_user" "test1" {
        
        
        Error: error creating ElastiCache User: InvalidParameter: 1 validation error(s) found.
        - minimum field size of 1, CreateUserInput.AuthenticationMode.Passwords.
        
        
          with aws_elasticache_user.test2,
          on terraform_plugin_test.tf line 19, in resource "aws_elasticache_user" "test2":
          19: resource "aws_elasticache_user" "test2" {
        
--- FAIL: TestAccElastiCacheUserDataSource_basic (43.04s)
--- FAIL: TestAccElastiCacheUser_basic (47.06s)
--- FAIL: TestAccElastiCacheUserGroupAssociation_multiple (47.09s)
--- FAIL: TestAccElastiCacheUserGroupAssociation_disappears (47.18s)
--- FAIL: TestAccElastiCacheUser_update (47.20s)
--- FAIL: TestAccElastiCacheUserWithNoPassRequiredAuthMode_basic (47.33s)
--- FAIL: TestAccElastiCacheUserWithIamAuthMode_basic (47.38s)
--- FAIL: TestAccElastiCacheUser_disappears (47.40s)
--- FAIL: TestAccElastiCacheUserGroupAssociation_update (48.09s)
--- FAIL: TestAccElastiCacheUserGroup_disappears (48.18s)
--- FAIL: TestAccElastiCacheUserGroup_basic (48.39s)
--- FAIL: TestAccElastiCacheUserGroup_tags (48.42s)
--- FAIL: TestAccElastiCacheUser_tags (48.58s)
--- FAIL: TestAccElastiCacheUserGroupAssociation_basic (48.64s)
--- FAIL: TestAccElastiCacheUserGroup_update (48.66s)
=== CONT  TestAccElastiCacheUserWithPasswordAuthMode_basic
    user_test.go:58: ImportStateVerify attributes not equivalent. Difference is shown below. Top is actual, bottom is expected.
        
        (map[string]string) {
        }
        
        
        (map[string]string) (len=3) {
         (string) (len=33) "authentication_mode.0.passwords.#": (string) (len=1) "1",
         (string) (len=33) "authentication_mode.0.passwords.0": (string) (len=16) "aaaaaaaaaaaaaaaa",
         (string) (len=20) "no_password_required": (string) (len=5) "false"
        }
=== CONT  TestAccElastiCacheUserWithPasswordAuthMode_update_password
    user_test.go:188: Step 2/3 error: Check failed: Check 2/2 error: aws_elasticache_user.test: Attribute 'authentication_mode.0.password_count' expected "2", got "1"
--- FAIL: TestAccElastiCacheUserWithPasswordAuthMode_basic (73.87s)
--- FAIL: TestAccElastiCacheUserWithPasswordAuthMode_update_password (77.48s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/elasticache	82.505s
FAIL
make: *** [testacc] Error 1

@cscacun
Copy link
Author

cscacun commented Feb 24, 2023

@schuylr could you please help me run the tests again ?

@schuylr
Copy link
Contributor

schuylr commented Feb 24, 2023

Results:

terraform-provider-aws % make testacc TESTS=TestAccElastiCacheUser PKG=elasticache
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/elasticache/... -v -count 1 -parallel 20 -run='TestAccElastiCacheUser'  -timeout 180m
=== RUN   TestAccElastiCacheUserDataSource_basic
=== PAUSE TestAccElastiCacheUserDataSource_basic
=== RUN   TestAccElastiCacheUserGroupAssociation_basic
=== PAUSE TestAccElastiCacheUserGroupAssociation_basic
=== RUN   TestAccElastiCacheUserGroupAssociation_update
=== PAUSE TestAccElastiCacheUserGroupAssociation_update
=== RUN   TestAccElastiCacheUserGroupAssociation_disappears
=== PAUSE TestAccElastiCacheUserGroupAssociation_disappears
=== RUN   TestAccElastiCacheUserGroupAssociation_multiple
=== PAUSE TestAccElastiCacheUserGroupAssociation_multiple
=== RUN   TestAccElastiCacheUserGroup_basic
=== PAUSE TestAccElastiCacheUserGroup_basic
=== RUN   TestAccElastiCacheUserGroup_update
=== PAUSE TestAccElastiCacheUserGroup_update
=== RUN   TestAccElastiCacheUserGroup_tags
=== PAUSE TestAccElastiCacheUserGroup_tags
=== RUN   TestAccElastiCacheUserGroup_disappears
=== PAUSE TestAccElastiCacheUserGroup_disappears
=== RUN   TestAccElastiCacheUser_basic
=== PAUSE TestAccElastiCacheUser_basic
=== RUN   TestAccElastiCacheUserWithPasswordAuthMode_basic
=== PAUSE TestAccElastiCacheUserWithPasswordAuthMode_basic
=== RUN   TestAccElastiCacheUserWithIamAuthMode_basic
=== PAUSE TestAccElastiCacheUserWithIamAuthMode_basic
=== RUN   TestAccElastiCacheUserWithNoPassRequiredAuthMode_basic
=== PAUSE TestAccElastiCacheUserWithNoPassRequiredAuthMode_basic
=== RUN   TestAccElastiCacheUser_update
=== PAUSE TestAccElastiCacheUser_update
=== RUN   TestAccElastiCacheUserWithPasswordAuthMode_update_password
=== PAUSE TestAccElastiCacheUserWithPasswordAuthMode_update_password
=== RUN   TestAccElastiCacheUser_tags
=== PAUSE TestAccElastiCacheUser_tags
=== RUN   TestAccElastiCacheUser_disappears
=== PAUSE TestAccElastiCacheUser_disappears
=== CONT  TestAccElastiCacheUserDataSource_basic
=== CONT  TestAccElastiCacheUser_basic
=== CONT  TestAccElastiCacheUserGroup_update
=== CONT  TestAccElastiCacheUserGroupAssociation_multiple
=== CONT  TestAccElastiCacheUserGroupAssociation_update
=== CONT  TestAccElastiCacheUser_disappears
=== CONT  TestAccElastiCacheUserGroup_basic
=== CONT  TestAccElastiCacheUserGroupAssociation_basic
=== CONT  TestAccElastiCacheUserGroup_disappears
=== CONT  TestAccElastiCacheUserGroup_tags
=== CONT  TestAccElastiCacheUserGroupAssociation_disappears
=== CONT  TestAccElastiCacheUserWithIamAuthMode_basic
=== CONT  TestAccElastiCacheUser_update
=== CONT  TestAccElastiCacheUserWithNoPassRequiredAuthMode_basic
=== CONT  TestAccElastiCacheUser_tags
=== CONT  TestAccElastiCacheUserWithPasswordAuthMode_update_password
=== CONT  TestAccElastiCacheUserWithPasswordAuthMode_basic
=== CONT  TestAccElastiCacheUserWithIamAuthMode_basic
    user_test.go:91: Step 1/2 error: Error running apply: exit status 1
        
        Error: error creating ElastiCache User: InvalidParameterCombination: User Id and User name must be same for authentication type: iam
        	status code: 400, request id: f31592ae-13d7-416e-abb3-ed22acf31dec
        
          with aws_elasticache_user.test,
          on terraform_plugin_test.tf line 11, in resource "aws_elasticache_user" "test":
          11: resource "aws_elasticache_user" "test" {
        
=== CONT  TestAccElastiCacheUserWithNoPassRequiredAuthMode_basic
    user_test.go:121: Step 1/2 error: Check failed: Check 5/5 error: aws_elasticache_user.test: Attribute 'authentication_mode.0.type' expected "no-password-required", got "no-password"
--- FAIL: TestAccElastiCacheUserWithIamAuthMode_basic (47.05s)
=== CONT  TestAccElastiCacheUserDataSource_basic
    user_data_source_test.go:18: Step 1/1 error: After applying this test step, the plan was not empty.
        stdout:
        
        
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
         <= read (data resources)
        
        Terraform will perform the following actions:
        
          # data.aws_elasticache_user.test-basic will be read during apply
          # (depends on a resource or a module with changes pending)
         <= data "aws_elasticache_user" "test-basic" {
              + id      = (known after apply)
              + user_id = "tf-acc-4019194489353117834"
            }
        
          # aws_elasticache_user.test-basic will be updated in-place
          ~ resource "aws_elasticache_user" "test-basic" {
                id                   = "tf-acc-4019194489353117834"
                # (7 unchanged attributes hidden)
        
              - authentication_mode {
                  - password_count = 0 -> null
                  - passwords      = (sensitive value)
                  - type           = "no-password" -> null
                }
            }
        
        Plan: 0 to add, 1 to change, 0 to destroy.
=== CONT  TestAccElastiCacheUser_tags
    user_test.go:222: Step 1/3 error: After applying this test step, the plan was not empty.
        stdout:
        
        
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
        
        Terraform will perform the following actions:
        
          # aws_elasticache_user.test will be updated in-place
          ~ resource "aws_elasticache_user" "test" {
                id                   = "tf-acc-7130453744281447980"
                tags                 = {
                    "tagKey" = "tagVal"
                }
                # (8 unchanged attributes hidden)
        
              - authentication_mode {
                  - password_count = 1 -> null
                  - passwords      = (sensitive value)
                  - type           = "password" -> null
                }
            }
        
        Plan: 0 to add, 1 to change, 0 to destroy.
=== CONT  TestAccElastiCacheUser_basic
    user_test.go:24: Step 1/2 error: After applying this test step, the plan was not empty.
        stdout:
        
        
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
        
        Terraform will perform the following actions:
        
          # aws_elasticache_user.test will be updated in-place
          ~ resource "aws_elasticache_user" "test" {
                id                   = "tf-acc-8440206682658094108"
                # (8 unchanged attributes hidden)
        
              - authentication_mode {
                  - password_count = 1 -> null
                  - passwords      = (sensitive value)
                  - type           = "password" -> null
                }
            }
        
        Plan: 0 to add, 1 to change, 0 to destroy.
=== CONT  TestAccElastiCacheUser_update
    user_test.go:151: Step 1/3 error: After applying this test step, the plan was not empty.
        stdout:
        
        
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
        
        Terraform will perform the following actions:
        
          # aws_elasticache_user.test will be updated in-place
          ~ resource "aws_elasticache_user" "test" {
                id                   = "tf-acc-7190168916250949195"
                # (8 unchanged attributes hidden)
        
              - authentication_mode {
                  - password_count = 1 -> null
                  - passwords      = (sensitive value)
                  - type           = "password" -> null
                }
            }
        
        Plan: 0 to add, 1 to change, 0 to destroy.
=== CONT  TestAccElastiCacheUserWithPasswordAuthMode_basic
    user_test.go:58: ImportStateVerify attributes not equivalent. Difference is shown below. Top is actual, bottom is expected.
        
        (map[string]string) {
        }
        
        
        (map[string]string) (len=3) {
         (string) (len=33) "authentication_mode.0.passwords.#": (string) (len=1) "1",
         (string) (len=33) "authentication_mode.0.passwords.0": (string) (len=16) "aaaaaaaaaaaaaaaa",
         (string) (len=20) "no_password_required": (string) (len=5) "false"
        }
--- FAIL: TestAccElastiCacheUserDataSource_basic (72.40s)
=== CONT  TestAccElastiCacheUserWithPasswordAuthMode_update_password
    user_test.go:188: Step 2/3 error: Check failed: Check 2/2 error: aws_elasticache_user.test: Attribute 'authentication_mode.0.password_count' expected "2", got "1"
--- FAIL: TestAccElastiCacheUser_tags (72.53s)
--- FAIL: TestAccElastiCacheUser_update (73.53s)
--- FAIL: TestAccElastiCacheUser_basic (73.82s)
--- FAIL: TestAccElastiCacheUserWithNoPassRequiredAuthMode_basic (76.08s)
=== CONT  TestAccElastiCacheUserGroup_update
    user_group_test.go:52: Step 1/3 error: After applying this test step, the plan was not empty.
        stdout:
        
        
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
        
        Terraform will perform the following actions:
        
          # aws_elasticache_user.test1 will be updated in-place
          ~ resource "aws_elasticache_user" "test1" {
                id                   = "tf-acc-8247372796298161995-1"
                # (8 unchanged attributes hidden)
        
              - authentication_mode {
                  - password_count = 1 -> null
                  - passwords      = (sensitive value)
                  - type           = "password" -> null
                }
            }
        
          # aws_elasticache_user.test2 will be updated in-place
          ~ resource "aws_elasticache_user" "test2" {
                id                   = "tf-acc-8247372796298161995-2"
                # (8 unchanged attributes hidden)
        
              - authentication_mode {
                  - password_count = 1 -> null
                  - passwords      = (sensitive value)
                  - type           = "password" -> null
                }
            }
        
        Plan: 0 to add, 2 to change, 0 to destroy.
=== CONT  TestAccElastiCacheUserGroupAssociation_multiple
    user_group_association_test.go:115: Step 1/2 error: After applying this test step, the plan was not empty.
        stdout:
        
        
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
        
        Terraform will perform the following actions:
        
          # aws_elasticache_user.test1 will be updated in-place
          ~ resource "aws_elasticache_user" "test1" {
                id                   = "tf-acc-test-5406177347177353091-1"
                # (8 unchanged attributes hidden)
        
              - authentication_mode {
                  - password_count = 1 -> null
                  - passwords      = (sensitive value)
                  - type           = "password" -> null
                }
            }
        
          # aws_elasticache_user.test2 will be updated in-place
          ~ resource "aws_elasticache_user" "test2" {
                id                   = "tf-acc-test-5406177347177353091-2"
                # (8 unchanged attributes hidden)
        
              - authentication_mode {
                  - password_count = 1 -> null
                  - passwords      = (sensitive value)
                  - type           = "password" -> null
                }
            }
        
          # aws_elasticache_user.test3 will be updated in-place
          ~ resource "aws_elasticache_user" "test3" {
                id                   = "tf-acc-test-5406177347177353091-3"
                # (8 unchanged attributes hidden)
        
              - authentication_mode {
                  - password_count = 1 -> null
                  - passwords      = (sensitive value)
                  - type           = "password" -> null
                }
            }
        
        Plan: 0 to add, 3 to change, 0 to destroy.
=== CONT  TestAccElastiCacheUserGroup_basic
    user_group_test.go:23: Step 1/2 error: After applying this test step, the plan was not empty.
        stdout:
        
        
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
        
        Terraform will perform the following actions:
        
          # aws_elasticache_user.test1 will be updated in-place
          ~ resource "aws_elasticache_user" "test1" {
                id                   = "tf-acc-8984626651420378179-1"
                # (8 unchanged attributes hidden)
        
              - authentication_mode {
                  - password_count = 1 -> null
                  - passwords      = (sensitive value)
                  - type           = "password" -> null
                }
            }
        
          # aws_elasticache_user.test2 will be updated in-place
          ~ resource "aws_elasticache_user" "test2" {
                id                   = "tf-acc-8984626651420378179-2"
                # (8 unchanged attributes hidden)
        
              - authentication_mode {
                  - password_count = 1 -> null
                  - passwords      = (sensitive value)
                  - type           = "password" -> null
                }
            }
        
        Plan: 0 to add, 2 to change, 0 to destroy.
=== CONT  TestAccElastiCacheUserGroup_tags
    user_group_test.go:94: Step 1/3 error: After applying this test step, the plan was not empty.
        stdout:
        
        
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
        
        Terraform will perform the following actions:
        
          # aws_elasticache_user.test1 will be updated in-place
          ~ resource "aws_elasticache_user" "test1" {
                id                   = "tf-acc-6980505086453935583-1"
                # (8 unchanged attributes hidden)
        
              - authentication_mode {
                  - password_count = 1 -> null
                  - passwords      = (sensitive value)
                  - type           = "password" -> null
                }
            }
        
        Plan: 0 to add, 1 to change, 0 to destroy.
--- PASS: TestAccElastiCacheUser_disappears (91.95s)
--- FAIL: TestAccElastiCacheUserWithPasswordAuthMode_update_password (133.32s)
--- FAIL: TestAccElastiCacheUserWithPasswordAuthMode_basic (137.35s)
=== CONT  TestAccElastiCacheUserGroupAssociation_update
    user_group_association_test.go:58: Step 1/2 error: After applying this test step, the plan was not empty.
        stdout:
        
        
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
        
        Terraform will perform the following actions:
        
          # aws_elasticache_user.test1 will be updated in-place
          ~ resource "aws_elasticache_user" "test1" {
                id                   = "tf-acc-test-7517899297670654581-1"
                # (8 unchanged attributes hidden)
        
              - authentication_mode {
                  - password_count = 1 -> null
                  - passwords      = (sensitive value)
                  - type           = "password" -> null
                }
            }
        
          # aws_elasticache_user.test2 will be updated in-place
          ~ resource "aws_elasticache_user" "test2" {
                id                   = "tf-acc-test-7517899297670654581-2"
                # (8 unchanged attributes hidden)
        
              - authentication_mode {
                  - password_count = 1 -> null
                  - passwords      = (sensitive value)
                  - type           = "password" -> null
                }
            }
        
          # aws_elasticache_user.test3 will be updated in-place
          ~ resource "aws_elasticache_user" "test3" {
                id                   = "tf-acc-test-7517899297670654581-3"
                # (8 unchanged attributes hidden)
        
              - authentication_mode {
                  - password_count = 1 -> null
                  - passwords      = (sensitive value)
                  - type           = "password" -> null
                }
            }
        
        Plan: 0 to add, 3 to change, 0 to destroy.
=== CONT  TestAccElastiCacheUserGroupAssociation_basic
    user_group_association_test.go:27: Step 1/2 error: After applying this test step, the plan was not empty.
        stdout:
        
        
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
        
        Terraform will perform the following actions:
        
          # aws_elasticache_user.test1 will be updated in-place
          ~ resource "aws_elasticache_user" "test1" {
                id                   = "tf-acc-test-3457147191782998940-1"
                # (8 unchanged attributes hidden)
        
              - authentication_mode {
                  - password_count = 1 -> null
                  - passwords      = (sensitive value)
                  - type           = "password" -> null
                }
            }
        
          # aws_elasticache_user.test2 will be updated in-place
          ~ resource "aws_elasticache_user" "test2" {
                id                   = "tf-acc-test-3457147191782998940-2"
                # (8 unchanged attributes hidden)
        
              - authentication_mode {
                  - password_count = 1 -> null
                  - passwords      = (sensitive value)
                  - type           = "password" -> null
                }
            }
        
        Plan: 0 to add, 2 to change, 0 to destroy.
--- FAIL: TestAccElastiCacheUserGroupAssociation_multiple (194.57s)
--- PASS: TestAccElastiCacheUserGroup_disappears (194.59s)
--- FAIL: TestAccElastiCacheUserGroup_tags (194.60s)
--- FAIL: TestAccElastiCacheUserGroup_basic (194.70s)
--- FAIL: TestAccElastiCacheUserGroup_update (194.81s)
--- FAIL: TestAccElastiCacheUserGroupAssociation_update (315.78s)
--- FAIL: TestAccElastiCacheUserGroupAssociation_basic (316.16s)
--- PASS: TestAccElastiCacheUserGroupAssociation_disappears (320.49s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/elasticache	326.275s
FAIL
make: *** [testacc] Error 1

@github-actions github-actions bot added size/XL Managed by automation to categorize the size of a PR. and removed size/L Managed by automation to categorize the size of a PR. labels Feb 27, 2023
@cscacun
Copy link
Author

cscacun commented Feb 27, 2023

@schuylr im really sorry to reach out! i think i fixed everything. would it be possible for you to help me with the tests again ?

@schuylr
Copy link
Contributor

schuylr commented Feb 27, 2023

terraform-provider-aws % make testacc TESTS=TestAccElastiCacheUser PKG=elasticache
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/elasticache/... -v -count 1 -parallel 20 -run='TestAccElastiCacheUser'  -timeout 180m
=== RUN   TestAccElastiCacheUserDataSource_basic
=== PAUSE TestAccElastiCacheUserDataSource_basic
=== RUN   TestAccElastiCacheUserGroupAssociation_basic
=== PAUSE TestAccElastiCacheUserGroupAssociation_basic
=== RUN   TestAccElastiCacheUserGroupAssociation_update
=== PAUSE TestAccElastiCacheUserGroupAssociation_update
=== RUN   TestAccElastiCacheUserGroupAssociation_disappears
=== PAUSE TestAccElastiCacheUserGroupAssociation_disappears
=== RUN   TestAccElastiCacheUserGroupAssociation_multiple
=== PAUSE TestAccElastiCacheUserGroupAssociation_multiple
=== RUN   TestAccElastiCacheUserGroup_basic
=== PAUSE TestAccElastiCacheUserGroup_basic
=== RUN   TestAccElastiCacheUserGroup_update
=== PAUSE TestAccElastiCacheUserGroup_update
=== RUN   TestAccElastiCacheUserGroup_tags
=== PAUSE TestAccElastiCacheUserGroup_tags
=== RUN   TestAccElastiCacheUserGroup_disappears
=== PAUSE TestAccElastiCacheUserGroup_disappears
=== RUN   TestAccElastiCacheUser_basic
=== PAUSE TestAccElastiCacheUser_basic
=== RUN   TestAccElastiCacheUserWithPasswordAuthMode_basic
=== PAUSE TestAccElastiCacheUserWithPasswordAuthMode_basic
=== RUN   TestAccElastiCacheUserWithIamAuthMode_basic
=== PAUSE TestAccElastiCacheUserWithIamAuthMode_basic
=== RUN   TestAccElastiCacheUserWithNoPassRequiredAuthMode_basic
=== PAUSE TestAccElastiCacheUserWithNoPassRequiredAuthMode_basic
=== RUN   TestAccElastiCacheUser_update
=== PAUSE TestAccElastiCacheUser_update
=== RUN   TestAccElastiCacheUserWithPasswordAuthMode_update_password
=== PAUSE TestAccElastiCacheUserWithPasswordAuthMode_update_password
=== RUN   TestAccElastiCacheUser_tags
=== PAUSE TestAccElastiCacheUser_tags
=== RUN   TestAccElastiCacheUser_disappears
=== PAUSE TestAccElastiCacheUser_disappears
=== CONT  TestAccElastiCacheUserDataSource_basic
=== CONT  TestAccElastiCacheUser_basic
=== CONT  TestAccElastiCacheUserWithNoPassRequiredAuthMode_basic
=== CONT  TestAccElastiCacheUserWithIamAuthMode_basic
=== CONT  TestAccElastiCacheUserGroupAssociation_multiple
=== CONT  TestAccElastiCacheUserGroup_basic
=== CONT  TestAccElastiCacheUserGroupAssociation_update
=== CONT  TestAccElastiCacheUserGroupAssociation_basic
=== CONT  TestAccElastiCacheUserGroup_tags
=== CONT  TestAccElastiCacheUserGroup_update
=== CONT  TestAccElastiCacheUserWithPasswordAuthMode_basic
=== CONT  TestAccElastiCacheUser_disappears
=== CONT  TestAccElastiCacheUser_update
=== CONT  TestAccElastiCacheUserGroup_disappears
=== CONT  TestAccElastiCacheUser_tags
=== CONT  TestAccElastiCacheUserGroupAssociation_disappears
=== CONT  TestAccElastiCacheUserWithPasswordAuthMode_update_password
=== CONT  TestAccElastiCacheUserDataSource_basic
    user_data_source_test.go:18: Step 1/2 error: After applying this test step, the plan was not empty.
        stdout:
        
        
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
         <= read (data resources)
        
        Terraform will perform the following actions:
        
          # data.aws_elasticache_user.test-basic will be read during apply
          # (depends on a resource or a module with changes pending)
         <= data "aws_elasticache_user" "test-basic" {
              + id      = (known after apply)
              + user_id = "tf-acc-7882164403748996585"
            }
        
          # aws_elasticache_user.test-basic will be updated in-place
          ~ resource "aws_elasticache_user" "test-basic" {
                id                   = "tf-acc-7882164403748996585"
                # (7 unchanged attributes hidden)
        
              - authentication_mode {
                  - password_count = 0 -> null
                  - passwords      = (sensitive value)
                  - type           = "no-password" -> null
                }
            }
        
        Plan: 0 to add, 1 to change, 0 to destroy.
=== CONT  TestAccElastiCacheUser_tags
    user_test.go:255: Step 1/6 error: After applying this test step, the plan was not empty.
        stdout:
        
        
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
        
        Terraform will perform the following actions:
        
          # aws_elasticache_user.test will be updated in-place
          ~ resource "aws_elasticache_user" "test" {
                id                   = "tf-acc-2949069066219892877"
                tags                 = {
                    "tagKey" = "tagVal"
                }
                # (8 unchanged attributes hidden)
        
              - authentication_mode {
                  - password_count = 1 -> null
                  - passwords      = (sensitive value)
                  - type           = "password" -> null
                }
            }
        
        Plan: 0 to add, 1 to change, 0 to destroy.
=== CONT  TestAccElastiCacheUser_update
    user_test.go:157: Step 1/4 error: After applying this test step, the plan was not empty.
        stdout:
        
        
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
        
        Terraform will perform the following actions:
        
          # aws_elasticache_user.test will be updated in-place
          ~ resource "aws_elasticache_user" "test" {
                id                   = "tf-acc-4596560341762689630"
                # (8 unchanged attributes hidden)
        
              - authentication_mode {
                  - password_count = 1 -> null
                  - passwords      = (sensitive value)
                  - type           = "password" -> null
                }
            }
        
        Plan: 0 to add, 1 to change, 0 to destroy.
=== CONT  TestAccElastiCacheUser_basic
    user_test.go:24: Step 1/2 error: After applying this test step, the plan was not empty.
        stdout:
        
        
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
        
        Terraform will perform the following actions:
        
          # aws_elasticache_user.test will be updated in-place
          ~ resource "aws_elasticache_user" "test" {
                id                   = "tf-acc-579934283086050056"
                # (8 unchanged attributes hidden)
        
              - authentication_mode {
                  - password_count = 1 -> null
                  - passwords      = (sensitive value)
                  - type           = "password" -> null
                }
            }
        
        Plan: 0 to add, 1 to change, 0 to destroy.
=== CONT  TestAccElastiCacheUserWithNoPassRequiredAuthMode_basic
    user_test.go:127: Step 1/2 error: After applying this test step, the plan was not empty.
        stdout:
        
        
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
        
        Terraform will perform the following actions:
        
          # aws_elasticache_user.test will be updated in-place
          ~ resource "aws_elasticache_user" "test" {
                id                   = "tf-acc-4454897746119529917"
                # (7 unchanged attributes hidden)
        
              ~ authentication_mode {
                  + passwords      = (sensitive value)
                  ~ type           = "no-password" -> "no-password-required"
                    # (1 unchanged attribute hidden)
                }
            }
        
        Plan: 0 to add, 1 to change, 0 to destroy.
=== CONT  TestAccElastiCacheUserWithPasswordAuthMode_update_password
    user_test.go:201: ImportStateVerify attributes not equivalent. Difference is shown below. Top is actual, bottom is expected.
        
        (map[string]string) {
        }
        
        
        (map[string]string) (len=1) {
         (string) (len=20) "no_password_required": (string) (len=5) "false"
        }
=== CONT  TestAccElastiCacheUserWithIamAuthMode_basic
    user_test.go:97: ImportStateVerify attributes not equivalent. Difference is shown below. Top is actual, bottom is expected.
        
        (map[string]string) {
        }
        
        
        (map[string]string) (len=1) {
         (string) (len=20) "no_password_required": (string) (len=5) "false"
        }
--- PASS: TestAccElastiCacheUser_disappears (67.25s)
=== CONT  TestAccElastiCacheUserGroup_update
    user_group_test.go:53: Step 1/6 error: After applying this test step, the plan was not empty.
        stdout:
        
        
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
        
        Terraform will perform the following actions:
        
          # aws_elasticache_user.test1 will be updated in-place
          ~ resource "aws_elasticache_user" "test1" {
                id                   = "tf-acc-2470655087214300570-1"
                # (8 unchanged attributes hidden)
        
              - authentication_mode {
                  - password_count = 1 -> null
                  - passwords      = (sensitive value)
                  - type           = "password" -> null
                }
            }
        
          # aws_elasticache_user.test2 will be updated in-place
          ~ resource "aws_elasticache_user" "test2" {
                id                   = "tf-acc-2470655087214300570-2"
                # (8 unchanged attributes hidden)
        
              - authentication_mode {
                  - password_count = 1 -> null
                  - passwords      = (sensitive value)
                  - type           = "password" -> null
                }
            }
        
        Plan: 0 to add, 2 to change, 0 to destroy.
=== CONT  TestAccElastiCacheUserGroup_basic
    user_group_test.go:23: Step 1/2 error: After applying this test step, the plan was not empty.
        stdout:
        
        
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
        
        Terraform will perform the following actions:
        
          # aws_elasticache_user.test1 will be updated in-place
          ~ resource "aws_elasticache_user" "test1" {
                id                   = "tf-acc-3542185899815514954-1"
                # (8 unchanged attributes hidden)
        
              - authentication_mode {
                  - password_count = 1 -> null
                  - passwords      = (sensitive value)
                  - type           = "password" -> null
                }
            }
        
          # aws_elasticache_user.test2 will be updated in-place
          ~ resource "aws_elasticache_user" "test2" {
                id                   = "tf-acc-3542185899815514954-2"
                # (8 unchanged attributes hidden)
        
              - authentication_mode {
                  - password_count = 1 -> null
                  - passwords      = (sensitive value)
                  - type           = "password" -> null
                }
            }
        
        Plan: 0 to add, 2 to change, 0 to destroy.
=== CONT  TestAccElastiCacheUserGroup_tags
    user_group_test.go:113: Step 1/6 error: After applying this test step, the plan was not empty.
        stdout:
        
        
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
        
        Terraform will perform the following actions:
        
          # aws_elasticache_user.test1 will be updated in-place
          ~ resource "aws_elasticache_user" "test1" {
                id                   = "tf-acc-9067679796564585317-1"
                # (8 unchanged attributes hidden)
        
              - authentication_mode {
                  - password_count = 1 -> null
                  - passwords      = (sensitive value)
                  - type           = "password" -> null
                }
            }
        
        Plan: 0 to add, 1 to change, 0 to destroy.
=== CONT  TestAccElastiCacheUserGroupAssociation_multiple
    user_group_association_test.go:128: Step 1/4 error: After applying this test step, the plan was not empty.
        stdout:
        
        
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
        
        Terraform will perform the following actions:
        
          # aws_elasticache_user.test1 will be updated in-place
          ~ resource "aws_elasticache_user" "test1" {
                id                   = "tf-acc-test-3248218627802771644-1"
                # (8 unchanged attributes hidden)
        
              - authentication_mode {
                  - password_count = 1 -> null
                  - passwords      = (sensitive value)
                  - type           = "password" -> null
                }
            }
        
          # aws_elasticache_user.test2 will be updated in-place
          ~ resource "aws_elasticache_user" "test2" {
                id                   = "tf-acc-test-3248218627802771644-2"
                # (8 unchanged attributes hidden)
        
              - authentication_mode {
                  - password_count = 1 -> null
                  - passwords      = (sensitive value)
                  - type           = "password" -> null
                }
            }
        
          # aws_elasticache_user.test3 will be updated in-place
          ~ resource "aws_elasticache_user" "test3" {
                id                   = "tf-acc-test-3248218627802771644-3"
                # (8 unchanged attributes hidden)
        
              - authentication_mode {
                  - password_count = 1 -> null
                  - passwords      = (sensitive value)
                  - type           = "password" -> null
                }
            }
        
        Plan: 0 to add, 3 to change, 0 to destroy.
--- FAIL: TestAccElastiCacheUserDataSource_basic (117.67s)
--- FAIL: TestAccElastiCacheUser_tags (118.74s)
--- PASS: TestAccElastiCacheUserWithPasswordAuthMode_basic (118.94s)
--- FAIL: TestAccElastiCacheUserWithPasswordAuthMode_update_password (119.15s)
--- FAIL: TestAccElastiCacheUserWithNoPassRequiredAuthMode_basic (119.21s)
--- FAIL: TestAccElastiCacheUser_update (119.24s)
--- FAIL: TestAccElastiCacheUser_basic (119.33s)
--- FAIL: TestAccElastiCacheUserWithIamAuthMode_basic (119.64s)
=== CONT  TestAccElastiCacheUserGroupAssociation_update
    user_group_association_test.go:59: Step 1/4 error: After applying this test step, the plan was not empty.
        stdout:
        
        
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
        
        Terraform will perform the following actions:
        
          # aws_elasticache_user.test1 will be updated in-place
          ~ resource "aws_elasticache_user" "test1" {
                id                   = "tf-acc-test-3556453299815092320-1"
                # (8 unchanged attributes hidden)
        
              - authentication_mode {
                  - password_count = 1 -> null
                  - passwords      = (sensitive value)
                  - type           = "password" -> null
                }
            }
        
          # aws_elasticache_user.test2 will be updated in-place
          ~ resource "aws_elasticache_user" "test2" {
                id                   = "tf-acc-test-3556453299815092320-2"
                # (8 unchanged attributes hidden)
        
              - authentication_mode {
                  - password_count = 1 -> null
                  - passwords      = (sensitive value)
                  - type           = "password" -> null
                }
            }
        
          # aws_elasticache_user.test3 will be updated in-place
          ~ resource "aws_elasticache_user" "test3" {
                id                   = "tf-acc-test-3556453299815092320-3"
                # (8 unchanged attributes hidden)
        
              - authentication_mode {
                  - password_count = 1 -> null
                  - passwords      = (sensitive value)
                  - type           = "password" -> null
                }
            }
        
        Plan: 0 to add, 3 to change, 0 to destroy.
=== CONT  TestAccElastiCacheUserGroupAssociation_basic
    user_group_association_test.go:27: Step 1/2 error: After applying this test step, the plan was not empty.
        stdout:
        
        
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
        
        Terraform will perform the following actions:
        
          # aws_elasticache_user.test1 will be updated in-place
          ~ resource "aws_elasticache_user" "test1" {
                id                   = "tf-acc-test-8431151931222320714-1"
                # (8 unchanged attributes hidden)
        
              - authentication_mode {
                  - password_count = 1 -> null
                  - passwords      = (sensitive value)
                  - type           = "password" -> null
                }
            }
        
          # aws_elasticache_user.test2 will be updated in-place
          ~ resource "aws_elasticache_user" "test2" {
                id                   = "tf-acc-test-8431151931222320714-2"
                # (8 unchanged attributes hidden)
        
              - authentication_mode {
                  - password_count = 1 -> null
                  - passwords      = (sensitive value)
                  - type           = "password" -> null
                }
            }
        
        Plan: 0 to add, 2 to change, 0 to destroy.
--- PASS: TestAccElastiCacheUserGroup_disappears (172.70s)
--- FAIL: TestAccElastiCacheUserGroup_basic (179.71s)
--- FAIL: TestAccElastiCacheUserGroup_update (179.77s)
--- FAIL: TestAccElastiCacheUserGroupAssociation_multiple (179.78s)
--- FAIL: TestAccElastiCacheUserGroup_tags (180.09s)
--- FAIL: TestAccElastiCacheUserGroupAssociation_basic (294.54s)
--- FAIL: TestAccElastiCacheUserGroupAssociation_update (294.57s)
--- PASS: TestAccElastiCacheUserGroupAssociation_disappears (296.47s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/elasticache	301.613s
FAIL
make: *** [testacc] Error 1

@cscacun
Copy link
Author

cscacun commented Mar 1, 2023

@schuylr thanks a lot for your help! i was able to fix everything and run the tests myself this time

@cscacun cscacun requested a review from schuylr March 1, 2023 17:19
@schuylr
Copy link
Contributor

schuylr commented Mar 1, 2023

Nice work! Will give a review shortly.

terraform-provider-aws % make testacc TESTS=TestAccElastiCacheUser PKG=elasticache
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/elasticache/... -v -count 1 -parallel 20 -run='TestAccElastiCacheUser'  -timeout 180m
=== RUN   TestAccElastiCacheUserDataSource_basic
=== PAUSE TestAccElastiCacheUserDataSource_basic
=== RUN   TestAccElastiCacheUserGroupAssociation_basic
=== PAUSE TestAccElastiCacheUserGroupAssociation_basic
=== RUN   TestAccElastiCacheUserGroupAssociation_update
=== PAUSE TestAccElastiCacheUserGroupAssociation_update
=== RUN   TestAccElastiCacheUserGroupAssociation_disappears
=== PAUSE TestAccElastiCacheUserGroupAssociation_disappears
=== RUN   TestAccElastiCacheUserGroupAssociation_multiple
=== PAUSE TestAccElastiCacheUserGroupAssociation_multiple
=== RUN   TestAccElastiCacheUserGroup_basic
=== PAUSE TestAccElastiCacheUserGroup_basic
=== RUN   TestAccElastiCacheUserGroup_update
=== PAUSE TestAccElastiCacheUserGroup_update
=== RUN   TestAccElastiCacheUserGroup_tags
=== PAUSE TestAccElastiCacheUserGroup_tags
=== RUN   TestAccElastiCacheUserGroup_disappears
=== PAUSE TestAccElastiCacheUserGroup_disappears
=== RUN   TestAccElastiCacheUser_basic
=== PAUSE TestAccElastiCacheUser_basic
=== RUN   TestAccElastiCacheUser_password_auth_mode
=== PAUSE TestAccElastiCacheUser_password_auth_mode
=== RUN   TestAccElastiCacheUser_iam_auth_mode
=== PAUSE TestAccElastiCacheUser_iam_auth_mode
=== RUN   TestAccElastiCacheUser_update
=== PAUSE TestAccElastiCacheUser_update
=== RUN   TestAccElastiCacheUser_update_password_auth_mode
=== PAUSE TestAccElastiCacheUser_update_password_auth_mode
=== RUN   TestAccElastiCacheUser_tags
=== PAUSE TestAccElastiCacheUser_tags
=== RUN   TestAccElastiCacheUser_disappears
=== PAUSE TestAccElastiCacheUser_disappears
=== CONT  TestAccElastiCacheUserDataSource_basic
=== CONT  TestAccElastiCacheUserGroup_disappears
=== CONT  TestAccElastiCacheUser_update_password_auth_mode
=== CONT  TestAccElastiCacheUser_basic
=== CONT  TestAccElastiCacheUserGroupAssociation_update
=== CONT  TestAccElastiCacheUserGroupAssociation_disappears
=== CONT  TestAccElastiCacheUserGroupAssociation_basic
=== CONT  TestAccElastiCacheUser_update
=== CONT  TestAccElastiCacheUser_disappears
=== CONT  TestAccElastiCacheUser_tags
=== CONT  TestAccElastiCacheUser_password_auth_mode
=== CONT  TestAccElastiCacheUser_iam_auth_mode
=== CONT  TestAccElastiCacheUserGroupAssociation_multiple
=== CONT  TestAccElastiCacheUserGroup_tags
=== CONT  TestAccElastiCacheUserGroup_update
=== CONT  TestAccElastiCacheUserGroup_basic
--- PASS: TestAccElastiCacheUser_tags (91.78s)
--- PASS: TestAccElastiCacheUserDataSource_basic (92.13s)
--- PASS: TestAccElastiCacheUser_basic (95.28s)
--- PASS: TestAccElastiCacheUser_password_auth_mode (95.55s)
--- PASS: TestAccElastiCacheUser_iam_auth_mode (96.26s)
--- PASS: TestAccElastiCacheUser_disappears (112.14s)
--- PASS: TestAccElastiCacheUser_update (156.20s)
--- PASS: TestAccElastiCacheUser_update_password_auth_mode (215.00s)
--- PASS: TestAccElastiCacheUserGroup_disappears (215.98s)
--- PASS: TestAccElastiCacheUserGroup_tags (221.95s)
--- PASS: TestAccElastiCacheUserGroup_basic (223.48s)
--- PASS: TestAccElastiCacheUserGroupAssociation_basic (338.46s)
--- PASS: TestAccElastiCacheUserGroup_update (340.52s)
--- PASS: TestAccElastiCacheUserGroupAssociation_disappears (342.98s)
--- PASS: TestAccElastiCacheUserGroupAssociation_multiple (464.24s)
--- PASS: TestAccElastiCacheUserGroupAssociation_update (465.65s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/elasticache	470.805s

@cscacun
Copy link
Author

cscacun commented Mar 1, 2023

sorry, forgot to mention i pasted the output from tests into the description at the top

Copy link
Contributor

@schuylr schuylr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New parameters are validated properly per the API specs and leverage Go SDK type definition functions for future-proofing.

Documentation exists and changelog is present with the correct PR number.

Added one minor comment around a potentially better documentation example, but this isn't a critical point for the final review.

LGTM! 🚀

internal/service/elasticache/user.go Show resolved Hide resolved
website/docs/r/elasticache_user.html.markdown Show resolved Hide resolved
@mai-nguyen-coinhako
Copy link

Hi, can we merge this PR into the main branch as we, Terraform users, have been waiting for this feature for a while?

@cscacun
Copy link
Author

cscacun commented Mar 6, 2023

i think this is missing one more review. not sure when it will be picked up

@splichy
Copy link

splichy commented Mar 7, 2023

DISCLAIMER: not directly related to this PR, just side-note
@mai-nguyen-coinhako no hurry, if you are planning to use that with IRSA from EKS you will end up with AUTH failed: ERR invalid password - from EC2 instances IAM Auth works, but from EKS is not. I have spent a week mailing, then 5 hours on Chime call with AWS support - at least we were able to reproduce the issue, so they acknowledged it's probably a bug on their side. So far no final solution yet - they are still investigating.

@cscacun
Copy link
Author

cscacun commented Mar 13, 2023

@justinretzolk sorry to bother again, it seems this PR is missing one more review to be merged (please correct me if im wrong). is there any timeline of when to expect it ? im not familiar with the process

@ewbankkit ewbankkit self-assigned this Mar 15, 2023
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀.

% make testacc TESTARGS='-run=TestAccElastiCacheUser_' PKG=elasticache ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/elasticache/... -v -count 1 -parallel 3  -run=TestAccElastiCacheUser_ -timeout 180m
=== RUN   TestAccElastiCacheUser_basic
=== PAUSE TestAccElastiCacheUser_basic
=== RUN   TestAccElastiCacheUser_password_auth_mode
=== PAUSE TestAccElastiCacheUser_password_auth_mode
=== RUN   TestAccElastiCacheUser_iam_auth_mode
=== PAUSE TestAccElastiCacheUser_iam_auth_mode
=== RUN   TestAccElastiCacheUser_update
=== PAUSE TestAccElastiCacheUser_update
=== RUN   TestAccElastiCacheUser_update_password_auth_mode
=== PAUSE TestAccElastiCacheUser_update_password_auth_mode
=== RUN   TestAccElastiCacheUser_tags
=== PAUSE TestAccElastiCacheUser_tags
=== RUN   TestAccElastiCacheUser_disappears
=== PAUSE TestAccElastiCacheUser_disappears
=== CONT  TestAccElastiCacheUser_basic
=== CONT  TestAccElastiCacheUser_disappears
=== CONT  TestAccElastiCacheUser_update
--- PASS: TestAccElastiCacheUser_basic (26.11s)
=== CONT  TestAccElastiCacheUser_tags
--- PASS: TestAccElastiCacheUser_disappears (38.13s)
=== CONT  TestAccElastiCacheUser_update_password_auth_mode
--- PASS: TestAccElastiCacheUser_tags (62.17s)
=== CONT  TestAccElastiCacheUser_iam_auth_mode
--- PASS: TestAccElastiCacheUser_update (92.86s)
=== CONT  TestAccElastiCacheUser_password_auth_mode
--- PASS: TestAccElastiCacheUser_iam_auth_mode (62.64s)
--- PASS: TestAccElastiCacheUser_password_auth_mode (62.89s)
--- PASS: TestAccElastiCacheUser_update_password_auth_mode (171.60s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/elasticache	214.988s

@ewbankkit
Copy link
Contributor

@cscacun Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 174bfb4 into hashicorp:main Mar 15, 2023
46 checks passed
@github-actions github-actions bot added this to the v4.59.0 milestone Mar 15, 2023
@github-actions
Copy link

This functionality has been released in v4.59.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!

@github-actions
Copy link

I'm going to lock this pull request 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 related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/elasticache Issues and PRs that pertain to the elasticache service. size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
7 participants