Skip to content

docs(clb): [116968016]update-doc #2622

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 13, 2024
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
3 changes: 3 additions & 0 deletions .changelog/2622.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/tencentcloud_clb_attachment: optimization documentation
```
39 changes: 39 additions & 0 deletions tencentcloud/services/clb/resource_tc_clb_attachment.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里是不是补充一个 target 的 demo


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"
Expand All @@ -13,9 +32,29 @@ 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
}
}
```
Import

CLB attachment can be imported using the id, e.g.
Expand Down
42 changes: 42 additions & 0 deletions website/docs/r/clb_attachment.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,28 @@ 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.

## 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"
Expand All @@ -24,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
}
}
```

Expand Down
Loading