Open gramsa49 opened 7 months ago
Voting for Prioritization
Volunteering to Work on This Issue
I would like to take a stab at fixing this.
I took I look at this and this may not be possible to test properly with AWS's current APIs. The updateDataLake does provide an option to change the metaStoreRoleArn... however there is no way in the API to confirm that it has been changed. Even the API response for updateDataLake does not return the new value for metaStoreRoleArn. And the read API call listDataLakes does not return the metaStoreRoleArn :/ .
I could technically remove the requiresReplace for the metaStoreRoleArn field and the updateDataLake should technically update this field. But I have no way of adding another acceptance test for this behavior.
Is it ok to proceed without adding an additional acceptance test because I don't know if there is a way to test this right now due to the limitations in the API?
Regarding my previous comment - it looks like metaStoreRoleArn
can't be confirmed by read operations via the AWS API and in the original tests we ignore the fact that we really can't confirm the behavior with an API call. I was able to push a fix in #36874 and I added an acceptance test.
Terraform Core Version
1.6.2
AWS Provider Version
5.44.0
Affected Resource(s)
Expected Behavior
When changing parameter meta_store_manager_role_arn, the data lake should be updated.
Actual Behavior
When changing parameter meta_store_manager_role_arn, the data lake is recreated (stringplanmodifier.RequiresReplace).
Relevant Error/Panic Output Snippet
Terraform Configuration Files
Steps to Reproduce
Change the value of var.metastore_role.arn, generate a new plan
Debug Output
Panic Output
n/a
Important Factoids
The role name used by Security Lake needs to be changed when updating from V1 to V2 because the Lambda functions created by Security Lake are hard coded to use the new role name, AmazonSecurityLakeMetaStoreManagerV2, and does not honor the role arn provided to the security lake configuration.
I believe a new API call, UpdateDataLake, was introduced after this resource was initially authored. See https://docs.aws.amazon.com/security-lake/latest/APIReference/API_UpdateDataLake.html
UpdateDataLake supports updating the Meta Store Manager ARN.
References
https://docs.aws.amazon.com/security-lake/latest/APIReference/API_UpdateDataLake.html
Would you like to implement a fix?
No