[Bug]: aws_elasticache_replication_group auth_token_update_strategy updated to default ROTATE despite being null/unspecified in config during import #38209
When importing an aws_elasticache_replication_group with no current auth configuration (auth_token, auth_token_update_strategy), the auth_token_update_strategy should be optional and should not have its value updated to the default unless an auth_token is specified.
Actual Behavior
When trying to import an aws_elasticache_replication_group. It automatically sets the strategy to ROTATE in the plan. Ignoring the auth_token_update_strategy in a lifecycle rule caused the plan to behave as expected. However, even when ignoring via lifecycle rule, the auth_token_update_strategy was then updated to ROTATE in my tfstate after applying and I got this error:
modifying ElastiCache Replication Group (***) authentication: InvalidParameterValue: The AUTH token modification is only supported when encryption-in-transit is enabled.
This is when I'm not setting auth_token or auth_token_update_strategy in my configuration.
Relevant Error/Panic Output Snippet
# terraform plan
# aws_elasticache_replication_group.staging-taskplanner will be updated in-place
~ resource "aws_elasticache_replication_group" "staging-taskplanner" {
+ auth_token_update_strategy = "ROTATE"
id = "staging-taskplanner"
tags = {}
~ tags_all = {
+ "project" = "limebike/infra-terraform"
+ "project_maintainer" = "infra"
+ "terraform" = "true"
}
# (33 unchanged attributes hidden)
- timeouts {}
# (2 unchanged blocks hidden)
}
# terraform apply with lifecycle rule to ignore auth_token_update_strategy
modifying ElastiCache Replication Group (***) authentication: InvalidParameterValue: The AUTH token modification is only supported when encryption-in-transit is enabled.
Terraform Configuration Files
case where auth_token_udpate_strategy shows as updated in plan:
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.
Volunteering to Work on This Issue
If you are interested in working on this issue, please leave a comment.
If this would be your first contribution, please review the contribution guide.
Terraform Core Version
1.8.5
AWS Provider Version
5.54.1
Affected Resource(s)
aws_elasticache_replication_group
Expected Behavior
When importing an aws_elasticache_replication_group with no current auth configuration (auth_token, auth_token_update_strategy), the auth_token_update_strategy should be optional and should not have its value updated to the default unless an auth_token is specified.
Actual Behavior
When trying to import an aws_elasticache_replication_group. It automatically sets the strategy to ROTATE in the plan. Ignoring the auth_token_update_strategy in a lifecycle rule caused the plan to behave as expected. However, even when ignoring via lifecycle rule, the auth_token_update_strategy was then updated to ROTATE in my tfstate after applying and I got this error:
This is when I'm not setting auth_token or auth_token_update_strategy in my configuration.
Relevant Error/Panic Output Snippet
Terraform Configuration Files
case where
auth_token_udpate_strategy
shows as updated in plan:Case when terraform apply changes
auth_token_update_strategy
despite no change in plan:Steps to Reproduce
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
No