diff --git a/CHANGELOG.md b/CHANGELOG.md index 84d62673..10ba0db5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ +## [v1.0.29](https://github.com/civo/terraform-provider-civo/releases/tag/v1.0.29) (1 February 2023) + +### Merged +- [#162](https://github.com/civo/terraform-provider-civo/pull/162) - Added support for Database + ## [v1.0.28](https://github.com/civo/terraform-provider-civo/releases/tag/v1.0.28) (15 December 2022) ### Merged diff --git a/docs/data-sources/database.md b/docs/data-sources/database.md new file mode 100644 index 00000000..64fb03f4 --- /dev/null +++ b/docs/data-sources/database.md @@ -0,0 +1,44 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "civo_database Data Source - terraform-provider-civo" +subcategory: "" +description: |- + Get information of an Database for use in other resources. This data source provides all of the Database's properties as configured on your Civo account. + Note: This data source returns a single Database. When specifying a name, an error will be raised if more than one Databases with the same name found. +--- + +# civo_database (Data Source) + +Get information of an Database for use in other resources. This data source provides all of the Database's properties as configured on your Civo account. + +Note: This data source returns a single Database. When specifying a name, an error will be raised if more than one Databases with the same name found. + +## Example Usage + +```terraform +data "civo_database" "test" { + name = "test-database" + region = "LON1" +} +``` + + +## Schema + +### Optional + +- `id` (String) The ID of the Database +- `name` (String) The name of the Database +- `region` (String) The region of an existing Database + +### Read-Only + +- `firewall_id` (String) The firewall id of the Database +- `network_id` (String) The network id of the Database +- `nodes` (Number) Count of nodes +- `password` (String) The password of the database +- `size` (String) Size of the database +- `status` (String) The status of the database +- `username` (String) The username of the database + + diff --git a/docs/data-sources/firewall.md b/docs/data-sources/firewall.md index c01b9b06..95c68960 100644 --- a/docs/data-sources/firewall.md +++ b/docs/data-sources/firewall.md @@ -21,7 +21,7 @@ Firewalls may be looked up by id or name, and you can optionally pass region if ```terraform data "civo_firewall" "test" { name = "test-firewall" - region = "NYC1" + region = "LON1" } ``` diff --git a/docs/data-sources/instances.md b/docs/data-sources/instances.md index c0370fcd..b5d87f21 100644 --- a/docs/data-sources/instances.md +++ b/docs/data-sources/instances.md @@ -17,7 +17,7 @@ Note: You can use the `civo_instance` data source to obtain metadata about a sin ```terraform data "civo_instances" "small-size" { - region = "NYC1" + region = "LON1" filter { key = "size" values = [g3.small] diff --git a/docs/data-sources/network.md b/docs/data-sources/network.md index 20a58233..6cd29cf2 100644 --- a/docs/data-sources/network.md +++ b/docs/data-sources/network.md @@ -21,7 +21,7 @@ Networks may be looked up by id or label, and you can optionally pass region if ```terraform data "civo_network" "test" { label = "test-network" - region = "NYC1" + region = "LON1" } ``` diff --git a/docs/resources/database.md b/docs/resources/database.md new file mode 100644 index 00000000..e4d95e7f --- /dev/null +++ b/docs/resources/database.md @@ -0,0 +1,74 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "civo_database Resource - terraform-provider-civo" +subcategory: "" +description: |- + +--- + +# civo_database (Resource) + + + +## Example Usage + +```terraform +data "civo_size" "small" { + filter { + key = "name" + values = ["db.small"] + match_by = "re" + } + filter { + key = "type" + values = ["database"] + } +} + +resource "civo_database" "custom_database" { + name = "custom_database" + size = element(data.civo_size.small.sizes, 0).name + nodes = 2 +} +``` + + +## Schema + +### Required + +- `name` (String) Name of the database +- `nodes` (Number) Count of nodes +- `size` (String) Size of the database + +### Optional + +- `firewall_id` (String) The ID of the firewall to use, from the current list. If left blank or not sent, the default firewall will be used (open to all) +- `network_id` (String) The id of the associated network +- `region` (String) The region where the database will be created. +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) + +### Read-Only + +- `id` (String) The ID of this resource. +- `password` (String) The password of the database +- `status` (String) The status of the database +- `username` (String) The username of the database + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) +- `delete` (String) +- `update` (String) + +## Import + +Import is supported using the following syntax: + +```shell +# using ID +terraform import civo_database.mydb 29fcd1c4-fb61-44c7-b49c-dc7b98e9927e +```