It should create the AWS Cognito user with the credentials retrieved from the data.aws_secretsmanager_secret_version block. This data block is getting the secret value from the previously created secret using the resource aws_secretsmanager_secret_version.
Actual Behavior
It shows an error (see Relevant Error/Panic Output Snippet)
Relevant Error/Panic Output Snippet
╷
│ Error: Provider produced inconsistent final plan
│
│ When expanding the plan for
│ module.authentication.aws_cognito_user.main_admin_user to include new
│ values learned so far during apply, provider
│ "registry.terraform.io/hashicorp/aws" produced an invalid new value for
│ .attributes: inconsistent values for sensitive attribute.
│
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.
╵
The provider endpoint is a Localstack instance instead of the actual AWS environment. Besides, I am running Terraform on Docker, the image is 1.5.7. I have read that a resource block should not use the data block immediately after it is created, but it works in another case:
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.5.7
AWS Provider Version
5.17.0
Affected Resource(s)
Resources
Data sources:
Expected Behavior
It should create the AWS Cognito user with the credentials retrieved from the data.aws_secretsmanager_secret_version block. This data block is getting the secret value from the previously created secret using the resource aws_secretsmanager_secret_version.
Actual Behavior
It shows an error (see Relevant Error/Panic Output Snippet)
Relevant Error/Panic Output Snippet
Terraform Configuration Files
Steps to Reproduce
terraform init
terraform apply
Debug Output
https://gist.github.com/marco-luzzara/fbf1e30f066ec480f55fb701005b99ce
Panic Output
No response
Important Factoids
The provider endpoint is a Localstack instance instead of the actual AWS environment. Besides, I am running Terraform on Docker, the image is 1.5.7. I have read that a resource block should not use the data block immediately after it is created, but it works in another case:
so I thought that this might be a real issue.
References
No response
Would you like to implement a fix?
None