Closed xiaxuantan closed 1 year ago
The main reasons not to support it:
terraform import
is really easy and it just works in cases one wants to use a pre-existing resource.
- Adopting makes it possible to include one user twice. Deleting one of them leads to deletion of a user and creation again on the next apply. That's not something we want.
Cool thanks for the explanation.
Terraform Version
Affected Resource(s)
Mainly
mysql_users
andmysql_database
.Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
When trying to create a user or database for an imported database or for a database restored from a snapshot where the users/databases already exist, we expect the creation to succeed anyway.
Actual Behavior
We got errors saying the users already exist.
While it might sound like a terraform import issue, it's hard to include it in our automation and I wonder if it's possible to add a new boolean parameter
adopt_if_exists
to these resources. If it's specified, the provider uses verbCREATE xx IF NOT EXISTS
.Suggested change
so that the creation can succeed regardless of the pre-existence of the resources.
Steps to Reproduce
Important Factoids
References