Using the timeout schema helper to make alb timeout cofigurable
This commit is contained in:
parent
1b2055dfa5
commit
dc2835d84f
|
@ -24,6 +24,12 @@ func resourceAwsAlb() *schema.Resource {
|
||||||
State: schema.ImportStatePassthrough,
|
State: schema.ImportStatePassthrough,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Timeouts: &schema.ResourceTimeout{
|
||||||
|
Create: schema.DefaultTimeout(10 * time.Minute),
|
||||||
|
Update: schema.DefaultTimeout(10 * time.Minute),
|
||||||
|
Delete: schema.DefaultTimeout(10 * time.Minute),
|
||||||
|
},
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"arn": {
|
"arn": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
|
@ -203,8 +209,9 @@ func resourceAwsAlbCreate(d *schema.ResourceData, meta interface{}) error {
|
||||||
|
|
||||||
return describeResp, *dLb.State.Code, nil
|
return describeResp, *dLb.State.Code, nil
|
||||||
},
|
},
|
||||||
Timeout: 10 * time.Minute,
|
Timeout: d.Timeout(schema.TimeoutCreate),
|
||||||
MinTimeout: 3 * time.Second,
|
MinTimeout: 10 * time.Second,
|
||||||
|
Delay: 30 * time.Second, // Wait 30 secs before starting
|
||||||
}
|
}
|
||||||
_, err = stateConf.WaitForState()
|
_, err = stateConf.WaitForState()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -369,8 +376,9 @@ func resourceAwsAlbUpdate(d *schema.ResourceData, meta interface{}) error {
|
||||||
|
|
||||||
return describeResp, *dLb.State.Code, nil
|
return describeResp, *dLb.State.Code, nil
|
||||||
},
|
},
|
||||||
Timeout: 10 * time.Minute,
|
Timeout: d.Timeout(schema.TimeoutUpdate),
|
||||||
MinTimeout: 3 * time.Second,
|
MinTimeout: 10 * time.Second,
|
||||||
|
Delay: 30 * time.Second, // Wait 30 secs before starting
|
||||||
}
|
}
|
||||||
_, err := stateConf.WaitForState()
|
_, err := stateConf.WaitForState()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue