Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changelog/3701.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```release-note:enhancement
resource/tencentcloud_teo_bind_security_template: support timeout.
```

```release-note:enhancement
resource/tencentcloud_teo_certificate_config: support timeout.
```
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ func ResourceTencentCloudTeoBindSecurityTemplate() *schema.Resource {
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(3 * time.Minute),
},
Schema: map[string]*schema.Schema{
"zone_id": {
Type: schema.TypeString,
Expand Down Expand Up @@ -127,7 +130,7 @@ func resourceTencentCloudTeoBindSecurityTemplateCreate(d *schema.ResourceData, m
Pending: []string{},
Refresh: resourceTeoBindSecurityTemplateCreateStateRefreshFunc_0_0(ctx, zoneId, templateId, entity),
Target: []string{"online"},
Timeout: 180 * time.Second,
Timeout: d.Timeout(schema.TimeoutCreate),
}).WaitForStateContext(ctx); err != nil {
return err
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion tencentcloud/services/teo/service_tencentcloud_teo.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
teo "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/teo/v20220901"
teov20220901 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/teo/v20220901"

Expand Down Expand Up @@ -921,7 +922,15 @@ func (me *TeoService) ModifyZoneStatus(ctx context.Context, zoneId string, pause
}

func (me *TeoService) CheckAccelerationDomainStatus(ctx context.Context, zoneId, domainName, operate string) error {
err := resource.Retry(6*tccommon.ReadRetryTimeout, func() *resource.RetryError {
d := tccommon.ResourceDataFromContext(ctx)
var timeout time.Duration

if d.IsNewResource() {
timeout = d.Timeout(schema.TimeoutCreate)
} else {
timeout = d.Timeout(schema.TimeoutUpdate)
}
err := resource.Retry(timeout, func() *resource.RetryError {
instance, errRet := me.DescribeTeoAccelerationDomainById(ctx, zoneId, domainName)
if errRet != nil {
return tccommon.RetryError(errRet, tccommon.InternalError)
Expand Down
5 changes: 5 additions & 0 deletions website/docs/r/teo_bind_security_template.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ In addition to all arguments above, the following attributes are exported:
* `id` - ID of the resource.
* `status` - Instance configuration delivery status, the possible values are: `online`: the configuration has taken effect; `fail`: the configuration failed; `process`: the configuration is being delivered.

## Timeouts

The `timeouts` block allows you to specify [timeouts](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts) for certain actions:

* `create` - (Defaults to `3m`) Used when creating the resource.

## Import

Expand Down
6 changes: 6 additions & 0 deletions website/docs/r/teo_certificate_config.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ In addition to all arguments above, the following attributes are exported:
* `id` - ID of the resource.


## Timeouts

The `timeouts` block allows you to specify [timeouts](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts) for certain actions:

* `create` - (Defaults to `20m`) Used when creating the resource.
* `update` - (Defaults to `20m`) Used when updating the resource.

## Import

Expand Down
Loading