Skip to content

Commit

Permalink
- Update the documentation for data source instance_size and template
Browse files Browse the repository at this point in the history
Signed-off-by: Alejandro JNM <alejandrojnm@gmail.com>
  • Loading branch information
alejandrojnm committed May 24, 2020
1 parent 96f9e41 commit 549da91
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions website/docs/d/instance_size.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Most common usage will probably be to supply a size to instances:
```hcl
data "civo_instances_size" "small" {
filter {
name = "name"
key = "name"
values = ["g2.small"]
}
}
Expand All @@ -28,7 +28,7 @@ resource "civo_instance" "my-test-instance" {
tags = ["python", "nginx"]
notes = "this is a note for the server"
size = element(data.civo_instances_size.small.sizes, 0).name
template = data.civo_template.debian.id
template = element(data.civo_template.debian.templates, 0).id
}
```

Expand All @@ -37,12 +37,12 @@ The data source also supports multiple filters and sorts. For example, to fetch
```hcl
data "civo_instances_size" "small" {
filter {
name = "cpu_cores"
key = "cpu_cores"
values = [1,2]
}
sort {
name = "disk_gb"
key = "disk_gb"
direction = "desc"
}
Expand All @@ -53,7 +53,7 @@ resource "civo_instance" "my-test-instance" {
tags = ["python", "nginx"]
notes = "this is a note for the server"
size = element(data.civo_instances_size.small.sizes, 0).name
template = data.civo_template.debian.id
template = element(data.civo_template.debian.templates, 0).id
}
```

Expand All @@ -63,13 +63,13 @@ The data source can also handle multiple sorts. In which case, the sort will be
data "civo_instances_size" "main" {
sort {
// Sort by memory ascendingly
name = "ram_mb"
key = "ram_mb"
direction = "asc"
}
sort {
// Then sort by disk descendingly for sizes with same memory
name = "disk_gb"
key = "disk_gb"
direction = "desc"
}
}
Expand Down
2 changes: 1 addition & 1 deletion website/docs/d/template.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ you need to utilize any of the image's data, with the ability to filter the resu
```hcl
data "civo_template" "debian" {
filter {
name = "code"
key = "code"
values = ["buster"]
}
}
Expand Down

0 comments on commit 549da91

Please sign in to comment.