Closed bwoznicki closed 2 years ago
@bwoznicki thank you for the report. We'll take a look and see if we can determine what's going on w/ the import here.
@bwoznicki Confirmed that import state from 0.8.2 to newer version 1.4.5 in my test case "backup_enabled": false "cloud_backup": null
appears in the statefile after import completes no specific code in import function to manage cloud_backup and legacy provider_backup_enabled value
@bwoznicki I was able with new release version (v1.4.6) 1) run a cluster build using 0.8.2 with provider_backup_enabled = true 2) delete cluster from state file 3) set version.tf to 1.4.6 from 0.8.2 for provider version 4) terraform init -upgrade 5) terraform import 6) comment out backup_enabled 7) set cloud_backup in tf file 8) terraform apply no changes detected cloud_backup set to match old value of provider_backup_enabled in statefile
@bwoznicki v1.4.6 released feel free to test new release as it should correct this import issue
Terraform CLI and Terraform MongoDB Atlas Provider Version
Terraform Configuration File
Steps to Reproduce
We have existing configuration that was deployed with mongodb atlas provider version 0.8.2 and in process of upgrading to 1.3.1. In the existing configuration we used
provider_backup_enabled
which is now renamed tocloud_backup
for testing we have created a minimum config for the purpuse of import just to check existing values.After running
in state, the cloud_backup and provider_backup_enabled both have null values, resulting in the bellow plan output:
we have no intention of applying any changes just upgrading the provider. I know I can go and phisicaly add those values to state file, but the import should return current backup status, and not force user to still set value for provider_backup_enabled since that is now deprecated.
Expected Behavior
show difference in
cloud_backup
value, but suppressprovider_backup_enabled
. Since this is an import user should not be forced to apply anythingActual Behavior
Terraform does not return actual status of backup, but if we run atlas CLI we can see that it is enabled. eg:
Debug Output
Crash Output
Additional Context
References