-
Notifications
You must be signed in to change notification settings - Fork 9.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
Terraform errantly reports need to update. State file out of sync with deployed resources when no modifications have been made. #12552
Comments
This problem is also happening with the "admin_password" field which is not retrieved from azure API, but exists in the tf files as a real value. You can set it, but you can't read it back. |
FYI, I believe the custom_data issue should already be fixed in an upcoming version with this change: #12214 |
@brandontosch If that's the case, I think #12214 needs to also update the azurerm documentation to indicate that the data is base64 encoded internally. As it stands presently, you'd believe that the proper approach is to call "${base64encode( ... )}" as the value. |
Agreed, and looks like that got done as well, here: #12164 |
admin_password though, that may be something to look in to.. it's currently not decorated as sensitive either which seems like it should be (would prevent value from being output in console or logs) |
Also, noticed your comments in there regarding create_option on the data disk. When managed disk support (#12455) gets added you'll be able to define your disks independently of the VM (using azurerm_managed_disk) and then you can achieve a "create if not exists, otherwise attach" pattern by using the attach create_option (example, can't guarantee that's going to be the exact syntax since it's currently under review, but the pattern should be supported regardless). |
@jzampieron Note that you can probably work around the admin_password issue by using ssh_keys instead. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Terraform Version
Terraform v0.8.8
Affected Resource(s)
Please list the resources as a list, for example:
If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.
Terraform Configuration Files
Expected Behavior
Terraform should report that the state file is in sync with the
tf
files.Actual Behavior
terraform plan
reports the need to update the resources.Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
terraform plan
-> Note that terraform still tries to report modifications.Important Factoids
I believe this is related to the base64encode() function not storing the proper value in the state file for the
custom_data
element.The state file shows the raw JSON content instead of the base64encoded string shown in the plan output.
It's uncertain what's actually running on the cluster, although I believe it's correct b/c the API call works and the CoreOS configuration is updated.
The text was updated successfully, but these errors were encountered: