-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Cloud SQL - Error importing database instance #4626
Comments
Many users will specify their project in config (or an env var) so we allow convenience import ids by just the name of the resource. Unfortunately, when running If you use the |
Thanks for the quick feedback, @rileykarson. I can confirm that the import works using the proposed syntax (of which I wasn't aware, TBH): At this point I am having a new issue though: while trying to import a Let's say I have this config: resource "google_sql_database_instance" "some-database-instance" {
project = "${var.gcp_project}"
provider = "google"
name = "some-name"
region = "europe-west3"
database_version = "MYSQL_5_7"
settings {
tier = "db-n1-standard-1"
}
}
resource "google_sql_database" "some-database" {
project = "${var.gcp_project}"
name = "some_name"
instance = "${google_sql_database_instance.name}"
} ... and I run this command: This is the output:
Am I missing something here? |
@olegkorol please check the documentation for the list of available import formats: https://www.terraform.io/docs/providers/google/r/sql_database.html#import |
Ok, got it. Thanks a lot @Chupaka. |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Community Note
Terraform Version
Terraform v0.12.9
Affected Resource(s)
Terraform Configuration Files
Then I am running:
terraform import google_sql_database_instance.sql-instance instance-id
Debug Output
N/A
Panic Output
The import command mentioned above returns:
Error: project: required field is not set
(Note that the
project
field is set... and it is actually not a required field, AFAIK)Expected Behavior
It should import the specified resource.
Actual Behavior
Errors and fails to execute command.
Steps to Reproduce
Important Factoids
N/A
References
N/A
The text was updated successfully, but these errors were encountered: