-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
mssql_virtual_machine
- Deprecated encryption_enabled
and validate storage_account_access_key
#28223
mssql_virtual_machine
- Deprecated encryption_enabled
and validate storage_account_access_key
#28223
Conversation
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.
Thanks for submitting this PR @cgraf-spiria, for deprecations we follow a specific format that allows us to clean up deprecated properties in the code easily after a major release. I have left some comments inline if you wouldn't mind taking a look!
Co-authored-by: sreallymatt <106555974+sreallymatt@users.noreply.github.com>
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.
Thanks for making those changes @cgraf-spiria, I left a few minor suggestions, once those are in this looks good to me!
![]() We've got one test failure, I had a peek at what's happening and the issue lies in the Could you add the following to that switch case, and resolve the 5.0-upgrade-guide merge conflict? (or if you prefer, I can push the changes to your fork!) default:
// To be removed in 5.0:
// When `encryption_enabled` is not set in config, but `encryption_password` is, `v != val` will always be `true`.
// This causes an infinite loop until the resource creation times out. To avoid this, continue to the next iteration of the loop if
// `prop` is `encryption_enabled`.
if !features.FivePointOh() && prop == "encryption_enabled" {
continue
}
if v != val {
return resp, "Pending", nil
} |
I added the fix & resolved the conflict. Thanks again for helping me get this PR working, much appreciated. :) |
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.
Thanks @cgraf-spiria, tests passed, LGTM 🚀
Community Note
Description
Fixes azurerm_mssql_virtual_machine auto_backup encryption_password failing #12811 by :
encryption_enabled
andencryption_password
which caused the issueencryption_enabled
attributeencryption_password
is defined or notAdd a validation for
storage_account_access_key
to ensure it is a base64 string. Without the validation, when the users gives an invalid value, the Azure API gives an unclear base64 error which makes it hard to find the correct issue.PR Checklist
For example: “
resource_name_here
- description of change e.g. adding propertynew_property_name_here
”Changes to existing Resource / Data Source
Testing
Not a new resource. But I ran existing unit tests and used the compiled provider to test it works.
For state migrations please test the changes locally and provide details here, such as the versions involved in testing the migration path. For further details on testing state migration changes please see our guide on state migrations in the contributor documentation. -->
Change Log
Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.
mssql_virtual_machine
- Deprecatedencryption_enabled
. Encryption is enabled when encryption_password is set; otherwise disabled.mssql_virtual_machine
- Validatestorage_account_access_key
is a base64 string.Related Issue(s)
Fixes #12811
Note
If this PR changes meaningfully during the course of review please update the title and description as required.