-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added appengine standard version resource
- Loading branch information
Showing
8 changed files
with
389 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
templates/terraform/custom_check_destroy/appengine_version.go.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
log.Printf("[DEBUG] Ignoring destroy during test") |
49 changes: 49 additions & 0 deletions
49
templates/terraform/custom_delete/noop_on_destroy_appengine_version.go.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
if d.Get("noop_on_destroy") == true { | ||
log.Printf("[DEBUG] Keeping the StandardAppVersion %q", d.Id()) | ||
return nil | ||
} | ||
config := meta.(*Config) | ||
|
||
project, err := getProject(d, config) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
lockName, err := replaceVars(d, config, "apps/{{project}}/services/{{service}}") | ||
if err != nil { | ||
return err | ||
} | ||
mutexKV.Lock(lockName) | ||
defer mutexKV.Unlock(lockName) | ||
|
||
url, err := replaceVars(d, config, "{{AppEngineBasePath}}apps/{{project}}/services/{{service}}/versions/{{version_id}}") | ||
if err != nil { | ||
return err | ||
} | ||
|
||
var obj map[string]interface{} | ||
log.Printf("[DEBUG] Deleting StandardAppVersion %q", d.Id()) | ||
|
||
res, err := sendRequestWithTimeout(config, "DELETE", project, url, obj, d.Timeout(schema.TimeoutDelete)) | ||
if err != nil { | ||
return handleNotFoundError(err, d, "StandardAppVersion") | ||
} | ||
|
||
op := &appengine.Operation{} | ||
err = Convert(res, op) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
err = appEngineOperationWaitTime( | ||
config.clientAppEngine, op, project, "Deleting StandardAppVersion", | ||
int(d.Timeout(schema.TimeoutDelete).Minutes())) | ||
|
||
if err != nil { | ||
return err | ||
} | ||
|
||
log.Printf("[DEBUG] Finished deleting StandardAppVersion %q: %#v", d.Id(), res) | ||
return nil | ||
|
||
|
Oops, something went wrong.