-
Notifications
You must be signed in to change notification settings - Fork 178
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
chore: migrate encryption_at_rest resource to new SDK #1725
Conversation
} | ||
|
||
atlasEncryptionAtRest.GroupID = projectID | ||
|
||
encryptionResp, _, err := conn.EncryptionsAtRest.Create(ctx, atlasEncryptionAtRest) |
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.
projectID := encryptionAtRestState.ProjectID.ValueString() | ||
_, err := conn.EncryptionsAtRest.Delete(ctx, projectID) |
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.
ok for me once it's tested manually |
internal/service/encryptionatrest/resource_encryption_at_rest_migration_test.go
Outdated
Show resolved
Hide resolved
internal/service/encryptionatrest/resource_encryption_at_rest_migration_test.go
Outdated
Show resolved
Hide resolved
|
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, just one doubt
projectID := encryptionAtRestState.ProjectID.ValueString() | ||
_, err := conn.EncryptionsAtRest.Delete(ctx, projectID) | ||
|
||
_, _, err := connV2.EncryptionAtRestUsingCustomerKeyManagementApi.GetEncryptionAtRest(context.Background(), projectID).Execute() |
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.
is there a reason we need to do this get request? comparing to previous logic it would seem it does the update directly
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.
Did this to match the implementation in CFN which was already migrated to the new SDK
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.
I see, it would seem in CFN it does the get to provide a more detailed error. When looking into terraform delete functions we go for the delete operation directly, in case the resource has already been deleted the API error would be returned.
Description
Migrate encryption_at_rest resource to new SDK
Link to any related issue(s): https://jira.mongodb.org/browse/CLOUDP-216420
Type of change:
Required Checklist:
Further comments