Skip to content
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

Import of azurerm_mysql_flexible_server triggers replace when subscription changes #25165

Open
1 task done
therealjsie opened this issue Mar 6, 2024 · 2 comments
Open
1 task done

Comments

@therealjsie
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.

Terraform Version

1.5.7

AzureRM Provider Version

3.91.0

Affected Resource(s)/Data Source(s)

azurerm_mysql_flexible_server

Terraform Configuration Files

I wasn't able to reproduce the issue yet, but will try to come up with a working example.

Debug Output/Panic Output

The Terraform Cloud output displays (among other things) the following line:

➕ create_mode : "Default" *Forces replacement*

However, the `create_mode` has not changed (as the server was only moved between subscriptions). The `create_mode` is `Default` in the state as well.

Expected Behaviour

We have moved an azurerm_mysql_flexible_server instance between two subscriptions. As the azurerm provider cannot keep track of resources between subscriptions, we opted to remove the original resource from state and then import the moved resource. There are no other configuration changes on the flexible server during the move.

This report is mainly to find out if there are known issues with the import of azurerm_mysql_flexible_server resources (looking through the GitHub issues was not conclusive).

I expect the flexible server to be imported without any changes shown in the Terraform Cloud UI after moving it between subscriptions.

Actual Behaviour

The moved flexible server can only be imported with multiple values being Known after apply (e.g. fqdn), Removed (e.g. private_dns_zone_id) or Created (e.g. create_mode). None of these values should have any changes (afaict).

Steps to Reproduce

No response

Important Factoids

No response

References

No response

@therealjsie
Copy link
Author

Quick update: Adding create_mode and administrator_password to the lifecycle -> ignore changes actually resolves the issue. After adding these two fields to the ignore list, no other changes are shown and the database can (supposedly) be imported. I haven't run the apply yet, but it looks good in the plan.

@rcskosir
Copy link
Contributor

rcskosir commented Mar 8, 2024

Thank you for taking the time to open this issue. Please subscribe to PR #25179 created by @neil-yechenwei for this issue.

@rcskosir rcskosir added the bug label Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants