Skip to content

Commit 8a82119

Browse files
author
“guojunchu”
committed
Merge remote-tracking branch 'origin/master'
# Conflicts: # tencentcloud/data_source_tc_vpc_acls.go # tencentcloud/resource_tc_vpc_acl.go # tencentcloud/service_tencentcloud_vpc.go
1 parent 7261411 commit 8a82119

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

tencentcloud/resource_tc_vpc_acl_attachment.go

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import (
3232
"log"
3333
"strings"
3434

35-
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
3635
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
3736
)
3837

@@ -73,7 +72,7 @@ func resourceTencentCloudVpcAclAttachmentCreate(d *schema.ResourceData, meta int
7372
)
7473

7574
aclId := d.Get("acl_id").(string)
76-
subnetId := d.Get("acl_id").(string)
75+
subnetId := d.Get("subnet_id").(string)
7776

7877
subnetIds = append(subnetIds, subnetId)
7978

@@ -84,19 +83,6 @@ func resourceTencentCloudVpcAclAttachmentCreate(d *schema.ResourceData, meta int
8483

8584
d.SetId(aclId + "#" + subnetId)
8685

87-
aclAttachmentId := d.Id()
88-
err = resource.Retry(readRetryTimeout, func() *resource.RetryError {
89-
e := service.DescribeByAclId(ctx, aclAttachmentId)
90-
if e != nil {
91-
return retryError(e)
92-
}
93-
return nil
94-
})
95-
if err != nil {
96-
log.Printf("[CRITAL]%s read acl attachment failed, reason:%s\n", logId, err.Error())
97-
return err
98-
}
99-
10086
return resourceTencentCloudVpcAclAttachmentRead(d, meta)
10187
}
10288

tencentcloud/service_tencentcloud_vpc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3227,7 +3227,7 @@ func (me *VpcService) DescribeByAclId(ctx context.Context, attachmentAcl string)
32273227
if err != nil {
32283228
return err
32293229
}
3230-
if len(results) < 1 && len(results[0].SubnetSet) < 1 {
3230+
if len(results) < 1 || len(results[0].SubnetSet) < 1 {
32313231
return fmt.Errorf("[TECENT_TERRAFORM_CHECK][ACL attachment][Exists] check: Acl id is not set")
32323232
}
32333233
return nil

0 commit comments

Comments
 (0)