From 8f6d256f51070b3cf2b8e36324c0170747a94b61 Mon Sep 17 00:00:00 2001 From: Paddy Carver Date: Tue, 2 Oct 2018 23:41:31 -0700 Subject: [PATCH] Fix Dana's comments, round two! --- google/resource_app_engine_application.go | 1 + google/resource_google_project.go | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/google/resource_app_engine_application.go b/google/resource_app_engine_application.go index ed4239a4..68cc3810 100644 --- a/google/resource_app_engine_application.go +++ b/google/resource_app_engine_application.go @@ -163,6 +163,7 @@ func resourceAppEngineApplicationCreate(d *schema.ResourceData, meta interface{} // Wait for the operation to complete waitErr := appEngineOperationWait(config.clientAppEngine, op, project, "App Engine app to create") if waitErr != nil { + d.SetId("") return waitErr } log.Printf("[DEBUG] Created App Engine App") diff --git a/google/resource_google_project.go b/google/resource_google_project.go index 9dbc0308..ed6db66f 100644 --- a/google/resource_google_project.go +++ b/google/resource_google_project.go @@ -209,9 +209,7 @@ func appEngineFeatureSettingsResource() *schema.Resource { func resourceGoogleProjectCustomizeDiff(diff *schema.ResourceDiff, meta interface{}) error { if old, _ := diff.GetChange("app_engine.0.location_id"); diff.HasChange("app_engine.0.location_id") && old != nil && old.(string) != "" { - // if location_id was already set, and has a new value, that forces a new app - // if location_id wasn't set, don't force a new value, as we're just enabling app engine - return diff.ForceNew("app_engine.0.location_id") + return fmt.Errorf("Cannot change app_engine.0.location_id once the app is created.") } return nil }