mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-07-08 19:18:30 +00:00
Adding default timeouts to sync MM resources (#2569)
This commit is contained in:
parent
b0d5dee643
commit
21271a65e3
|
@ -164,7 +164,7 @@ func resourceComputeAddressCreate(d *schema.ResourceData, meta interface{}) erro
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Creating new Address: %#v", obj)
|
log.Printf("[DEBUG] Creating new Address: %#v", obj)
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutCreate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating Address: %s", err)
|
return fmt.Errorf("Error creating Address: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -266,7 +266,7 @@ func resourceComputeAddressDelete(d *schema.ResourceData, meta interface{}) erro
|
||||||
|
|
||||||
var obj map[string]interface{}
|
var obj map[string]interface{}
|
||||||
log.Printf("[DEBUG] Deleting Address %q", d.Id())
|
log.Printf("[DEBUG] Deleting Address %q", d.Id())
|
||||||
res, err := sendRequest(config, "DELETE", url, obj)
|
res, err := sendRequestWithTimeout(config, "DELETE", url, obj, d.Timeout(schema.TimeoutDelete))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleNotFoundError(err, d, "Address")
|
return handleNotFoundError(err, d, "Address")
|
||||||
}
|
}
|
||||||
|
|
|
@ -195,7 +195,7 @@ func resourceComputeAutoscalerCreate(d *schema.ResourceData, meta interface{}) e
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Creating new Autoscaler: %#v", obj)
|
log.Printf("[DEBUG] Creating new Autoscaler: %#v", obj)
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutCreate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating Autoscaler: %s", err)
|
return fmt.Errorf("Error creating Autoscaler: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -319,7 +319,7 @@ func resourceComputeAutoscalerUpdate(d *schema.ResourceData, meta interface{}) e
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Updating Autoscaler %q: %#v", d.Id(), obj)
|
log.Printf("[DEBUG] Updating Autoscaler %q: %#v", d.Id(), obj)
|
||||||
res, err := sendRequest(config, "PUT", url, obj)
|
res, err := sendRequestWithTimeout(config, "PUT", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating Autoscaler %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating Autoscaler %q: %s", d.Id(), err)
|
||||||
|
@ -356,7 +356,7 @@ func resourceComputeAutoscalerDelete(d *schema.ResourceData, meta interface{}) e
|
||||||
|
|
||||||
var obj map[string]interface{}
|
var obj map[string]interface{}
|
||||||
log.Printf("[DEBUG] Deleting Autoscaler %q", d.Id())
|
log.Printf("[DEBUG] Deleting Autoscaler %q", d.Id())
|
||||||
res, err := sendRequest(config, "DELETE", url, obj)
|
res, err := sendRequestWithTimeout(config, "DELETE", url, obj, d.Timeout(schema.TimeoutDelete))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleNotFoundError(err, d, "Autoscaler")
|
return handleNotFoundError(err, d, "Autoscaler")
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,7 +113,7 @@ func resourceComputeBackendBucketCreate(d *schema.ResourceData, meta interface{}
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Creating new BackendBucket: %#v", obj)
|
log.Printf("[DEBUG] Creating new BackendBucket: %#v", obj)
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutCreate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating BackendBucket: %s", err)
|
return fmt.Errorf("Error creating BackendBucket: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -228,7 +228,7 @@ func resourceComputeBackendBucketUpdate(d *schema.ResourceData, meta interface{}
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Updating BackendBucket %q: %#v", d.Id(), obj)
|
log.Printf("[DEBUG] Updating BackendBucket %q: %#v", d.Id(), obj)
|
||||||
res, err := sendRequest(config, "PUT", url, obj)
|
res, err := sendRequestWithTimeout(config, "PUT", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating BackendBucket %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating BackendBucket %q: %s", d.Id(), err)
|
||||||
|
@ -265,7 +265,7 @@ func resourceComputeBackendBucketDelete(d *schema.ResourceData, meta interface{}
|
||||||
|
|
||||||
var obj map[string]interface{}
|
var obj map[string]interface{}
|
||||||
log.Printf("[DEBUG] Deleting BackendBucket %q", d.Id())
|
log.Printf("[DEBUG] Deleting BackendBucket %q", d.Id())
|
||||||
res, err := sendRequest(config, "DELETE", url, obj)
|
res, err := sendRequestWithTimeout(config, "DELETE", url, obj, d.Timeout(schema.TimeoutDelete))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleNotFoundError(err, d, "BackendBucket")
|
return handleNotFoundError(err, d, "BackendBucket")
|
||||||
}
|
}
|
||||||
|
|
|
@ -248,6 +248,7 @@ func resourceComputeDisk() *schema.Resource {
|
||||||
Update: schema.DefaultTimeout(240 * time.Second),
|
Update: schema.DefaultTimeout(240 * time.Second),
|
||||||
Delete: schema.DefaultTimeout(240 * time.Second),
|
Delete: schema.DefaultTimeout(240 * time.Second),
|
||||||
},
|
},
|
||||||
|
|
||||||
CustomizeDiff: customdiff.All(
|
CustomizeDiff: customdiff.All(
|
||||||
customdiff.ForceNewIfChange("size", isDiskShrinkage)),
|
customdiff.ForceNewIfChange("size", isDiskShrinkage)),
|
||||||
|
|
||||||
|
@ -502,7 +503,7 @@ func resourceComputeDiskCreate(d *schema.ResourceData, meta interface{}) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Creating new Disk: %#v", obj)
|
log.Printf("[DEBUG] Creating new Disk: %#v", obj)
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutCreate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating Disk: %s", err)
|
return fmt.Errorf("Error creating Disk: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -650,7 +651,7 @@ func resourceComputeDiskUpdate(d *schema.ResourceData, meta interface{}) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating Disk %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating Disk %q: %s", d.Id(), err)
|
||||||
}
|
}
|
||||||
|
@ -689,7 +690,7 @@ func resourceComputeDiskUpdate(d *schema.ResourceData, meta interface{}) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating Disk %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating Disk %q: %s", d.Id(), err)
|
||||||
}
|
}
|
||||||
|
@ -779,7 +780,7 @@ func resourceComputeDiskDelete(d *schema.ResourceData, meta interface{}) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log.Printf("[DEBUG] Deleting Disk %q", d.Id())
|
log.Printf("[DEBUG] Deleting Disk %q", d.Id())
|
||||||
res, err := sendRequest(config, "DELETE", url, obj)
|
res, err := sendRequestWithTimeout(config, "DELETE", url, obj, d.Timeout(schema.TimeoutDelete))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleNotFoundError(err, d, "Disk")
|
return handleNotFoundError(err, d, "Disk")
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,6 +64,7 @@ func resourceComputeFirewall() *schema.Resource {
|
||||||
Update: schema.DefaultTimeout(240 * time.Second),
|
Update: schema.DefaultTimeout(240 * time.Second),
|
||||||
Delete: schema.DefaultTimeout(240 * time.Second),
|
Delete: schema.DefaultTimeout(240 * time.Second),
|
||||||
},
|
},
|
||||||
|
|
||||||
SchemaVersion: 1,
|
SchemaVersion: 1,
|
||||||
MigrateState: resourceComputeFirewallMigrateState,
|
MigrateState: resourceComputeFirewallMigrateState,
|
||||||
|
|
||||||
|
@ -312,7 +313,7 @@ func resourceComputeFirewallCreate(d *schema.ResourceData, meta interface{}) err
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Creating new Firewall: %#v", obj)
|
log.Printf("[DEBUG] Creating new Firewall: %#v", obj)
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutCreate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating Firewall: %s", err)
|
return fmt.Errorf("Error creating Firewall: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -511,7 +512,7 @@ func resourceComputeFirewallUpdate(d *schema.ResourceData, meta interface{}) err
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Updating Firewall %q: %#v", d.Id(), obj)
|
log.Printf("[DEBUG] Updating Firewall %q: %#v", d.Id(), obj)
|
||||||
res, err := sendRequest(config, "PATCH", url, obj)
|
res, err := sendRequestWithTimeout(config, "PATCH", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating Firewall %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating Firewall %q: %s", d.Id(), err)
|
||||||
|
@ -548,7 +549,7 @@ func resourceComputeFirewallDelete(d *schema.ResourceData, meta interface{}) err
|
||||||
|
|
||||||
var obj map[string]interface{}
|
var obj map[string]interface{}
|
||||||
log.Printf("[DEBUG] Deleting Firewall %q", d.Id())
|
log.Printf("[DEBUG] Deleting Firewall %q", d.Id())
|
||||||
res, err := sendRequest(config, "DELETE", url, obj)
|
res, err := sendRequestWithTimeout(config, "DELETE", url, obj, d.Timeout(schema.TimeoutDelete))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleNotFoundError(err, d, "Firewall")
|
return handleNotFoundError(err, d, "Firewall")
|
||||||
}
|
}
|
||||||
|
|
|
@ -249,7 +249,7 @@ func resourceComputeForwardingRuleCreate(d *schema.ResourceData, meta interface{
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Creating new ForwardingRule: %#v", obj)
|
log.Printf("[DEBUG] Creating new ForwardingRule: %#v", obj)
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutCreate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating ForwardingRule: %s", err)
|
return fmt.Errorf("Error creating ForwardingRule: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -377,7 +377,7 @@ func resourceComputeForwardingRuleUpdate(d *schema.ResourceData, meta interface{
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating ForwardingRule %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating ForwardingRule %q: %s", d.Id(), err)
|
||||||
}
|
}
|
||||||
|
@ -418,7 +418,7 @@ func resourceComputeForwardingRuleDelete(d *schema.ResourceData, meta interface{
|
||||||
|
|
||||||
var obj map[string]interface{}
|
var obj map[string]interface{}
|
||||||
log.Printf("[DEBUG] Deleting ForwardingRule %q", d.Id())
|
log.Printf("[DEBUG] Deleting ForwardingRule %q", d.Id())
|
||||||
res, err := sendRequest(config, "DELETE", url, obj)
|
res, err := sendRequestWithTimeout(config, "DELETE", url, obj, d.Timeout(schema.TimeoutDelete))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleNotFoundError(err, d, "ForwardingRule")
|
return handleNotFoundError(err, d, "ForwardingRule")
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,7 +131,7 @@ func resourceComputeGlobalAddressCreate(d *schema.ResourceData, meta interface{}
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Creating new GlobalAddress: %#v", obj)
|
log.Printf("[DEBUG] Creating new GlobalAddress: %#v", obj)
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutCreate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating GlobalAddress: %s", err)
|
return fmt.Errorf("Error creating GlobalAddress: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -224,7 +224,7 @@ func resourceComputeGlobalAddressDelete(d *schema.ResourceData, meta interface{}
|
||||||
|
|
||||||
var obj map[string]interface{}
|
var obj map[string]interface{}
|
||||||
log.Printf("[DEBUG] Deleting GlobalAddress %q", d.Id())
|
log.Printf("[DEBUG] Deleting GlobalAddress %q", d.Id())
|
||||||
res, err := sendRequest(config, "DELETE", url, obj)
|
res, err := sendRequestWithTimeout(config, "DELETE", url, obj, d.Timeout(schema.TimeoutDelete))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleNotFoundError(err, d, "GlobalAddress")
|
return handleNotFoundError(err, d, "GlobalAddress")
|
||||||
}
|
}
|
||||||
|
|
|
@ -297,7 +297,7 @@ func resourceComputeHealthCheckCreate(d *schema.ResourceData, meta interface{})
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Creating new HealthCheck: %#v", obj)
|
log.Printf("[DEBUG] Creating new HealthCheck: %#v", obj)
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutCreate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating HealthCheck: %s", err)
|
return fmt.Errorf("Error creating HealthCheck: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -471,7 +471,7 @@ func resourceComputeHealthCheckUpdate(d *schema.ResourceData, meta interface{})
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Updating HealthCheck %q: %#v", d.Id(), obj)
|
log.Printf("[DEBUG] Updating HealthCheck %q: %#v", d.Id(), obj)
|
||||||
res, err := sendRequest(config, "PUT", url, obj)
|
res, err := sendRequestWithTimeout(config, "PUT", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating HealthCheck %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating HealthCheck %q: %s", d.Id(), err)
|
||||||
|
@ -508,7 +508,7 @@ func resourceComputeHealthCheckDelete(d *schema.ResourceData, meta interface{})
|
||||||
|
|
||||||
var obj map[string]interface{}
|
var obj map[string]interface{}
|
||||||
log.Printf("[DEBUG] Deleting HealthCheck %q", d.Id())
|
log.Printf("[DEBUG] Deleting HealthCheck %q", d.Id())
|
||||||
res, err := sendRequest(config, "DELETE", url, obj)
|
res, err := sendRequestWithTimeout(config, "DELETE", url, obj, d.Timeout(schema.TimeoutDelete))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleNotFoundError(err, d, "HealthCheck")
|
return handleNotFoundError(err, d, "HealthCheck")
|
||||||
}
|
}
|
||||||
|
|
|
@ -169,7 +169,7 @@ func resourceComputeHttpHealthCheckCreate(d *schema.ResourceData, meta interface
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Creating new HttpHealthCheck: %#v", obj)
|
log.Printf("[DEBUG] Creating new HttpHealthCheck: %#v", obj)
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutCreate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating HttpHealthCheck: %s", err)
|
return fmt.Errorf("Error creating HttpHealthCheck: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -329,7 +329,7 @@ func resourceComputeHttpHealthCheckUpdate(d *schema.ResourceData, meta interface
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Updating HttpHealthCheck %q: %#v", d.Id(), obj)
|
log.Printf("[DEBUG] Updating HttpHealthCheck %q: %#v", d.Id(), obj)
|
||||||
res, err := sendRequest(config, "PUT", url, obj)
|
res, err := sendRequestWithTimeout(config, "PUT", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating HttpHealthCheck %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating HttpHealthCheck %q: %s", d.Id(), err)
|
||||||
|
@ -366,7 +366,7 @@ func resourceComputeHttpHealthCheckDelete(d *schema.ResourceData, meta interface
|
||||||
|
|
||||||
var obj map[string]interface{}
|
var obj map[string]interface{}
|
||||||
log.Printf("[DEBUG] Deleting HttpHealthCheck %q", d.Id())
|
log.Printf("[DEBUG] Deleting HttpHealthCheck %q", d.Id())
|
||||||
res, err := sendRequest(config, "DELETE", url, obj)
|
res, err := sendRequestWithTimeout(config, "DELETE", url, obj, d.Timeout(schema.TimeoutDelete))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleNotFoundError(err, d, "HttpHealthCheck")
|
return handleNotFoundError(err, d, "HttpHealthCheck")
|
||||||
}
|
}
|
||||||
|
|
|
@ -169,7 +169,7 @@ func resourceComputeHttpsHealthCheckCreate(d *schema.ResourceData, meta interfac
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Creating new HttpsHealthCheck: %#v", obj)
|
log.Printf("[DEBUG] Creating new HttpsHealthCheck: %#v", obj)
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutCreate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating HttpsHealthCheck: %s", err)
|
return fmt.Errorf("Error creating HttpsHealthCheck: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -329,7 +329,7 @@ func resourceComputeHttpsHealthCheckUpdate(d *schema.ResourceData, meta interfac
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Updating HttpsHealthCheck %q: %#v", d.Id(), obj)
|
log.Printf("[DEBUG] Updating HttpsHealthCheck %q: %#v", d.Id(), obj)
|
||||||
res, err := sendRequest(config, "PUT", url, obj)
|
res, err := sendRequestWithTimeout(config, "PUT", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating HttpsHealthCheck %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating HttpsHealthCheck %q: %s", d.Id(), err)
|
||||||
|
@ -366,7 +366,7 @@ func resourceComputeHttpsHealthCheckDelete(d *schema.ResourceData, meta interfac
|
||||||
|
|
||||||
var obj map[string]interface{}
|
var obj map[string]interface{}
|
||||||
log.Printf("[DEBUG] Deleting HttpsHealthCheck %q", d.Id())
|
log.Printf("[DEBUG] Deleting HttpsHealthCheck %q", d.Id())
|
||||||
res, err := sendRequest(config, "DELETE", url, obj)
|
res, err := sendRequestWithTimeout(config, "DELETE", url, obj, d.Timeout(schema.TimeoutDelete))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleNotFoundError(err, d, "HttpsHealthCheck")
|
return handleNotFoundError(err, d, "HttpsHealthCheck")
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,7 +155,7 @@ func resourceComputeInterconnectAttachmentCreate(d *schema.ResourceData, meta in
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Creating new InterconnectAttachment: %#v", obj)
|
log.Printf("[DEBUG] Creating new InterconnectAttachment: %#v", obj)
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutCreate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating InterconnectAttachment: %s", err)
|
return fmt.Errorf("Error creating InterconnectAttachment: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -260,7 +260,7 @@ func resourceComputeInterconnectAttachmentDelete(d *schema.ResourceData, meta in
|
||||||
|
|
||||||
var obj map[string]interface{}
|
var obj map[string]interface{}
|
||||||
log.Printf("[DEBUG] Deleting InterconnectAttachment %q", d.Id())
|
log.Printf("[DEBUG] Deleting InterconnectAttachment %q", d.Id())
|
||||||
res, err := sendRequest(config, "DELETE", url, obj)
|
res, err := sendRequestWithTimeout(config, "DELETE", url, obj, d.Timeout(schema.TimeoutDelete))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleNotFoundError(err, d, "InterconnectAttachment")
|
return handleNotFoundError(err, d, "InterconnectAttachment")
|
||||||
}
|
}
|
||||||
|
|
|
@ -194,7 +194,7 @@ func resourceComputeRegionAutoscalerCreate(d *schema.ResourceData, meta interfac
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Creating new RegionAutoscaler: %#v", obj)
|
log.Printf("[DEBUG] Creating new RegionAutoscaler: %#v", obj)
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutCreate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating RegionAutoscaler: %s", err)
|
return fmt.Errorf("Error creating RegionAutoscaler: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -318,7 +318,7 @@ func resourceComputeRegionAutoscalerUpdate(d *schema.ResourceData, meta interfac
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Updating RegionAutoscaler %q: %#v", d.Id(), obj)
|
log.Printf("[DEBUG] Updating RegionAutoscaler %q: %#v", d.Id(), obj)
|
||||||
res, err := sendRequest(config, "PUT", url, obj)
|
res, err := sendRequestWithTimeout(config, "PUT", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating RegionAutoscaler %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating RegionAutoscaler %q: %s", d.Id(), err)
|
||||||
|
@ -355,7 +355,7 @@ func resourceComputeRegionAutoscalerDelete(d *schema.ResourceData, meta interfac
|
||||||
|
|
||||||
var obj map[string]interface{}
|
var obj map[string]interface{}
|
||||||
log.Printf("[DEBUG] Deleting RegionAutoscaler %q", d.Id())
|
log.Printf("[DEBUG] Deleting RegionAutoscaler %q", d.Id())
|
||||||
res, err := sendRequest(config, "DELETE", url, obj)
|
res, err := sendRequestWithTimeout(config, "DELETE", url, obj, d.Timeout(schema.TimeoutDelete))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleNotFoundError(err, d, "RegionAutoscaler")
|
return handleNotFoundError(err, d, "RegionAutoscaler")
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,7 @@ func resourceComputeRegionDisk() *schema.Resource {
|
||||||
Update: schema.DefaultTimeout(240 * time.Second),
|
Update: schema.DefaultTimeout(240 * time.Second),
|
||||||
Delete: schema.DefaultTimeout(240 * time.Second),
|
Delete: schema.DefaultTimeout(240 * time.Second),
|
||||||
},
|
},
|
||||||
|
|
||||||
CustomizeDiff: customdiff.All(
|
CustomizeDiff: customdiff.All(
|
||||||
customdiff.ForceNewIfChange("size", isDiskShrinkage)),
|
customdiff.ForceNewIfChange("size", isDiskShrinkage)),
|
||||||
|
|
||||||
|
@ -260,7 +261,7 @@ func resourceComputeRegionDiskCreate(d *schema.ResourceData, meta interface{}) e
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Creating new RegionDisk: %#v", obj)
|
log.Printf("[DEBUG] Creating new RegionDisk: %#v", obj)
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutCreate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating RegionDisk: %s", err)
|
return fmt.Errorf("Error creating RegionDisk: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -402,7 +403,7 @@ func resourceComputeRegionDiskUpdate(d *schema.ResourceData, meta interface{}) e
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating RegionDisk %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating RegionDisk %q: %s", d.Id(), err)
|
||||||
}
|
}
|
||||||
|
@ -441,7 +442,7 @@ func resourceComputeRegionDiskUpdate(d *schema.ResourceData, meta interface{}) e
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating RegionDisk %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating RegionDisk %q: %s", d.Id(), err)
|
||||||
}
|
}
|
||||||
|
@ -531,7 +532,7 @@ func resourceComputeRegionDiskDelete(d *schema.ResourceData, meta interface{}) e
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log.Printf("[DEBUG] Deleting RegionDisk %q", d.Id())
|
log.Printf("[DEBUG] Deleting RegionDisk %q", d.Id())
|
||||||
res, err := sendRequest(config, "DELETE", url, obj)
|
res, err := sendRequestWithTimeout(config, "DELETE", url, obj, d.Timeout(schema.TimeoutDelete))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleNotFoundError(err, d, "RegionDisk")
|
return handleNotFoundError(err, d, "RegionDisk")
|
||||||
}
|
}
|
||||||
|
|
|
@ -194,7 +194,7 @@ func resourceComputeRouteCreate(d *schema.ResourceData, meta interface{}) error
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Creating new Route: %#v", obj)
|
log.Printf("[DEBUG] Creating new Route: %#v", obj)
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutCreate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating Route: %s", err)
|
return fmt.Errorf("Error creating Route: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -307,7 +307,7 @@ func resourceComputeRouteDelete(d *schema.ResourceData, meta interface{}) error
|
||||||
|
|
||||||
var obj map[string]interface{}
|
var obj map[string]interface{}
|
||||||
log.Printf("[DEBUG] Deleting Route %q", d.Id())
|
log.Printf("[DEBUG] Deleting Route %q", d.Id())
|
||||||
res, err := sendRequest(config, "DELETE", url, obj)
|
res, err := sendRequestWithTimeout(config, "DELETE", url, obj, d.Timeout(schema.TimeoutDelete))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleNotFoundError(err, d, "Route")
|
return handleNotFoundError(err, d, "Route")
|
||||||
}
|
}
|
||||||
|
|
|
@ -175,7 +175,7 @@ func resourceComputeRouterCreate(d *schema.ResourceData, meta interface{}) error
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Creating new Router: %#v", obj)
|
log.Printf("[DEBUG] Creating new Router: %#v", obj)
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutCreate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating Router: %s", err)
|
return fmt.Errorf("Error creating Router: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -288,7 +288,7 @@ func resourceComputeRouterUpdate(d *schema.ResourceData, meta interface{}) error
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Updating Router %q: %#v", d.Id(), obj)
|
log.Printf("[DEBUG] Updating Router %q: %#v", d.Id(), obj)
|
||||||
res, err := sendRequest(config, "PATCH", url, obj)
|
res, err := sendRequestWithTimeout(config, "PATCH", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating Router %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating Router %q: %s", d.Id(), err)
|
||||||
|
@ -332,7 +332,7 @@ func resourceComputeRouterDelete(d *schema.ResourceData, meta interface{}) error
|
||||||
|
|
||||||
var obj map[string]interface{}
|
var obj map[string]interface{}
|
||||||
log.Printf("[DEBUG] Deleting Router %q", d.Id())
|
log.Printf("[DEBUG] Deleting Router %q", d.Id())
|
||||||
res, err := sendRequest(config, "DELETE", url, obj)
|
res, err := sendRequestWithTimeout(config, "DELETE", url, obj, d.Timeout(schema.TimeoutDelete))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleNotFoundError(err, d, "Router")
|
return handleNotFoundError(err, d, "Router")
|
||||||
}
|
}
|
||||||
|
|
|
@ -176,6 +176,7 @@ func resourceComputeSnapshot() *schema.Resource {
|
||||||
Update: schema.DefaultTimeout(300 * time.Second),
|
Update: schema.DefaultTimeout(300 * time.Second),
|
||||||
Delete: schema.DefaultTimeout(300 * time.Second),
|
Delete: schema.DefaultTimeout(300 * time.Second),
|
||||||
},
|
},
|
||||||
|
|
||||||
CustomizeDiff: customdiff.All(
|
CustomizeDiff: customdiff.All(
|
||||||
customDiffComputeSnapshotSnapshotEncryptionKeys,
|
customDiffComputeSnapshotSnapshotEncryptionKeys,
|
||||||
customDiffComputeSnapshotSourceDiskEncryptionKeys,
|
customDiffComputeSnapshotSourceDiskEncryptionKeys,
|
||||||
|
@ -374,7 +375,7 @@ func resourceComputeSnapshotCreate(d *schema.ResourceData, meta interface{}) err
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Creating new Snapshot: %#v", obj)
|
log.Printf("[DEBUG] Creating new Snapshot: %#v", obj)
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutCreate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating Snapshot: %s", err)
|
return fmt.Errorf("Error creating Snapshot: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -501,7 +502,7 @@ func resourceComputeSnapshotUpdate(d *schema.ResourceData, meta interface{}) err
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating Snapshot %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating Snapshot %q: %s", d.Id(), err)
|
||||||
}
|
}
|
||||||
|
@ -543,7 +544,7 @@ func resourceComputeSnapshotDelete(d *schema.ResourceData, meta interface{}) err
|
||||||
|
|
||||||
var obj map[string]interface{}
|
var obj map[string]interface{}
|
||||||
log.Printf("[DEBUG] Deleting Snapshot %q", d.Id())
|
log.Printf("[DEBUG] Deleting Snapshot %q", d.Id())
|
||||||
res, err := sendRequest(config, "DELETE", url, obj)
|
res, err := sendRequestWithTimeout(config, "DELETE", url, obj, d.Timeout(schema.TimeoutDelete))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleNotFoundError(err, d, "Snapshot")
|
return handleNotFoundError(err, d, "Snapshot")
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,7 +140,7 @@ func resourceComputeSslCertificateCreate(d *schema.ResourceData, meta interface{
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Creating new SslCertificate: %#v", obj)
|
log.Printf("[DEBUG] Creating new SslCertificate: %#v", obj)
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutCreate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating SslCertificate: %s", err)
|
return fmt.Errorf("Error creating SslCertificate: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -230,7 +230,7 @@ func resourceComputeSslCertificateDelete(d *schema.ResourceData, meta interface{
|
||||||
|
|
||||||
var obj map[string]interface{}
|
var obj map[string]interface{}
|
||||||
log.Printf("[DEBUG] Deleting SslCertificate %q", d.Id())
|
log.Printf("[DEBUG] Deleting SslCertificate %q", d.Id())
|
||||||
res, err := sendRequest(config, "DELETE", url, obj)
|
res, err := sendRequestWithTimeout(config, "DELETE", url, obj, d.Timeout(schema.TimeoutDelete))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleNotFoundError(err, d, "SslCertificate")
|
return handleNotFoundError(err, d, "SslCertificate")
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,6 +62,7 @@ func resourceComputeSslPolicy() *schema.Resource {
|
||||||
Update: schema.DefaultTimeout(240 * time.Second),
|
Update: schema.DefaultTimeout(240 * time.Second),
|
||||||
Delete: schema.DefaultTimeout(240 * time.Second),
|
Delete: schema.DefaultTimeout(240 * time.Second),
|
||||||
},
|
},
|
||||||
|
|
||||||
CustomizeDiff: sslPolicyCustomizeDiff,
|
CustomizeDiff: sslPolicyCustomizeDiff,
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
|
@ -166,7 +167,7 @@ func resourceComputeSslPolicyCreate(d *schema.ResourceData, meta interface{}) er
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Creating new SslPolicy: %#v", obj)
|
log.Printf("[DEBUG] Creating new SslPolicy: %#v", obj)
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutCreate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating SslPolicy: %s", err)
|
return fmt.Errorf("Error creating SslPolicy: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -286,7 +287,7 @@ func resourceComputeSslPolicyUpdate(d *schema.ResourceData, meta interface{}) er
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Updating SslPolicy %q: %#v", d.Id(), obj)
|
log.Printf("[DEBUG] Updating SslPolicy %q: %#v", d.Id(), obj)
|
||||||
res, err := sendRequest(config, "PATCH", url, obj)
|
res, err := sendRequestWithTimeout(config, "PATCH", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating SslPolicy %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating SslPolicy %q: %s", d.Id(), err)
|
||||||
|
@ -323,7 +324,7 @@ func resourceComputeSslPolicyDelete(d *schema.ResourceData, meta interface{}) er
|
||||||
|
|
||||||
var obj map[string]interface{}
|
var obj map[string]interface{}
|
||||||
log.Printf("[DEBUG] Deleting SslPolicy %q", d.Id())
|
log.Printf("[DEBUG] Deleting SslPolicy %q", d.Id())
|
||||||
res, err := sendRequest(config, "DELETE", url, obj)
|
res, err := sendRequestWithTimeout(config, "DELETE", url, obj, d.Timeout(schema.TimeoutDelete))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleNotFoundError(err, d, "SslPolicy")
|
return handleNotFoundError(err, d, "SslPolicy")
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,6 +71,7 @@ func resourceComputeSubnetwork() *schema.Resource {
|
||||||
Update: schema.DefaultTimeout(360 * time.Second),
|
Update: schema.DefaultTimeout(360 * time.Second),
|
||||||
Delete: schema.DefaultTimeout(360 * time.Second),
|
Delete: schema.DefaultTimeout(360 * time.Second),
|
||||||
},
|
},
|
||||||
|
|
||||||
CustomizeDiff: customdiff.All(
|
CustomizeDiff: customdiff.All(
|
||||||
customdiff.ForceNewIfChange("ip_cidr_range", isShrinkageIpCidr),
|
customdiff.ForceNewIfChange("ip_cidr_range", isShrinkageIpCidr),
|
||||||
resourceComputeSubnetworkSecondaryIpRangeSetStyleDiff,
|
resourceComputeSubnetworkSecondaryIpRangeSetStyleDiff,
|
||||||
|
@ -265,7 +266,7 @@ func resourceComputeSubnetworkCreate(d *schema.ResourceData, meta interface{}) e
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Creating new Subnetwork: %#v", obj)
|
log.Printf("[DEBUG] Creating new Subnetwork: %#v", obj)
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutCreate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating Subnetwork: %s", err)
|
return fmt.Errorf("Error creating Subnetwork: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -381,7 +382,7 @@ func resourceComputeSubnetworkUpdate(d *schema.ResourceData, meta interface{}) e
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating Subnetwork %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating Subnetwork %q: %s", d.Id(), err)
|
||||||
}
|
}
|
||||||
|
@ -431,7 +432,7 @@ func resourceComputeSubnetworkUpdate(d *schema.ResourceData, meta interface{}) e
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
res, err := sendRequest(config, "PATCH", url, obj)
|
res, err := sendRequestWithTimeout(config, "PATCH", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating Subnetwork %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating Subnetwork %q: %s", d.Id(), err)
|
||||||
}
|
}
|
||||||
|
@ -471,7 +472,7 @@ func resourceComputeSubnetworkUpdate(d *schema.ResourceData, meta interface{}) e
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating Subnetwork %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating Subnetwork %q: %s", d.Id(), err)
|
||||||
}
|
}
|
||||||
|
@ -512,7 +513,7 @@ func resourceComputeSubnetworkDelete(d *schema.ResourceData, meta interface{}) e
|
||||||
|
|
||||||
var obj map[string]interface{}
|
var obj map[string]interface{}
|
||||||
log.Printf("[DEBUG] Deleting Subnetwork %q", d.Id())
|
log.Printf("[DEBUG] Deleting Subnetwork %q", d.Id())
|
||||||
res, err := sendRequest(config, "DELETE", url, obj)
|
res, err := sendRequestWithTimeout(config, "DELETE", url, obj, d.Timeout(schema.TimeoutDelete))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleNotFoundError(err, d, "Subnetwork")
|
return handleNotFoundError(err, d, "Subnetwork")
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,7 +109,7 @@ func resourceComputeTargetHttpProxyCreate(d *schema.ResourceData, meta interface
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Creating new TargetHttpProxy: %#v", obj)
|
log.Printf("[DEBUG] Creating new TargetHttpProxy: %#v", obj)
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutCreate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating TargetHttpProxy: %s", err)
|
return fmt.Errorf("Error creating TargetHttpProxy: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -207,7 +207,7 @@ func resourceComputeTargetHttpProxyUpdate(d *schema.ResourceData, meta interface
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating TargetHttpProxy %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating TargetHttpProxy %q: %s", d.Id(), err)
|
||||||
}
|
}
|
||||||
|
@ -248,7 +248,7 @@ func resourceComputeTargetHttpProxyDelete(d *schema.ResourceData, meta interface
|
||||||
|
|
||||||
var obj map[string]interface{}
|
var obj map[string]interface{}
|
||||||
log.Printf("[DEBUG] Deleting TargetHttpProxy %q", d.Id())
|
log.Printf("[DEBUG] Deleting TargetHttpProxy %q", d.Id())
|
||||||
res, err := sendRequest(config, "DELETE", url, obj)
|
res, err := sendRequestWithTimeout(config, "DELETE", url, obj, d.Timeout(schema.TimeoutDelete))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleNotFoundError(err, d, "TargetHttpProxy")
|
return handleNotFoundError(err, d, "TargetHttpProxy")
|
||||||
}
|
}
|
||||||
|
|
|
@ -146,7 +146,7 @@ func resourceComputeTargetHttpsProxyCreate(d *schema.ResourceData, meta interfac
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Creating new TargetHttpsProxy: %#v", obj)
|
log.Printf("[DEBUG] Creating new TargetHttpsProxy: %#v", obj)
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutCreate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating TargetHttpsProxy: %s", err)
|
return fmt.Errorf("Error creating TargetHttpsProxy: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -253,7 +253,7 @@ func resourceComputeTargetHttpsProxyUpdate(d *schema.ResourceData, meta interfac
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating TargetHttpsProxy %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating TargetHttpsProxy %q: %s", d.Id(), err)
|
||||||
}
|
}
|
||||||
|
@ -291,7 +291,7 @@ func resourceComputeTargetHttpsProxyUpdate(d *schema.ResourceData, meta interfac
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating TargetHttpsProxy %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating TargetHttpsProxy %q: %s", d.Id(), err)
|
||||||
}
|
}
|
||||||
|
@ -329,7 +329,7 @@ func resourceComputeTargetHttpsProxyUpdate(d *schema.ResourceData, meta interfac
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating TargetHttpsProxy %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating TargetHttpsProxy %q: %s", d.Id(), err)
|
||||||
}
|
}
|
||||||
|
@ -367,7 +367,7 @@ func resourceComputeTargetHttpsProxyUpdate(d *schema.ResourceData, meta interfac
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating TargetHttpsProxy %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating TargetHttpsProxy %q: %s", d.Id(), err)
|
||||||
}
|
}
|
||||||
|
@ -408,7 +408,7 @@ func resourceComputeTargetHttpsProxyDelete(d *schema.ResourceData, meta interfac
|
||||||
|
|
||||||
var obj map[string]interface{}
|
var obj map[string]interface{}
|
||||||
log.Printf("[DEBUG] Deleting TargetHttpsProxy %q", d.Id())
|
log.Printf("[DEBUG] Deleting TargetHttpsProxy %q", d.Id())
|
||||||
res, err := sendRequest(config, "DELETE", url, obj)
|
res, err := sendRequestWithTimeout(config, "DELETE", url, obj, d.Timeout(schema.TimeoutDelete))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleNotFoundError(err, d, "TargetHttpsProxy")
|
return handleNotFoundError(err, d, "TargetHttpsProxy")
|
||||||
}
|
}
|
||||||
|
|
|
@ -148,7 +148,7 @@ func resourceComputeTargetSslProxyCreate(d *schema.ResourceData, meta interface{
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Creating new TargetSslProxy: %#v", obj)
|
log.Printf("[DEBUG] Creating new TargetSslProxy: %#v", obj)
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutCreate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating TargetSslProxy: %s", err)
|
return fmt.Errorf("Error creating TargetSslProxy: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -255,7 +255,7 @@ func resourceComputeTargetSslProxyUpdate(d *schema.ResourceData, meta interface{
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating TargetSslProxy %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating TargetSslProxy %q: %s", d.Id(), err)
|
||||||
}
|
}
|
||||||
|
@ -293,7 +293,7 @@ func resourceComputeTargetSslProxyUpdate(d *schema.ResourceData, meta interface{
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating TargetSslProxy %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating TargetSslProxy %q: %s", d.Id(), err)
|
||||||
}
|
}
|
||||||
|
@ -331,7 +331,7 @@ func resourceComputeTargetSslProxyUpdate(d *schema.ResourceData, meta interface{
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating TargetSslProxy %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating TargetSslProxy %q: %s", d.Id(), err)
|
||||||
}
|
}
|
||||||
|
@ -369,7 +369,7 @@ func resourceComputeTargetSslProxyUpdate(d *schema.ResourceData, meta interface{
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating TargetSslProxy %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating TargetSslProxy %q: %s", d.Id(), err)
|
||||||
}
|
}
|
||||||
|
@ -410,7 +410,7 @@ func resourceComputeTargetSslProxyDelete(d *schema.ResourceData, meta interface{
|
||||||
|
|
||||||
var obj map[string]interface{}
|
var obj map[string]interface{}
|
||||||
log.Printf("[DEBUG] Deleting TargetSslProxy %q", d.Id())
|
log.Printf("[DEBUG] Deleting TargetSslProxy %q", d.Id())
|
||||||
res, err := sendRequest(config, "DELETE", url, obj)
|
res, err := sendRequestWithTimeout(config, "DELETE", url, obj, d.Timeout(schema.TimeoutDelete))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleNotFoundError(err, d, "TargetSslProxy")
|
return handleNotFoundError(err, d, "TargetSslProxy")
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,7 +122,7 @@ func resourceComputeTargetTcpProxyCreate(d *schema.ResourceData, meta interface{
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Creating new TargetTcpProxy: %#v", obj)
|
log.Printf("[DEBUG] Creating new TargetTcpProxy: %#v", obj)
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutCreate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating TargetTcpProxy: %s", err)
|
return fmt.Errorf("Error creating TargetTcpProxy: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -223,7 +223,7 @@ func resourceComputeTargetTcpProxyUpdate(d *schema.ResourceData, meta interface{
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating TargetTcpProxy %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating TargetTcpProxy %q: %s", d.Id(), err)
|
||||||
}
|
}
|
||||||
|
@ -261,7 +261,7 @@ func resourceComputeTargetTcpProxyUpdate(d *schema.ResourceData, meta interface{
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating TargetTcpProxy %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating TargetTcpProxy %q: %s", d.Id(), err)
|
||||||
}
|
}
|
||||||
|
@ -302,7 +302,7 @@ func resourceComputeTargetTcpProxyDelete(d *schema.ResourceData, meta interface{
|
||||||
|
|
||||||
var obj map[string]interface{}
|
var obj map[string]interface{}
|
||||||
log.Printf("[DEBUG] Deleting TargetTcpProxy %q", d.Id())
|
log.Printf("[DEBUG] Deleting TargetTcpProxy %q", d.Id())
|
||||||
res, err := sendRequest(config, "DELETE", url, obj)
|
res, err := sendRequestWithTimeout(config, "DELETE", url, obj, d.Timeout(schema.TimeoutDelete))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleNotFoundError(err, d, "TargetTcpProxy")
|
return handleNotFoundError(err, d, "TargetTcpProxy")
|
||||||
}
|
}
|
||||||
|
|
|
@ -228,7 +228,7 @@ func resourceComputeUrlMapCreate(d *schema.ResourceData, meta interface{}) error
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Creating new UrlMap: %#v", obj)
|
log.Printf("[DEBUG] Creating new UrlMap: %#v", obj)
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutCreate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating UrlMap: %s", err)
|
return fmt.Errorf("Error creating UrlMap: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -373,7 +373,7 @@ func resourceComputeUrlMapUpdate(d *schema.ResourceData, meta interface{}) error
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Updating UrlMap %q: %#v", d.Id(), obj)
|
log.Printf("[DEBUG] Updating UrlMap %q: %#v", d.Id(), obj)
|
||||||
res, err := sendRequest(config, "PUT", url, obj)
|
res, err := sendRequestWithTimeout(config, "PUT", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating UrlMap %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating UrlMap %q: %s", d.Id(), err)
|
||||||
|
@ -410,7 +410,7 @@ func resourceComputeUrlMapDelete(d *schema.ResourceData, meta interface{}) error
|
||||||
|
|
||||||
var obj map[string]interface{}
|
var obj map[string]interface{}
|
||||||
log.Printf("[DEBUG] Deleting UrlMap %q", d.Id())
|
log.Printf("[DEBUG] Deleting UrlMap %q", d.Id())
|
||||||
res, err := sendRequest(config, "DELETE", url, obj)
|
res, err := sendRequestWithTimeout(config, "DELETE", url, obj, d.Timeout(schema.TimeoutDelete))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleNotFoundError(err, d, "UrlMap")
|
return handleNotFoundError(err, d, "UrlMap")
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,7 +116,7 @@ func resourceComputeVpnGatewayCreate(d *schema.ResourceData, meta interface{}) e
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Creating new VpnGateway: %#v", obj)
|
log.Printf("[DEBUG] Creating new VpnGateway: %#v", obj)
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutCreate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating VpnGateway: %s", err)
|
return fmt.Errorf("Error creating VpnGateway: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -206,7 +206,7 @@ func resourceComputeVpnGatewayDelete(d *schema.ResourceData, meta interface{}) e
|
||||||
|
|
||||||
var obj map[string]interface{}
|
var obj map[string]interface{}
|
||||||
log.Printf("[DEBUG] Deleting VpnGateway %q", d.Id())
|
log.Printf("[DEBUG] Deleting VpnGateway %q", d.Id())
|
||||||
res, err := sendRequest(config, "DELETE", url, obj)
|
res, err := sendRequestWithTimeout(config, "DELETE", url, obj, d.Timeout(schema.TimeoutDelete))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleNotFoundError(err, d, "VpnGateway")
|
return handleNotFoundError(err, d, "VpnGateway")
|
||||||
}
|
}
|
||||||
|
|
|
@ -337,7 +337,7 @@ func resourceComputeVpnTunnelCreate(d *schema.ResourceData, meta interface{}) er
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Creating new VpnTunnel: %#v", obj)
|
log.Printf("[DEBUG] Creating new VpnTunnel: %#v", obj)
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutCreate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating VpnTunnel: %s", err)
|
return fmt.Errorf("Error creating VpnTunnel: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -468,7 +468,7 @@ func resourceComputeVpnTunnelUpdate(d *schema.ResourceData, meta interface{}) er
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating VpnTunnel %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating VpnTunnel %q: %s", d.Id(), err)
|
||||||
}
|
}
|
||||||
|
@ -510,7 +510,7 @@ func resourceComputeVpnTunnelDelete(d *schema.ResourceData, meta interface{}) er
|
||||||
|
|
||||||
var obj map[string]interface{}
|
var obj map[string]interface{}
|
||||||
log.Printf("[DEBUG] Deleting VpnTunnel %q", d.Id())
|
log.Printf("[DEBUG] Deleting VpnTunnel %q", d.Id())
|
||||||
res, err := sendRequest(config, "DELETE", url, obj)
|
res, err := sendRequestWithTimeout(config, "DELETE", url, obj, d.Timeout(schema.TimeoutDelete))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleNotFoundError(err, d, "VpnTunnel")
|
return handleNotFoundError(err, d, "VpnTunnel")
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/terraform/helper/schema"
|
"github.com/hashicorp/terraform/helper/schema"
|
||||||
)
|
)
|
||||||
|
@ -33,6 +34,12 @@ func resourceDnsManagedZone() *schema.Resource {
|
||||||
State: resourceDnsManagedZoneImport,
|
State: resourceDnsManagedZoneImport,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Timeouts: &schema.ResourceTimeout{
|
||||||
|
Create: schema.DefaultTimeout(240 * time.Second),
|
||||||
|
Update: schema.DefaultTimeout(240 * time.Second),
|
||||||
|
Delete: schema.DefaultTimeout(240 * time.Second),
|
||||||
|
},
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"dns_name": {
|
"dns_name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
|
@ -106,7 +113,7 @@ func resourceDnsManagedZoneCreate(d *schema.ResourceData, meta interface{}) erro
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Creating new ManagedZone: %#v", obj)
|
log.Printf("[DEBUG] Creating new ManagedZone: %#v", obj)
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutCreate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating ManagedZone: %s", err)
|
return fmt.Errorf("Error creating ManagedZone: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -187,7 +194,7 @@ func resourceDnsManagedZoneUpdate(d *schema.ResourceData, meta interface{}) erro
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
_, err = sendRequest(config, "PATCH", url, obj)
|
_, err = sendRequestWithTimeout(config, "PATCH", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating ManagedZone %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating ManagedZone %q: %s", d.Id(), err)
|
||||||
}
|
}
|
||||||
|
@ -211,7 +218,7 @@ func resourceDnsManagedZoneDelete(d *schema.ResourceData, meta interface{}) erro
|
||||||
|
|
||||||
var obj map[string]interface{}
|
var obj map[string]interface{}
|
||||||
log.Printf("[DEBUG] Deleting ManagedZone %q", d.Id())
|
log.Printf("[DEBUG] Deleting ManagedZone %q", d.Id())
|
||||||
res, err := sendRequest(config, "DELETE", url, obj)
|
res, err := sendRequestWithTimeout(config, "DELETE", url, obj, d.Timeout(schema.TimeoutDelete))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleNotFoundError(err, d, "ManagedZone")
|
return handleNotFoundError(err, d, "ManagedZone")
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"reflect"
|
"reflect"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/terraform/helper/schema"
|
"github.com/hashicorp/terraform/helper/schema"
|
||||||
"github.com/hashicorp/terraform/helper/validation"
|
"github.com/hashicorp/terraform/helper/validation"
|
||||||
|
@ -35,6 +36,12 @@ func resourceMonitoringAlertPolicy() *schema.Resource {
|
||||||
State: resourceMonitoringAlertPolicyImport,
|
State: resourceMonitoringAlertPolicyImport,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Timeouts: &schema.ResourceTimeout{
|
||||||
|
Create: schema.DefaultTimeout(240 * time.Second),
|
||||||
|
Update: schema.DefaultTimeout(240 * time.Second),
|
||||||
|
Delete: schema.DefaultTimeout(240 * time.Second),
|
||||||
|
},
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"combiner": {
|
"combiner": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
|
@ -357,7 +364,7 @@ func resourceMonitoringAlertPolicyCreate(d *schema.ResourceData, meta interface{
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Creating new AlertPolicy: %#v", obj)
|
log.Printf("[DEBUG] Creating new AlertPolicy: %#v", obj)
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutCreate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating AlertPolicy: %s", err)
|
return fmt.Errorf("Error creating AlertPolicy: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -494,7 +501,7 @@ func resourceMonitoringAlertPolicyUpdate(d *schema.ResourceData, meta interface{
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Updating AlertPolicy %q: %#v", d.Id(), obj)
|
log.Printf("[DEBUG] Updating AlertPolicy %q: %#v", d.Id(), obj)
|
||||||
_, err = sendRequest(config, "PATCH", url, obj)
|
_, err = sendRequestWithTimeout(config, "PATCH", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating AlertPolicy %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating AlertPolicy %q: %s", d.Id(), err)
|
||||||
|
@ -520,7 +527,7 @@ func resourceMonitoringAlertPolicyDelete(d *schema.ResourceData, meta interface{
|
||||||
|
|
||||||
var obj map[string]interface{}
|
var obj map[string]interface{}
|
||||||
log.Printf("[DEBUG] Deleting AlertPolicy %q", d.Id())
|
log.Printf("[DEBUG] Deleting AlertPolicy %q", d.Id())
|
||||||
res, err := sendRequest(config, "DELETE", url, obj)
|
res, err := sendRequestWithTimeout(config, "DELETE", url, obj, d.Timeout(schema.TimeoutDelete))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleNotFoundError(err, d, "AlertPolicy")
|
return handleNotFoundError(err, d, "AlertPolicy")
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/terraform/helper/schema"
|
"github.com/hashicorp/terraform/helper/schema"
|
||||||
)
|
)
|
||||||
|
@ -33,6 +34,12 @@ func resourceMonitoringGroup() *schema.Resource {
|
||||||
State: resourceMonitoringGroupImport,
|
State: resourceMonitoringGroupImport,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Timeouts: &schema.ResourceTimeout{
|
||||||
|
Create: schema.DefaultTimeout(240 * time.Second),
|
||||||
|
Update: schema.DefaultTimeout(240 * time.Second),
|
||||||
|
Delete: schema.DefaultTimeout(240 * time.Second),
|
||||||
|
},
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"display_name": {
|
"display_name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
|
@ -107,7 +114,7 @@ func resourceMonitoringGroupCreate(d *schema.ResourceData, meta interface{}) err
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Creating new Group: %#v", obj)
|
log.Printf("[DEBUG] Creating new Group: %#v", obj)
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutCreate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating Group: %s", err)
|
return fmt.Errorf("Error creating Group: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -214,7 +221,7 @@ func resourceMonitoringGroupUpdate(d *schema.ResourceData, meta interface{}) err
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Updating Group %q: %#v", d.Id(), obj)
|
log.Printf("[DEBUG] Updating Group %q: %#v", d.Id(), obj)
|
||||||
_, err = sendRequest(config, "PUT", url, obj)
|
_, err = sendRequestWithTimeout(config, "PUT", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating Group %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating Group %q: %s", d.Id(), err)
|
||||||
|
@ -240,7 +247,7 @@ func resourceMonitoringGroupDelete(d *schema.ResourceData, meta interface{}) err
|
||||||
|
|
||||||
var obj map[string]interface{}
|
var obj map[string]interface{}
|
||||||
log.Printf("[DEBUG] Deleting Group %q", d.Id())
|
log.Printf("[DEBUG] Deleting Group %q", d.Id())
|
||||||
res, err := sendRequest(config, "DELETE", url, obj)
|
res, err := sendRequestWithTimeout(config, "DELETE", url, obj, d.Timeout(schema.TimeoutDelete))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleNotFoundError(err, d, "Group")
|
return handleNotFoundError(err, d, "Group")
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/terraform/helper/schema"
|
"github.com/hashicorp/terraform/helper/schema"
|
||||||
)
|
)
|
||||||
|
@ -33,6 +34,12 @@ func resourceMonitoringNotificationChannel() *schema.Resource {
|
||||||
State: resourceMonitoringNotificationChannelImport,
|
State: resourceMonitoringNotificationChannelImport,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Timeouts: &schema.ResourceTimeout{
|
||||||
|
Create: schema.DefaultTimeout(240 * time.Second),
|
||||||
|
Update: schema.DefaultTimeout(240 * time.Second),
|
||||||
|
Delete: schema.DefaultTimeout(240 * time.Second),
|
||||||
|
},
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"display_name": {
|
"display_name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
|
@ -133,7 +140,7 @@ func resourceMonitoringNotificationChannelCreate(d *schema.ResourceData, meta in
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Creating new NotificationChannel: %#v", obj)
|
log.Printf("[DEBUG] Creating new NotificationChannel: %#v", obj)
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutCreate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating NotificationChannel: %s", err)
|
return fmt.Errorf("Error creating NotificationChannel: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -261,7 +268,7 @@ func resourceMonitoringNotificationChannelUpdate(d *schema.ResourceData, meta in
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Updating NotificationChannel %q: %#v", d.Id(), obj)
|
log.Printf("[DEBUG] Updating NotificationChannel %q: %#v", d.Id(), obj)
|
||||||
_, err = sendRequest(config, "PATCH", url, obj)
|
_, err = sendRequestWithTimeout(config, "PATCH", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating NotificationChannel %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating NotificationChannel %q: %s", d.Id(), err)
|
||||||
|
@ -287,7 +294,7 @@ func resourceMonitoringNotificationChannelDelete(d *schema.ResourceData, meta in
|
||||||
|
|
||||||
var obj map[string]interface{}
|
var obj map[string]interface{}
|
||||||
log.Printf("[DEBUG] Deleting NotificationChannel %q", d.Id())
|
log.Printf("[DEBUG] Deleting NotificationChannel %q", d.Id())
|
||||||
res, err := sendRequest(config, "DELETE", url, obj)
|
res, err := sendRequestWithTimeout(config, "DELETE", url, obj, d.Timeout(schema.TimeoutDelete))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleNotFoundError(err, d, "NotificationChannel")
|
return handleNotFoundError(err, d, "NotificationChannel")
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"reflect"
|
"reflect"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/terraform/helper/schema"
|
"github.com/hashicorp/terraform/helper/schema"
|
||||||
"github.com/hashicorp/terraform/helper/validation"
|
"github.com/hashicorp/terraform/helper/validation"
|
||||||
|
@ -35,6 +36,12 @@ func resourceMonitoringUptimeCheckConfig() *schema.Resource {
|
||||||
State: resourceMonitoringUptimeCheckConfigImport,
|
State: resourceMonitoringUptimeCheckConfigImport,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Timeouts: &schema.ResourceTimeout{
|
||||||
|
Create: schema.DefaultTimeout(240 * time.Second),
|
||||||
|
Update: schema.DefaultTimeout(240 * time.Second),
|
||||||
|
Delete: schema.DefaultTimeout(240 * time.Second),
|
||||||
|
},
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"display_name": {
|
"display_name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
|
@ -296,7 +303,7 @@ func resourceMonitoringUptimeCheckConfigCreate(d *schema.ResourceData, meta inte
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Creating new UptimeCheckConfig: %#v", obj)
|
log.Printf("[DEBUG] Creating new UptimeCheckConfig: %#v", obj)
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutCreate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating UptimeCheckConfig: %s", err)
|
return fmt.Errorf("Error creating UptimeCheckConfig: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -459,7 +466,7 @@ func resourceMonitoringUptimeCheckConfigUpdate(d *schema.ResourceData, meta inte
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Updating UptimeCheckConfig %q: %#v", d.Id(), obj)
|
log.Printf("[DEBUG] Updating UptimeCheckConfig %q: %#v", d.Id(), obj)
|
||||||
_, err = sendRequest(config, "PATCH", url, obj)
|
_, err = sendRequestWithTimeout(config, "PATCH", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating UptimeCheckConfig %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating UptimeCheckConfig %q: %s", d.Id(), err)
|
||||||
|
@ -478,7 +485,7 @@ func resourceMonitoringUptimeCheckConfigDelete(d *schema.ResourceData, meta inte
|
||||||
|
|
||||||
var obj map[string]interface{}
|
var obj map[string]interface{}
|
||||||
log.Printf("[DEBUG] Deleting UptimeCheckConfig %q", d.Id())
|
log.Printf("[DEBUG] Deleting UptimeCheckConfig %q", d.Id())
|
||||||
res, err := sendRequest(config, "DELETE", url, obj)
|
res, err := sendRequestWithTimeout(config, "DELETE", url, obj, d.Timeout(schema.TimeoutDelete))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleNotFoundError(err, d, "UptimeCheckConfig")
|
return handleNotFoundError(err, d, "UptimeCheckConfig")
|
||||||
}
|
}
|
||||||
|
|
|
@ -215,7 +215,7 @@ func resourceRedisInstanceCreate(d *schema.ResourceData, meta interface{}) error
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Creating new Instance: %#v", obj)
|
log.Printf("[DEBUG] Creating new Instance: %#v", obj)
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutCreate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating Instance: %s", err)
|
return fmt.Errorf("Error creating Instance: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -376,7 +376,7 @@ func resourceRedisInstanceUpdate(d *schema.ResourceData, meta interface{}) error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
res, err := sendRequest(config, "PATCH", url, obj)
|
res, err := sendRequestWithTimeout(config, "PATCH", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating Instance %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating Instance %q: %s", d.Id(), err)
|
||||||
|
@ -413,7 +413,7 @@ func resourceRedisInstanceDelete(d *schema.ResourceData, meta interface{}) error
|
||||||
|
|
||||||
var obj map[string]interface{}
|
var obj map[string]interface{}
|
||||||
log.Printf("[DEBUG] Deleting Instance %q", d.Id())
|
log.Printf("[DEBUG] Deleting Instance %q", d.Id())
|
||||||
res, err := sendRequest(config, "DELETE", url, obj)
|
res, err := sendRequestWithTimeout(config, "DELETE", url, obj, d.Timeout(schema.TimeoutDelete))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleNotFoundError(err, d, "Instance")
|
return handleNotFoundError(err, d, "Instance")
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@ import (
|
||||||
"reflect"
|
"reflect"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/terraform/helper/schema"
|
"github.com/hashicorp/terraform/helper/schema"
|
||||||
)
|
)
|
||||||
|
@ -34,6 +35,11 @@ func resourceResourceManagerLien() *schema.Resource {
|
||||||
State: resourceResourceManagerLienImport,
|
State: resourceResourceManagerLienImport,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Timeouts: &schema.ResourceTimeout{
|
||||||
|
Create: schema.DefaultTimeout(240 * time.Second),
|
||||||
|
Delete: schema.DefaultTimeout(240 * time.Second),
|
||||||
|
},
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"origin": {
|
"origin": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
|
@ -105,7 +111,7 @@ func resourceResourceManagerLienCreate(d *schema.ResourceData, meta interface{})
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Creating new Lien: %#v", obj)
|
log.Printf("[DEBUG] Creating new Lien: %#v", obj)
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutCreate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating Lien: %s", err)
|
return fmt.Errorf("Error creating Lien: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -213,7 +219,7 @@ func resourceResourceManagerLienDelete(d *schema.ResourceData, meta interface{})
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
log.Printf("[DEBUG] Deleting Lien %q", d.Id())
|
log.Printf("[DEBUG] Deleting Lien %q", d.Id())
|
||||||
res, err := sendRequest(config, "DELETE", url, obj)
|
res, err := sendRequestWithTimeout(config, "DELETE", url, obj, d.Timeout(schema.TimeoutDelete))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleNotFoundError(err, d, "Lien")
|
return handleNotFoundError(err, d, "Lien")
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"reflect"
|
"reflect"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/terraform/helper/schema"
|
"github.com/hashicorp/terraform/helper/schema"
|
||||||
"github.com/hashicorp/terraform/helper/validation"
|
"github.com/hashicorp/terraform/helper/validation"
|
||||||
|
@ -35,6 +36,12 @@ func resourceStorageDefaultObjectAccessControl() *schema.Resource {
|
||||||
State: resourceStorageDefaultObjectAccessControlImport,
|
State: resourceStorageDefaultObjectAccessControlImport,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Timeouts: &schema.ResourceTimeout{
|
||||||
|
Create: schema.DefaultTimeout(240 * time.Second),
|
||||||
|
Update: schema.DefaultTimeout(240 * time.Second),
|
||||||
|
Delete: schema.DefaultTimeout(240 * time.Second),
|
||||||
|
},
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"bucket": {
|
"bucket": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
|
@ -127,7 +134,7 @@ func resourceStorageDefaultObjectAccessControlCreate(d *schema.ResourceData, met
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Creating new DefaultObjectAccessControl: %#v", obj)
|
log.Printf("[DEBUG] Creating new DefaultObjectAccessControl: %#v", obj)
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutCreate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating DefaultObjectAccessControl: %s", err)
|
return fmt.Errorf("Error creating DefaultObjectAccessControl: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -220,7 +227,7 @@ func resourceStorageDefaultObjectAccessControlUpdate(d *schema.ResourceData, met
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Updating DefaultObjectAccessControl %q: %#v", d.Id(), obj)
|
log.Printf("[DEBUG] Updating DefaultObjectAccessControl %q: %#v", d.Id(), obj)
|
||||||
_, err = sendRequest(config, "PUT", url, obj)
|
_, err = sendRequestWithTimeout(config, "PUT", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating DefaultObjectAccessControl %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating DefaultObjectAccessControl %q: %s", d.Id(), err)
|
||||||
|
@ -239,7 +246,7 @@ func resourceStorageDefaultObjectAccessControlDelete(d *schema.ResourceData, met
|
||||||
|
|
||||||
var obj map[string]interface{}
|
var obj map[string]interface{}
|
||||||
log.Printf("[DEBUG] Deleting DefaultObjectAccessControl %q", d.Id())
|
log.Printf("[DEBUG] Deleting DefaultObjectAccessControl %q", d.Id())
|
||||||
res, err := sendRequest(config, "DELETE", url, obj)
|
res, err := sendRequestWithTimeout(config, "DELETE", url, obj, d.Timeout(schema.TimeoutDelete))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleNotFoundError(err, d, "DefaultObjectAccessControl")
|
return handleNotFoundError(err, d, "DefaultObjectAccessControl")
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"reflect"
|
"reflect"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/terraform/helper/schema"
|
"github.com/hashicorp/terraform/helper/schema"
|
||||||
"github.com/hashicorp/terraform/helper/validation"
|
"github.com/hashicorp/terraform/helper/validation"
|
||||||
|
@ -35,6 +36,12 @@ func resourceStorageObjectAccessControl() *schema.Resource {
|
||||||
State: resourceStorageObjectAccessControlImport,
|
State: resourceStorageObjectAccessControlImport,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Timeouts: &schema.ResourceTimeout{
|
||||||
|
Create: schema.DefaultTimeout(240 * time.Second),
|
||||||
|
Update: schema.DefaultTimeout(240 * time.Second),
|
||||||
|
Delete: schema.DefaultTimeout(240 * time.Second),
|
||||||
|
},
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"bucket": {
|
"bucket": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
|
@ -127,7 +134,7 @@ func resourceStorageObjectAccessControlCreate(d *schema.ResourceData, meta inter
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Creating new ObjectAccessControl: %#v", obj)
|
log.Printf("[DEBUG] Creating new ObjectAccessControl: %#v", obj)
|
||||||
res, err := sendRequest(config, "POST", url, obj)
|
res, err := sendRequestWithTimeout(config, "POST", url, obj, d.Timeout(schema.TimeoutCreate))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error creating ObjectAccessControl: %s", err)
|
return fmt.Errorf("Error creating ObjectAccessControl: %s", err)
|
||||||
}
|
}
|
||||||
|
@ -223,7 +230,7 @@ func resourceStorageObjectAccessControlUpdate(d *schema.ResourceData, meta inter
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Updating ObjectAccessControl %q: %#v", d.Id(), obj)
|
log.Printf("[DEBUG] Updating ObjectAccessControl %q: %#v", d.Id(), obj)
|
||||||
_, err = sendRequest(config, "PUT", url, obj)
|
_, err = sendRequestWithTimeout(config, "PUT", url, obj, d.Timeout(schema.TimeoutUpdate))
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error updating ObjectAccessControl %q: %s", d.Id(), err)
|
return fmt.Errorf("Error updating ObjectAccessControl %q: %s", d.Id(), err)
|
||||||
|
@ -242,7 +249,7 @@ func resourceStorageObjectAccessControlDelete(d *schema.ResourceData, meta inter
|
||||||
|
|
||||||
var obj map[string]interface{}
|
var obj map[string]interface{}
|
||||||
log.Printf("[DEBUG] Deleting ObjectAccessControl %q", d.Id())
|
log.Printf("[DEBUG] Deleting ObjectAccessControl %q", d.Id())
|
||||||
res, err := sendRequest(config, "DELETE", url, obj)
|
res, err := sendRequestWithTimeout(config, "DELETE", url, obj, d.Timeout(schema.TimeoutDelete))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleNotFoundError(err, d, "ObjectAccessControl")
|
return handleNotFoundError(err, d, "ObjectAccessControl")
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,10 @@ func isEmptyValue(v reflect.Value) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func sendRequest(config *Config, method, rawurl string, body map[string]interface{}) (map[string]interface{}, error) {
|
func sendRequest(config *Config, method, rawurl string, body map[string]interface{}) (map[string]interface{}, error) {
|
||||||
|
return sendRequestWithTimeout(config, method, rawurl, body, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
func sendRequestWithTimeout(config *Config, method, rawurl string, body map[string]interface{}, timeout time.Duration) (map[string]interface{}, error) {
|
||||||
reqHeaders := make(http.Header)
|
reqHeaders := make(http.Header)
|
||||||
reqHeaders.Set("User-Agent", config.userAgent)
|
reqHeaders.Set("User-Agent", config.userAgent)
|
||||||
reqHeaders.Set("Content-Type", "application/json")
|
reqHeaders.Set("Content-Type", "application/json")
|
||||||
|
@ -70,8 +74,7 @@ func sendRequest(config *Config, method, rawurl string, body map[string]interfac
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
// TODO chrisst - use the timeouts specified at the resource level so that a user can override this.
|
timeout,
|
||||||
time.Duration(5)*time.Minute,
|
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -80,6 +83,7 @@ func sendRequest(config *Config, method, rawurl string, body map[string]interfac
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, fmt.Errorf("Unable to parse server response. This is most likely a terraform problem, please file a bug at https://github.com/terraform-providers/terraform-provider-google/issues.")
|
return nil, fmt.Errorf("Unable to parse server response. This is most likely a terraform problem, please file a bug at https://github.com/terraform-providers/terraform-provider-google/issues.")
|
||||||
}
|
}
|
||||||
|
|
||||||
// The defer call must be made outside of the retryFunc otherwise it's closed too soon.
|
// The defer call must be made outside of the retryFunc otherwise it's closed too soon.
|
||||||
defer googleapi.CloseBody(res)
|
defer googleapi.CloseBody(res)
|
||||||
|
|
||||||
|
|
|
@ -95,6 +95,14 @@ In addition to the arguments listed above, the following computed attributes are
|
||||||
defined by the server
|
defined by the server
|
||||||
|
|
||||||
|
|
||||||
|
## Timeouts
|
||||||
|
|
||||||
|
This resource provides the following
|
||||||
|
[Timeouts](/docs/configuration/resources.html#timeouts) configuration options:
|
||||||
|
|
||||||
|
- `create` - Default is 4 minutes.
|
||||||
|
- `update` - Default is 4 minutes.
|
||||||
|
- `delete` - Default is 4 minutes.
|
||||||
|
|
||||||
## Import
|
## Import
|
||||||
|
|
||||||
|
|
|
@ -634,6 +634,14 @@ The `creation_record` block contains:
|
||||||
* `mutated_by` -
|
* `mutated_by` -
|
||||||
The email address of the user making the change.
|
The email address of the user making the change.
|
||||||
|
|
||||||
|
## Timeouts
|
||||||
|
|
||||||
|
This resource provides the following
|
||||||
|
[Timeouts](/docs/configuration/resources.html#timeouts) configuration options:
|
||||||
|
|
||||||
|
- `create` - Default is 4 minutes.
|
||||||
|
- `update` - Default is 4 minutes.
|
||||||
|
- `delete` - Default is 4 minutes.
|
||||||
|
|
||||||
## Import
|
## Import
|
||||||
|
|
||||||
|
|
|
@ -113,6 +113,14 @@ In addition to the arguments listed above, the following computed attributes are
|
||||||
"projects/{project_id_or_number}/groups/{group_id}".
|
"projects/{project_id_or_number}/groups/{group_id}".
|
||||||
|
|
||||||
|
|
||||||
|
## Timeouts
|
||||||
|
|
||||||
|
This resource provides the following
|
||||||
|
[Timeouts](/docs/configuration/resources.html#timeouts) configuration options:
|
||||||
|
|
||||||
|
- `create` - Default is 4 minutes.
|
||||||
|
- `update` - Default is 4 minutes.
|
||||||
|
- `delete` - Default is 4 minutes.
|
||||||
|
|
||||||
## Import
|
## Import
|
||||||
|
|
||||||
|
|
|
@ -102,6 +102,14 @@ In addition to the arguments listed above, the following computed attributes are
|
||||||
Indicates whether this channel has been verified or not. On a ListNotificationChannels or GetNotificationChannel operation, this field is expected to be populated.If the value is UNVERIFIED, then it indicates that the channel is non-functioning (it both requires verification and lacks verification); otherwise, it is assumed that the channel works.If the channel is neither VERIFIED nor UNVERIFIED, it implies that the channel is of a type that does not require verification or that this specific channel has been exempted from verification because it was created prior to verification being required for channels of this type.This field cannot be modified using a standard UpdateNotificationChannel operation. To change the value of this field, you must call VerifyNotificationChannel.
|
Indicates whether this channel has been verified or not. On a ListNotificationChannels or GetNotificationChannel operation, this field is expected to be populated.If the value is UNVERIFIED, then it indicates that the channel is non-functioning (it both requires verification and lacks verification); otherwise, it is assumed that the channel works.If the channel is neither VERIFIED nor UNVERIFIED, it implies that the channel is of a type that does not require verification or that this specific channel has been exempted from verification because it was created prior to verification being required for channels of this type.This field cannot be modified using a standard UpdateNotificationChannel operation. To change the value of this field, you must call VerifyNotificationChannel.
|
||||||
|
|
||||||
|
|
||||||
|
## Timeouts
|
||||||
|
|
||||||
|
This resource provides the following
|
||||||
|
[Timeouts](/docs/configuration/resources.html#timeouts) configuration options:
|
||||||
|
|
||||||
|
- `create` - Default is 4 minutes.
|
||||||
|
- `update` - Default is 4 minutes.
|
||||||
|
- `delete` - Default is 4 minutes.
|
||||||
|
|
||||||
## Import
|
## Import
|
||||||
|
|
||||||
|
|
|
@ -247,6 +247,14 @@ In addition to the arguments listed above, the following computed attributes are
|
||||||
A unique resource name for this UptimeCheckConfig. The format is projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID].
|
A unique resource name for this UptimeCheckConfig. The format is projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID].
|
||||||
|
|
||||||
|
|
||||||
|
## Timeouts
|
||||||
|
|
||||||
|
This resource provides the following
|
||||||
|
[Timeouts](/docs/configuration/resources.html#timeouts) configuration options:
|
||||||
|
|
||||||
|
- `create` - Default is 4 minutes.
|
||||||
|
- `update` - Default is 4 minutes.
|
||||||
|
- `delete` - Default is 4 minutes.
|
||||||
|
|
||||||
## Import
|
## Import
|
||||||
|
|
||||||
|
|
|
@ -90,6 +90,13 @@ In addition to the arguments listed above, the following computed attributes are
|
||||||
Time of creation
|
Time of creation
|
||||||
|
|
||||||
|
|
||||||
|
## Timeouts
|
||||||
|
|
||||||
|
This resource provides the following
|
||||||
|
[Timeouts](/docs/configuration/resources.html#timeouts) configuration options:
|
||||||
|
|
||||||
|
- `create` - Default is 4 minutes.
|
||||||
|
- `delete` - Default is 4 minutes.
|
||||||
|
|
||||||
## Import
|
## Import
|
||||||
|
|
||||||
|
|
|
@ -129,6 +129,14 @@ The `project_team` block contains:
|
||||||
(Optional)
|
(Optional)
|
||||||
The team.
|
The team.
|
||||||
|
|
||||||
|
## Timeouts
|
||||||
|
|
||||||
|
This resource provides the following
|
||||||
|
[Timeouts](/docs/configuration/resources.html#timeouts) configuration options:
|
||||||
|
|
||||||
|
- `create` - Default is 4 minutes.
|
||||||
|
- `update` - Default is 4 minutes.
|
||||||
|
- `delete` - Default is 4 minutes.
|
||||||
|
|
||||||
## Import
|
## Import
|
||||||
|
|
||||||
|
|
|
@ -134,6 +134,14 @@ The `project_team` block contains:
|
||||||
(Optional)
|
(Optional)
|
||||||
The team.
|
The team.
|
||||||
|
|
||||||
|
## Timeouts
|
||||||
|
|
||||||
|
This resource provides the following
|
||||||
|
[Timeouts](/docs/configuration/resources.html#timeouts) configuration options:
|
||||||
|
|
||||||
|
- `create` - Default is 4 minutes.
|
||||||
|
- `update` - Default is 4 minutes.
|
||||||
|
- `delete` - Default is 4 minutes.
|
||||||
|
|
||||||
## Import
|
## Import
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user