-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Add authentication_mode to aws_elasticache_user #28928
Conversation
Community NoteVoting for Prioritization
For Submitters
|
There was a problem hiding this 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! 😃
@justinretzolk i was wondering if this PR is missing anything to be reviewed |
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. |
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. |
@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 |
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! |
There was a problem hiding this 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
@schuylr could you please help me run the tests again ? |
Results:
|
@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 thanks a lot for your help! i was able to fix everything and run the tests myself this time |
Nice work! Will give a review shortly.
|
sorry, forgot to mention i pasted the output from tests into the description at the top |
There was a problem hiding this 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! 🚀
Hi, can we merge this PR into the main branch as we, Terraform users, have been waiting for this feature for a while? |
i think this is missing one more review. not sure when it will be picked up |
DISCLAIMER: not directly related to this PR, just side-note |
@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 |
There was a problem hiding this 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
@cscacun Thanks for the contribution 🎉 👏. |
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! |
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. |
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
withauthentication_mode.type
=iam
.This PR adds
authentication_mode
as an argument toaws_elasticache_user
. The possible values forauthentication_mode.type
arepassword
,no-password-required
oriam
. Iftype
=password
, then the passwords should be provided in theauthentication_mode.passwords
fieldRelations
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