Skip to content

Commit fe809a6

Browse files
authored
Merge pull request #506 from crab21/master
acl attachment perfect example field
2 parents 3086be8 + db8bc01 commit fe809a6

File tree

5 files changed

+32
-6
lines changed

5 files changed

+32
-6
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
## 1.41.3 (Unreleased)
2+
3+
ENHANCEMENTS:
4+
5+
* Resource: `tencentcloud_vpc_acl_attachment` perfect example field `subnet_ids` to `subnet_id`([#505](https://github.com/tencentcloudstack/terraform-provider-tencentcloud/issues/505)).
6+
27
## 1.41.2 (August 28, 2020)
38

49
BUG FIXES:

examples/tencentcloud-vpc/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ resource "tencentcloud_vpc_acl" "default" {
2222
}
2323

2424
resource "tencentcloud_vpc_acl_attachment" "example" {
25-
acl_id = tencentcloud_vpc_acl.default.id
26-
subnet_ids = data.tencentcloud_vpc_instances.default.instance_list[0].subnet_ids
25+
acl_id = tencentcloud_vpc_acl.default.id
26+
subnet_id = data.tencentcloud_vpc_instances.default.instance_list[0].subnet_ids[0]
2727
}
2828

2929
data "tencentcloud_vpc_acls" "default" {
3030
name = "test_acl"
31-
}
31+
}

tencentcloud/resource_tc_vpc_acl_attachment.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ resource "tencentcloud_vpc_acl" "foo" {
2121
2222
resource "tencentcloud_vpc_acl_attachment" "attachment"{
2323
acl_id = tencentcloud_vpc_acl.foo.id
24-
subnet_ids = data.tencentcloud_vpc_instances.id_instances.instance_list[0].subnet_ids
24+
subnet_id = data.tencentcloud_vpc_instances.id_instances.instance_list[0].subnet_ids[0]
2525
}
26+
```
2627
*/
2728
package tencentcloud
2829

tencentcloud/resource_tc_vpc_acl_attachment_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func testVpcAclAttachmentExists(n string) resource.TestCheckFunc {
7474

7575
const testAclAttachment_basic = `
7676
data "tencentcloud_vpc_instances" "id_instances" {
77-
name = "acl_test"
77+
name = "pulse-line-dev"
7878
}
7979
resource "tencentcloud_vpc_acl" "foo" {
8080
vpc_id = data.tencentcloud_vpc_instances.id_instances.instance_list.0.vpc_id

website/docs/r/vpc_acl_attachment.html.markdown

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,27 @@ Provide a resource to attach an existing subnet to Network ACL.
1212

1313
## Example Usage
1414

15-
15+
```hcl
16+
data "tencentcloud_vpc_instances" "id_instances" {
17+
}
18+
resource "tencentcloud_vpc_acl" "foo" {
19+
vpc_id = data.tencentcloud_vpc_instances.id_instances.instance_list.0.vpc_id
20+
name = "test_acl"
21+
ingress = [
22+
"ACCEPT#192.168.1.0/24#800#TCP",
23+
"ACCEPT#192.168.1.0/24#800-900#TCP",
24+
]
25+
egress = [
26+
"ACCEPT#192.168.1.0/24#800#TCP",
27+
"ACCEPT#192.168.1.0/24#800-900#TCP",
28+
]
29+
}
30+
31+
resource "tencentcloud_vpc_acl_attachment" "attachment" {
32+
acl_id = tencentcloud_vpc_acl.foo.id
33+
subnet_id = data.tencentcloud_vpc_instances.id_instances.instance_list[0].subnet_ids[0]
34+
}
35+
```
1636

1737
## Argument Reference
1838

0 commit comments

Comments
 (0)