Open AaronFriel opened 4 years ago
Tracked upstream in https://github.com/hashicorp/terraform-provider-google/issues/7810
Repro:
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
// Create a new SQL Database Instance
const instance = new gcp.sql.DatabaseInstance("my-instance", {
name: "my-instance",
region: "us-central1",
databaseVersion: "MYSQL_8_0",
settings: {
tier: "db-f1-micro",
},
});
// Create a new SQL Database
const database = new gcp.sql.Database("my-database", {
name: "my-database",
instance: instance.name,
charset: "utf8",
collation: "utf8_general_ci",
});
// Create a new SQL User
const user = new gcp.sql.User("my-user", {
name: "my-user",
instance: instance.name,
password: "my-password",
});
It looks like this is still a problem in terraform:
tf refresh
google_sql_database_instance.myinstance: Refreshing state... [id=my-instance]
google_sql_database.my_database: Refreshing state... [id=projects/pulumi-ce-team/instances/my-instance/databases/my-database]
google_sql_user.my_user: Refreshing state... [id=my-user//my-instance]
╷
│ Error: googleapi: Error 404: The Cloud SQL instance does not exist., instanceDoesNotExist
│
│ with google_sql_database.my_database,
│ on main.tf line 18, in resource "google_sql_database" "my_database":
│ 18: resource "google_sql_database" "my_database" {
│
╵
╷
│ Error: googleapi: Error 404: The Cloud SQL instance does not exist., instanceDoesNotExist
│
│ with google_sql_user.my_user,
│ on main.tf line 26, in resource "google_sql_user" "my_user":
│ 26: resource "google_sql_user" "my_user" {
│```
Suppose I have a
DatabaseInstance
Foo, and it contains a user (bar of course) and a database (quux of course).If someone manually deletes Foo from the Google Cloud Console, the stack is now in a stuck state, because trying to redeploy it using
pulumi up --refresh
results in this error: