diff --git a/CHANGELOG.md b/CHANGELOG.md index 1eb2a298..295c4689 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,19 @@ +## [v1.0.33](https://github.com/civo/terraform-provider-civo/releases/tag/v1.0.33) (12 June 2023) + +### Merged +- [#179](https://github.com/civo/terraform-provider-civo/pull/179) - Add WaitForStateto the network delete +- [#178](https://github.com/civo/terraform-provider-civo/pull/178) - Update the database +- [#171](https://github.com/civo/terraform-provider-civo/pull/171) - fix typo errors for code and documentation +- [#177](https://github.com/civo/terraform-provider-civo/pull/177) - Get Volume data-source improvement +- [#174](https://github.com/civo/terraform-provider-civo/pull/174) - feat: add ISSUE_TEMPLATES to report issues +- [#173](https://github.com/civo/terraform-provider-civo/pull/173) - feat: add bug.yml +- [#172](https://github.com/civo/terraform-provider-civo/pull/172) - nil pointer check for instance +- [#170](https://github.com/civo/terraform-provider-civo/pull/170) - Update kubernetes_cluster.md + +### Commits +- [2b9a899](https://github.com/civo/terraform-provider-civo/commit/2b9a899467993492641319099c5bc08e7624d55d) - Update resource.tf + ## [v1.0.31](https://github.com/civo/terraform-provider-civo/releases/tag/v1.0.31) (24 March 2023) ### Merged diff --git a/docs/data-sources/database.md b/docs/data-sources/database.md index 64fb03f4..91f8bcc0 100644 --- a/docs/data-sources/database.md +++ b/docs/data-sources/database.md @@ -33,6 +33,7 @@ data "civo_database" "test" { ### Read-Only +- `engine` (String) The engine of the database - `firewall_id` (String) The firewall id of the Database - `network_id` (String) The network id of the Database - `nodes` (Number) Count of nodes @@ -40,5 +41,6 @@ data "civo_database" "test" { - `size` (String) Size of the database - `status` (String) The status of the database - `username` (String) The username of the database +- `version` (String) The version of the database diff --git a/docs/data-sources/database_version.md b/docs/data-sources/database_version.md new file mode 100644 index 00000000..4ebc16ce --- /dev/null +++ b/docs/data-sources/database_version.md @@ -0,0 +1,90 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "civo_database_version Data Source - terraform-provider-civo" +subcategory: "" +description: |- + Retrieves information about the database versions that Civo supports, with the ability to filter the results. +--- + +# civo_database_version (Data Source) + +Retrieves information about the database versions that Civo supports, with the ability to filter the results. + +## Example Usage + +```terraform +# Example for mysql +data civo_database_version "mysql" { + filter { + key = "engine" + values = ["mysql"] + } +} + +# Example for postgresql +data civo_database_version "postgresql" { + filter { + key = "engine" + values = ["postgresql"] + } +} + +# To use this data source, make sure you have a database cluster created. +resource "civo_database" "custom_database" { + name = "custom_database" + size = element(data.civo_size.small.sizes, 0).name + nodes = 2 + engine = element(data.civo_database_version.mysql.versions, 0).engine + version = element(data.civo_database_version.mysql.versions, 0).version +} +``` + + +## Schema + +### Optional + +- `filter` (Block Set) One or more key/value pairs on which to filter results (see [below for nested schema](#nestedblock--filter)) +- `sort` (Block List) One or more key/direction pairs on which to sort results (see [below for nested schema](#nestedblock--sort)) + +### Read-Only + +- `id` (String) The ID of this resource. +- `versions` (List of Object) (see [below for nested schema](#nestedatt--versions)) + + +### Nested Schema for `filter` + +Required: + +- `key` (String) Filter versions by this key. This may be one of `default`, `engine`, `version`. +- `values` (List of String) Only retrieves `versions` which keys has value that matches one of the values provided here + +Optional: + +- `all` (Boolean) Set to `true` to require that a field match all of the `values` instead of just one or more of them. This is useful when matching against multi-valued fields such as lists or sets where you want to ensure that all of the `values` are present in the list or set. +- `match_by` (String) One of `exact` (default), `re`, or `substring`. For string-typed fields, specify `re` to match by using the `values` as regular expressions, or specify `substring` to match by treating the `values` as substrings to find within the string field. + + + +### Nested Schema for `sort` + +Required: + +- `key` (String) Sort versions by this key. This may be one of `default`, `engine`, `version`. + +Optional: + +- `direction` (String) The sort direction. This may be either `asc` or `desc`. + + + +### Nested Schema for `versions` + +Read-Only: + +- `default` (Boolean) +- `engine` (String) +- `version` (String) + + diff --git a/docs/data-sources/firewall.md b/docs/data-sources/firewall.md index 95c68960..7d2f8dd3 100644 --- a/docs/data-sources/firewall.md +++ b/docs/data-sources/firewall.md @@ -5,7 +5,7 @@ subcategory: "" description: |- Retrieve information about a firewall for use in other resources. This data source provides all of the firewall's properties as configured on your Civo account. - Firewalls may be looked up by id or name, and you can optionally pass region if you want to make a lookup for an expecific firewall inside that region. + Firewalls may be looked up by id or name, and you can optionally pass region if you want to make a lookup for a specific firewall inside that region. --- # civo_firewall (Data Source) @@ -14,7 +14,7 @@ Retrieve information about a firewall for use in other resources. This data source provides all of the firewall's properties as configured on your Civo account. -Firewalls may be looked up by id or name, and you can optionally pass region if you want to make a lookup for an expecific firewall inside that region. +Firewalls may be looked up by id or name, and you can optionally pass region if you want to make a lookup for a specific firewall inside that region. ## Example Usage diff --git a/docs/data-sources/instance.md b/docs/data-sources/instance.md index 553ab9cb..76730743 100644 --- a/docs/data-sources/instance.md +++ b/docs/data-sources/instance.md @@ -35,7 +35,7 @@ output "instance_output" { ### Read-Only -- `cpu_cores` (Number) Total cpu of the inatance +- `cpu_cores` (Number) Total cpu of the instance - `created_at` (String) The date of creation of the instance - `disk_gb` (Number) The size of the disk - `firewall_id` (String) The ID of the firewall used diff --git a/docs/data-sources/instances_size.md b/docs/data-sources/instances_size.md deleted file mode 100644 index 5d27559e..00000000 --- a/docs/data-sources/instances_size.md +++ /dev/null @@ -1,91 +0,0 @@ ---- -# generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "civo_instances_size Data Source - terraform-provider-civo" -subcategory: "" -description: |- - Retrieves information about the instance sizes that Civo supports, with the ability to filter the results. ---- - -# civo_instances_size (Data Source) - -Retrieves information about the instance sizes that Civo supports, with the ability to filter the results. - -## Example Usage - -```terraform -data "civo_instances_size" "small" { - filter { - key = "name" - values = ["g3.small"] - match_by = "re" - } - - filter { - key = "type" - values = ["instance"] - } - -} - -resource "civo_instance" "my-test-instance" { - hostname = "foo.com" - tags = ["python", "nginx"] - notes = "this is a note for the server" - size = element(data.civo_instances_size.small.sizes, 0).name - disk_image = element(data.civo_disk_image.debian.diskimages, 0).id -} -``` - - -## Schema - -### Optional - -- `filter` (Block Set) One or more key/value pairs on which to filter results (see [below for nested schema](#nestedblock--filter)) -- `sort` (Block List) One or more key/direction pairs on which to sort results (see [below for nested schema](#nestedblock--sort)) - -### Read-Only - -- `id` (String) The ID of this resource. -- `sizes` (List of Object) (see [below for nested schema](#nestedatt--sizes)) - - -### Nested Schema for `filter` - -Required: - -- `key` (String) Filter sizes by this key. This may be one of `cpu`, `description`, `disk`, `name`, `ram`, `selectable`, `type`. -- `values` (List of String) Only retrieves `sizes` which keys has value that matches one of the values provided here - -Optional: - -- `all` (Boolean) Set to `true` to require that a field match all of the `values` instead of just one or more of them. This is useful when matching against multi-valued fields such as lists or sets where you want to ensure that all of the `values` are present in the list or set. -- `match_by` (String) One of `exact` (default), `re`, or `substring`. For string-typed fields, specify `re` to match by using the `values` as regular expressions, or specify `substring` to match by treating the `values` as substrings to find within the string field. - - - -### Nested Schema for `sort` - -Required: - -- `key` (String) Sort sizes by this key. This may be one of `cpu`, `description`, `disk`, `name`, `ram`, `selectable`, `type`. - -Optional: - -- `direction` (String) The sort direction. This may be either `asc` or `desc`. - - - -### Nested Schema for `sizes` - -Read-Only: - -- `cpu` (Number) -- `description` (String) -- `disk` (Number) -- `name` (String) -- `ram` (Number) -- `selectable` (Boolean) -- `type` (String) - - diff --git a/docs/data-sources/loadbalancer.md b/docs/data-sources/loadbalancer.md index 9b9c5b5f..2058150d 100644 --- a/docs/data-sources/loadbalancer.md +++ b/docs/data-sources/loadbalancer.md @@ -35,7 +35,7 @@ output "civo_loadbalancer_output" { - `id` (String) The id of the load balancer to retrieve (You can find this id from service annotations 'kubernetes.civo.com/loadbalancer-id') - `name` (String) The name of the load balancer (You can find this name from service annotations 'kubernetes.civo.com/loadbalancer-name') -- `region` (String) The region of the load balancer, if you delcare this field, the datasource will use this value instead of the one defined in the provider +- `region` (String) The region of the load balancer, if you declare this field, the datasource will use this value instead of the one defined in the provider ### Read-Only diff --git a/docs/data-sources/network.md b/docs/data-sources/network.md index 6cd29cf2..16c6dd8d 100644 --- a/docs/data-sources/network.md +++ b/docs/data-sources/network.md @@ -5,7 +5,7 @@ subcategory: "" description: |- Retrieve information about a network for use in other resources. This data source provides all of the network's properties as configured on your Civo account. - Networks may be looked up by id or label, and you can optionally pass region if you want to make a lookup for an expecific network inside that region. + Networks may be looked up by id or label, and you can optionally pass region if you want to make a lookup for a specific network inside that region. --- # civo_network (Data Source) @@ -14,7 +14,7 @@ Retrieve information about a network for use in other resources. This data source provides all of the network's properties as configured on your Civo account. -Networks may be looked up by id or label, and you can optionally pass region if you want to make a lookup for an expecific network inside that region. +Networks may be looked up by id or label, and you can optionally pass region if you want to make a lookup for a specific network inside that region. ## Example Usage diff --git a/docs/data-sources/volume.md b/docs/data-sources/volume.md index 9905227e..c4b9a935 100644 --- a/docs/data-sources/volume.md +++ b/docs/data-sources/volume.md @@ -16,8 +16,12 @@ An error will be raised if the provided volume name does not exist in your Civo ## Example Usage ```terraform -data "civo_volume" "mysql" { - name = "database-mysql" +data "civo_volume" "myvolume" { + name = "test-volume-name" +} + +output "volume_output" { + value = data.civo_volume.myvolume } ``` diff --git a/docs/resources/database.md b/docs/resources/database.md index e4d95e7f..eb17045c 100644 --- a/docs/resources/database.md +++ b/docs/resources/database.md @@ -29,6 +29,8 @@ resource "civo_database" "custom_database" { name = "custom_database" size = element(data.civo_size.small.sizes, 0).name nodes = 2 + engine = element(data.civo_database_version.mysql.versions, 0).engine + version = element(data.civo_database_version.mysql.versions, 0).version } ``` @@ -37,9 +39,11 @@ resource "civo_database" "custom_database" { ### Required +- `engine` (String) The engine of the database - `name` (String) Name of the database - `nodes` (Number) Count of nodes - `size` (String) Size of the database +- `version` (String) The version of the database ### Optional