From 1ed34193257bb68774ebc30daa368b222ea54834 Mon Sep 17 00:00:00 2001 From: Wmxs <54929266+WeiMengXS@users.noreply.github.com> Date: Wed, 8 May 2024 22:02:56 +0800 Subject: [PATCH 1/3] feat(doc): update-doc --- tencentcloud/services/clb/resource_tc_clb_attachment.md | 2 ++ website/docs/r/clb_attachment.html.markdown | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tencentcloud/services/clb/resource_tc_clb_attachment.md b/tencentcloud/services/clb/resource_tc_clb_attachment.md index 1de35f8bfc..ad9aa0f7e3 100644 --- a/tencentcloud/services/clb/resource_tc_clb_attachment.md +++ b/tencentcloud/services/clb/resource_tc_clb_attachment.md @@ -1,4 +1,6 @@ Provides a resource to create a CLB attachment. +~> **NOTE:** This resource is designed to manage the entire set of binding relationships associated with a particular CLB (Cloud Load Balancer). As such, it does not allow the simultaneous use of this resource for the same CLB across different contexts or environments. + Example Usage diff --git a/website/docs/r/clb_attachment.html.markdown b/website/docs/r/clb_attachment.html.markdown index 055d8b2bb0..335f7a5b0b 100644 --- a/website/docs/r/clb_attachment.html.markdown +++ b/website/docs/r/clb_attachment.html.markdown @@ -5,11 +5,13 @@ page_title: "TencentCloud: tencentcloud_clb_attachment" sidebar_current: "docs-tencentcloud-resource-clb_attachment" description: |- Provides a resource to create a CLB attachment. +~> **NOTE:** This resource is designed to manage the entire set of binding relationships associated with a particular CLB (Cloud Load Balancer). As such, it does not allow the simultaneous use of this resource for the same CLB across different contexts or environments. --- # tencentcloud_clb_attachment Provides a resource to create a CLB attachment. +~> **NOTE:** This resource is designed to manage the entire set of binding relationships associated with a particular CLB (Cloud Load Balancer). As such, it does not allow the simultaneous use of this resource for the same CLB across different contexts or environments. ## Example Usage From ba9f2d148e5f85d44d33a751fc1b4fba7ad74a66 Mon Sep 17 00:00:00 2001 From: Wmxs <54929266+WeiMengXS@users.noreply.github.com> Date: Wed, 8 May 2024 22:06:11 +0800 Subject: [PATCH 2/3] feat(doc): update-doc --- .changelog/2622.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/2622.txt diff --git a/.changelog/2622.txt b/.changelog/2622.txt new file mode 100644 index 0000000000..946fb917d1 --- /dev/null +++ b/.changelog/2622.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/tencentcloud_clb_attachment: optimization documentation +``` \ No newline at end of file From eff4bda8cca873b33ba272d513cd71ecb4c4d82a Mon Sep 17 00:00:00 2001 From: Wmxs <54929266+WeiMengXS@users.noreply.github.com> Date: Mon, 13 May 2024 10:36:07 +0800 Subject: [PATCH 3/3] feat(doc): update-doc --- .../clb/resource_tc_clb_attachment.md | 37 ++++++++++++++++ website/docs/r/clb_attachment.html.markdown | 42 ++++++++++++++++++- 2 files changed, 78 insertions(+), 1 deletion(-) diff --git a/tencentcloud/services/clb/resource_tc_clb_attachment.md b/tencentcloud/services/clb/resource_tc_clb_attachment.md index ad9aa0f7e3..c91e27f799 100644 --- a/tencentcloud/services/clb/resource_tc_clb_attachment.md +++ b/tencentcloud/services/clb/resource_tc_clb_attachment.md @@ -1,9 +1,11 @@ Provides a resource to create a CLB attachment. + ~> **NOTE:** This resource is designed to manage the entire set of binding relationships associated with a particular CLB (Cloud Load Balancer). As such, it does not allow the simultaneous use of this resource for the same CLB across different contexts or environments. Example Usage +Bind a Cvm instance ```hcl resource "tencentcloud_clb_attachment" "foo" { clb_id = "lb-k2zjp9lv" @@ -18,6 +20,41 @@ resource "tencentcloud_clb_attachment" "foo" { } ``` +Bind multiple Cvm instances +```hcl +resource "tencentcloud_clb_attachment" "foo" { + clb_id = "lb-k2zjp9lv" + listener_id = "lbl-hh141sn9" + rule_id = "loc-4xxr2cy7" + + targets { + instance_id = "ins-1flbqyp8" + port = 80 + weight = 10 + } + + targets { + instance_id = "ins-ekloqpa1" + port = 81 + weight = 10 + } +} +``` + +Bind backend target is ENI +```hcl +resource "tencentcloud_clb_attachment" "foo" { + clb_id = "lb-k2zjp9lv" + listener_id = "lbl-hh141sn9" + rule_id = "loc-4xxr2cy7" + + targets { + eni_ip = "example-ip" + port = 23 + weight = 50 + } +} +``` Import CLB attachment can be imported using the id, e.g. diff --git a/website/docs/r/clb_attachment.html.markdown b/website/docs/r/clb_attachment.html.markdown index 335f7a5b0b..b8eaf50e22 100644 --- a/website/docs/r/clb_attachment.html.markdown +++ b/website/docs/r/clb_attachment.html.markdown @@ -5,16 +5,34 @@ page_title: "TencentCloud: tencentcloud_clb_attachment" sidebar_current: "docs-tencentcloud-resource-clb_attachment" description: |- Provides a resource to create a CLB attachment. -~> **NOTE:** This resource is designed to manage the entire set of binding relationships associated with a particular CLB (Cloud Load Balancer). As such, it does not allow the simultaneous use of this resource for the same CLB across different contexts or environments. --- # tencentcloud_clb_attachment Provides a resource to create a CLB attachment. + ~> **NOTE:** This resource is designed to manage the entire set of binding relationships associated with a particular CLB (Cloud Load Balancer). As such, it does not allow the simultaneous use of this resource for the same CLB across different contexts or environments. ## Example Usage +### Bind a Cvm instance + +```hcl +resource "tencentcloud_clb_attachment" "foo" { + clb_id = "lb-k2zjp9lv" + listener_id = "lbl-hh141sn9" + rule_id = "loc-4xxr2cy7" + + targets { + instance_id = "ins-1flbqyp8" + port = 80 + weight = 10 + } +} +``` + +### Bind multiple Cvm instances + ```hcl resource "tencentcloud_clb_attachment" "foo" { clb_id = "lb-k2zjp9lv" @@ -26,6 +44,28 @@ resource "tencentcloud_clb_attachment" "foo" { port = 80 weight = 10 } + + targets { + instance_id = "ins-ekloqpa1" + port = 81 + weight = 10 + } +} +``` + +### Bind backend target is ENI + +```hcl +resource "tencentcloud_clb_attachment" "foo" { + clb_id = "lb-k2zjp9lv" + listener_id = "lbl-hh141sn9" + rule_id = "loc-4xxr2cy7" + + targets { + eni_ip = "example-ip" + port = 23 + weight = 50 + } } ```