Skip to content

Commit 1f9f7a6

Browse files
committed
add documentation
1 parent 37a445f commit 1f9f7a6

9 files changed

+612
-0
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
layout: "cloudstack"
3+
page_title: "CloudStack: cloudstack_autoscale_policy"
4+
sidebar_current: "docs-cloudstack-data-source-autoscale-policy"
5+
description: |-
6+
Gets information about a CloudStack autoscale policy.
7+
---
8+
9+
# cloudstack_autoscale_policy
10+
11+
Use this data source to get information about a CloudStack autoscale policy.
12+
13+
## Example Usage
14+
15+
```hcl
16+
# Get policy by ID
17+
data "cloudstack_autoscale_policy" "existing_policy" {
18+
id = "6a8dc025-d7c9-4676-8a7d-e2d9b55e7e60"
19+
}
20+
21+
# Get policy by name
22+
data "cloudstack_autoscale_policy" "scale_up_policy" {
23+
filter {
24+
name = "name"
25+
value = "scale-up-policy"
26+
}
27+
}
28+
29+
# Use in an autoscale VM group
30+
resource "cloudstack_autoscale_vm_group" "vm_group" {
31+
name = "web-autoscale"
32+
lbrule_id = cloudstack_loadbalancer_rule.lb.id
33+
min_members = 1
34+
max_members = 5
35+
vm_profile_id = cloudstack_autoscale_vm_profile.profile.id
36+
37+
scaleup_policy_ids = [
38+
data.cloudstack_autoscale_policy.existing_policy.id
39+
]
40+
41+
scaledown_policy_ids = [
42+
cloudstack_autoscale_policy.scale_down.id
43+
]
44+
}
45+
```
46+
47+
## Argument Reference
48+
49+
The following arguments are supported:
50+
51+
* `id` - (Optional) The ID of the autoscale policy.
52+
53+
* `filter` - (Optional) One or more name/value pairs to filter off of. You can apply filters on any exported attributes.
54+
55+
## Attributes Reference
56+
57+
The following attributes are exported:
58+
59+
* `id` - The autoscale policy ID.
60+
61+
* `name` - The name of the policy.
62+
63+
* `action` - The action (SCALEUP or SCALEDOWN).
64+
65+
* `duration` - The duration in seconds.
66+
67+
* `quiet_time` - The quiet time in seconds.
68+
69+
* `condition_ids` - The list of condition IDs used by this policy.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
layout: "cloudstack"
3+
page_title: "CloudStack: cloudstack_autoscale_vm_group"
4+
sidebar_current: "docs-cloudstack-data-source-autoscale-vm-group"
5+
description: |-
6+
Gets information about a CloudStack autoscale VM group.
7+
---
8+
9+
# cloudstack_autoscale_vm_group
10+
11+
Use this data source to get information about a CloudStack autoscale VM group.
12+
13+
## Example Usage
14+
15+
```hcl
16+
# Get autoscale VM group by ID
17+
data "cloudstack_autoscale_vm_group" "existing_group" {
18+
id = "156a819a-dec1-4166-aab3-657c271fa4a3"
19+
}
20+
21+
# Get autoscale VM group by name
22+
data "cloudstack_autoscale_vm_group" "web_group" {
23+
filter {
24+
name = "name"
25+
value = "web-server-autoscale"
26+
}
27+
}
28+
29+
# Output information about the group
30+
output "autoscale_group_state" {
31+
value = data.cloudstack_autoscale_vm_group.existing_group.state
32+
}
33+
34+
output "current_members" {
35+
value = "Min: ${data.cloudstack_autoscale_vm_group.existing_group.min_members}, Max: ${data.cloudstack_autoscale_vm_group.existing_group.max_members}"
36+
}
37+
```
38+
39+
## Argument Reference
40+
41+
The following arguments are supported:
42+
43+
* `id` - (Optional) The ID of the autoscale VM group.
44+
45+
* `filter` - (Optional) One or more name/value pairs to filter off of. You can apply filters on any exported attributes.
46+
47+
## Attributes Reference
48+
49+
The following attributes are exported:
50+
51+
* `id` - The autoscale VM group ID.
52+
53+
* `name` - The name of the autoscale VM group.
54+
55+
* `lbrule_id` - The load balancer rule ID.
56+
57+
* `min_members` - The minimum number of members.
58+
59+
* `max_members` - The maximum number of members.
60+
61+
* `vm_profile_id` - The VM profile ID.
62+
63+
* `interval` - The monitoring interval in seconds.
64+
65+
* `display` - Whether the group is displayed to end users.
66+
67+
* `state` - The current state of the group (enable or disable).
68+
69+
* `scaleup_policy_ids` - The list of scale-up policy IDs.
70+
71+
* `scaledown_policy_ids` - The list of scale-down policy IDs.
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
layout: "cloudstack"
3+
page_title: "CloudStack: cloudstack_autoscale_vm_profile"
4+
sidebar_current: "docs-cloudstack-data-source-autoscale-vm-profile"
5+
description: |-
6+
Gets information about a CloudStack autoscale VM profile.
7+
---
8+
9+
# cloudstack_autoscale_vm_profile
10+
11+
Use this data source to get information about a CloudStack autoscale VM profile.
12+
13+
## Example Usage
14+
15+
```hcl
16+
# Get VM profile by ID
17+
data "cloudstack_autoscale_vm_profile" "existing_profile" {
18+
id = "a596f7a2-95b8-4f0e-9f15-88f4091f18fe"
19+
}
20+
21+
# Get VM profile by filter
22+
data "cloudstack_autoscale_vm_profile" "web_profile" {
23+
filter {
24+
name = "service_offering"
25+
value = "Small Instance"
26+
}
27+
}
28+
29+
# Use in an autoscale VM group
30+
resource "cloudstack_autoscale_vm_group" "vm_group" {
31+
name = "web-autoscale"
32+
lbrule_id = cloudstack_loadbalancer_rule.lb.id
33+
min_members = 1
34+
max_members = 5
35+
vm_profile_id = data.cloudstack_autoscale_vm_profile.existing_profile.id
36+
37+
scaleup_policy_ids = [cloudstack_autoscale_policy.scale_up.id]
38+
scaledown_policy_ids = [cloudstack_autoscale_policy.scale_down.id]
39+
}
40+
```
41+
42+
## Argument Reference
43+
44+
The following arguments are supported:
45+
46+
* `id` - (Optional) The ID of the autoscale VM profile.
47+
48+
* `filter` - (Optional) One or more name/value pairs to filter off of. You can apply filters on any exported attributes.
49+
50+
## Attributes Reference
51+
52+
The following attributes are exported:
53+
54+
* `id` - The autoscale VM profile ID.
55+
56+
* `service_offering` - The service offering name or ID.
57+
58+
* `template` - The template name or ID.
59+
60+
* `zone` - The zone name or ID.
61+
62+
* `destroy_vm_grace_period` - The grace period for VM destruction.
63+
64+
* `counter_param_list` - Counter parameters for monitoring.
65+
66+
* `user_data` - User data for VM initialization.
67+
68+
* `user_data_details` - Additional user data details.
69+
70+
* `account_name` - The account name that owns the profile.
71+
72+
* `domain_id` - The domain ID where the profile exists.
73+
74+
* `display` - Whether the profile is displayed to end users.
75+
76+
* `other_deploy_params` - Additional deployment parameters.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
layout: "cloudstack"
3+
page_title: "CloudStack: cloudstack_condition"
4+
sidebar_current: "docs-cloudstack-data-source-condition"
5+
description: |-
6+
Gets information about a CloudStack autoscale condition.
7+
---
8+
9+
# cloudstack_condition
10+
11+
Use this data source to get information about a CloudStack autoscale condition.
12+
13+
## Example Usage
14+
15+
```hcl
16+
# Get condition by ID
17+
data "cloudstack_condition" "existing_condition" {
18+
id = "c2f0591b-ce9b-499a-81f2-8fc6318b0c72"
19+
}
20+
21+
# Get condition by filter
22+
data "cloudstack_condition" "cpu_condition" {
23+
filter {
24+
name = "threshold"
25+
value = "80"
26+
}
27+
}
28+
29+
# Use in a policy
30+
resource "cloudstack_autoscale_policy" "scale_policy" {
31+
name = "scale-up-policy"
32+
action = "scaleup"
33+
duration = 300
34+
quiet_time = 300
35+
condition_ids = [data.cloudstack_condition.existing_condition.id]
36+
}
37+
```
38+
39+
## Argument Reference
40+
41+
The following arguments are supported:
42+
43+
* `id` - (Optional) The ID of the condition.
44+
45+
* `filter` - (Optional) One or more name/value pairs to filter off of. You can apply filters on any exported attributes.
46+
47+
## Attributes Reference
48+
49+
The following attributes are exported:
50+
51+
* `id` - The condition ID.
52+
53+
* `counter_id` - The counter ID being monitored.
54+
55+
* `relational_operator` - The relational operator for the condition.
56+
57+
* `threshold` - The threshold value.
58+
59+
* `account_name` - The account name that owns the condition.
60+
61+
* `domain_id` - The domain ID where the condition exists.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
layout: "cloudstack"
3+
page_title: "CloudStack: cloudstack_counter"
4+
sidebar_current: "docs-cloudstack-data-source-counter"
5+
description: |-
6+
Gets information about a CloudStack counter.
7+
---
8+
9+
# cloudstack_counter
10+
11+
Use this data source to get information about a CloudStack counter for use in autoscale conditions.
12+
13+
## Example Usage
14+
15+
```hcl
16+
# Get counter by ID
17+
data "cloudstack_counter" "cpu_counter" {
18+
id = "959e11c0-8416-11f0-9a72-1e001b000238"
19+
}
20+
21+
# Get counter by name
22+
data "cloudstack_counter" "memory_counter" {
23+
filter {
24+
name = "name"
25+
value = "VM CPU - average percentage"
26+
}
27+
}
28+
29+
# Use in a condition
30+
resource "cloudstack_condition" "scale_up" {
31+
counter_id = data.cloudstack_counter.cpu_counter.id
32+
relational_operator = "GT"
33+
threshold = 80.0
34+
account_name = "admin"
35+
domain_id = "1"
36+
}
37+
```
38+
39+
## Argument Reference
40+
41+
The following arguments are supported:
42+
43+
* `id` - (Optional) The ID of the counter.
44+
45+
* `filter` - (Optional) One or more name/value pairs to filter off of. You can apply filters on any exported attributes.
46+
47+
## Attributes Reference
48+
49+
The following attributes are exported:
50+
51+
* `id` - The counter ID.
52+
53+
* `name` - The name of the counter.
54+
55+
* `source` - The source of the counter.
56+
57+
* `value` - The metric value monitored by the counter.

0 commit comments

Comments
 (0)