From 7bcb3a02804dd5a82a371caccbf3ab950067d367 Mon Sep 17 00:00:00 2001 From: Felipe Publio Date: Tue, 6 Aug 2024 11:46:40 -0300 Subject: [PATCH] docs: Update block storage volume and attachment resources documentation --- docs/guides/region.md | 61 ++++++++ docs/resources/block_storage_snapshots.md | 106 +++----------- .../block_storage_volume_attachment.md | 6 +- docs/resources/block_storage_volumes.md | 133 +++--------------- docs/resources/dbaas_instances_backups.md | 9 ++ docs/resources/object_storage_buckets.md | 51 +++---- 6 files changed, 141 insertions(+), 225 deletions(-) create mode 100644 docs/guides/region.md diff --git a/docs/guides/region.md b/docs/guides/region.md new file mode 100644 index 0000000..01105bb --- /dev/null +++ b/docs/guides/region.md @@ -0,0 +1,61 @@ +--- +page_title: "Configure your Terraform Region" +subcategory: "Guides" +description: |- + How to configure the region in Terraform for Magalu Cloud. +--- + +# Configurar região + +Para configurar a região do provedor, utilize o seguinte código: + +```hcl +provider "mgc" { + region="br-se1" +} +``` + +Parâmetros + +region: Define a região para o provedor MGC. No exemplo acima, br-se1 indica a região Sudeste. +Exemplo + +No exemplo abaixo utilizamos 2 regiões br-se1 e br-ne1 e criamos um provider para cada, adicionando um alias para facilitar o controle dos recursos de block-storage: + +```hcl +terraform { + required_providers { + mgc = { + source = "magalucloud/mgc" + } + } +} + +provider "mgc" { + alias = "sudeste" + region = "br-se1" +} + +provider "mgc" { + alias = "nordeste" + region = "br-ne1" +} + +resource "mgc_block-storage_volumes" "block_storage" { + provider = mgc.nordeste + name = "volume-via-terraform" + size = 30 + type = { + name = "cloud_nvme20k" + } +} + +resource "mgc_block-storage_volumes" "block_storage-sudeste" { + provider = mgc.sudeste + name = "volume-via-terraform" + size = 30 + type = { + name = "cloud_nvme20k" + } +} +``` \ No newline at end of file diff --git a/docs/resources/block_storage_snapshots.md b/docs/resources/block_storage_snapshots.md index ea5e1b8..ebef5b2 100644 --- a/docs/resources/block_storage_snapshots.md +++ b/docs/resources/block_storage_snapshots.md @@ -2,7 +2,7 @@ page_title: "mgc_block_storage_snapshots Resource - terraform-provider-mgc" subcategory: "Block Storage" description: |- - Operations with snapshots for volumes. + The block storage snapshots resource allows you to manage block storage snapshots in the Magalu Cloud. --- # mgc_block_storage_snapshots (Resource) @@ -26,99 +26,31 @@ resource "mgc_block_storage_snapshots" "snapshot_example" { -> For more examples, you can visit the [Magalu Cloud Terraform example repository.](https://github.com/MagaluCloud/terraform-examples) -## Arguments Reference +## Schema ### Required -- `description` (String): Description of the snapshot. -- `name` (String): Name of the snapshot. -- `volume` (Block): Details of the volume to snapshot. ([See nested schema for `volume`](#nestedatt--volume)) +- `description` (String) The description of the volume snapshot. +- `name` (String) The name of the volume snapshot. +- `volume` (Attributes) (see [below for nested schema](#nestedatt--volume)) - -### Nested Schema for `volume` - -Required: - -- `id` (String): ID of the volume. -- `name` (String): Name of the volume. - --> You can provide `id` or `name`. It is not necessary to inform both. - -## Attributes Reference - -- `created_at`: Timestamp of when the snapshot was created ([see Nested Schema for `created_at`](#nestedatt--created_at)) -- `current_volume`: Details of the current volume ([see Nested Schema for `current_volume`](#nestedatt--current_volume)) -- `id` (String) The ID of this resource. -- `size` (Number) Size of the snapshot. -- `state` (String) Current state of the snapshot. -- `status` (String) Status of the snapshot. -- `updated_at`: Timestamp of when the snapshot was last updated ([see Nested Schema for `updated_at`](#nestedatt--updated_at)) - - - -### Nested Schema for `created_at` - -Read-Only: - -- `string1` (String): Timestamp of when the snapshot was created -- `string2` (String): Timestamp of when the snapshot was created - -Example: -```hcl -"created_at": { - "string1": "2024-07-12T13:45:06Z", - "string2": "2024-07-12T13:45:06Z" - }, -``` +### Optional - -### Nested Schema for `current_volume` +- `name_is_prefix` (Boolean) Indicates whether the provided name is a prefix or the exact name of the volume snapshot. -Read-Only: +### Read-Only -- `id` (String): ID of current volume -- `name` (String): Name of current volume -- `size` (Number): Size of current volume -- `type` (Attributes) ([see nested schema for `type`](#nestedatt--current_volume--type)) +- `created_at` (String) The timestamp when the block storage was created. +- `final_name` (String) The final name of the volume snapshot after applying any naming conventions or modifications. +- `id` (String) The unique identifier of the volume snapshot. +- `size` (Number) The size of the snapshot in GB. +- `state` (String) The current state of the virtual machine instance. +- `status` (String) The status of the virtual machine instance. +- `updated_at` (String) The timestamp when the block storage was last updated. -Example: -```hcl -"current_volume": { - "id": "5c7ae181-fd5d-4a2f-8f10-fasdfadaf", - "name": null, - "size": null, - "type": null - }, -``` - - -### Nested Schema for `current_volume.type` - -Read-Only: - -- `id` (String): ID of current volume type -- `name` (String): Name of current volume type - -Example: -```hcl -"type": { - "id": 5c7ae181-fd5d-4a2f-8f10-fasdfadaf, - "name": "cloud_nvme" - }, -``` - - -### Nested Schema for `updated_at` - -Read-Only: + +### Nested Schema for `volume` -- `string1` (String): Timestamp of when the snapshot was last updated -- `string2` (String): Timestamp of when the snapshot was last updated +Required: -Example: -```hcl -"updated_at": { - "string1": "2024-07-12T13:45:06Z", - "string2": "2024-07-12T13:45:06Z" - }, -``` +- `id` (String) ID of block storage volume diff --git a/docs/resources/block_storage_volume_attachment.md b/docs/resources/block_storage_volume_attachment.md index bca2a85..a973eee 100644 --- a/docs/resources/block_storage_volume_attachment.md +++ b/docs/resources/block_storage_volume_attachment.md @@ -20,7 +20,7 @@ resource "mgc_block_storage_volume_attachment" "attach_example" { ## Schema -### Optional +### Required -- `block_storage_id` (String) -- `virtual_machine_id` (String) +- `block_storage_id` (String) The ID of the block storage volume to attach. +- `virtual_machine_id` (String) The ID of the virtual machine to attach the volume to. diff --git a/docs/resources/block_storage_volumes.md b/docs/resources/block_storage_volumes.md index 0d0d0be..5ee486c 100644 --- a/docs/resources/block_storage_volumes.md +++ b/docs/resources/block_storage_volumes.md @@ -3,12 +3,13 @@ page_title: "mgc_block_storage_volumes Resource - terraform-provider-mgc" subcategory: "Block Storage" description: |- - Operations with volumes, including create, delete, extend, retype, list and other actions. + Block storage volumes are storage devices that can be attached to virtual machines. They are used to store data and can be detached and attached to other virtual machines. --- # mgc_block_storage_volumes (Resource) -Operations with volumes, including create, delete, extend, retype, list and other actions. +Block storage volumes are storage devices that can be attached to virtual machines. They are used to store data and can be detached and attached to other virtual machines. + ```hcl resource "mgc_block_storage_volumes" "example_volume" { @@ -20,128 +21,38 @@ resource "mgc_block_storage_volumes" "example_volume" { } ``` + ## Schema ### Required -- `name` (String) -- `size` (Number) Gibibytes (GiB) -- `type` (Attributes) (see [below for nested schema](#nestedatt--type)) +- `name` (String) The name of the block storage. +- `size` (Number) The size of the block storage in GB. +- `type` (Attributes) The type of the block storage. (see [below for nested schema](#nestedatt--type)) + +### Optional + +- `name_is_prefix` (Boolean) Indicates whether the provided name is a prefix or the exact name of the block storage. ### Read-Only -- `attachment` (Attributes) (see [below for nested schema](#nestedatt--attachment)) -- `created_at` (Attributes) (see [below for nested schema](#nestedatt--created_at)) -- `current_type` (Attributes) (see [below for nested schema](#nestedatt--current_type)) -- `error` (Attributes) (see [below for nested schema](#nestedatt--error)) -- `id` (String) The ID of this resource. -- `state` (String) -- `status` (String) -- `updated_at` (Attributes) (see [below for nested schema](#nestedatt--updated_at)) +- `created_at` (String) The timestamp when the block storage was created. +- `final_name` (String) The final name of the block storage after applying any naming conventions or modifications. +- `id` (String) The unique identifier of the block storage. +- `state` (String) The current state of the virtual machine instance. +- `status` (String) The status of the virtual machine instance. +- `updated_at` (String) The timestamp when the block storage was last updated. ### Nested Schema for `type` -Optional: - -- `id` (String) -- `name` (String) - - - -### Nested Schema for `attachment` - -Read-Only: - -- `attached_at` (Attributes) (see [below for nested schema](#nestedatt--attachment--attached_at)) -- `device` (String) -- `instance` (Attributes) (see [below for nested schema](#nestedatt--attachment--instance)) - - -### Nested Schema for `attachment.attached_at` - -Read-Only: - -- `string1` (String) -- `string2` (String) - - - -### Nested Schema for `attachment.instance` - -Read-Only: - -- `created_at` (Attributes) (see [below for nested schema](#nestedatt--attachment--instance--created_at)) -- `id` (String) -- `name` (String) -- `state` (String) -- `status` (String) -- `updated_at` (Attributes) (see [below for nested schema](#nestedatt--attachment--instance--updated_at)) - - -### Nested Schema for `attachment.instance.created_at` - -Read-Only: - -- `string1` (String) -- `string2` (String) - - - -### Nested Schema for `attachment.instance.updated_at` - -Read-Only: - -- `string1` (String) -- `string2` (String) - - - - - -### Nested Schema for `created_at` - -Read-Only: - -- `string1` (String) -- `string2` (String) - - - -### Nested Schema for `current_type` - -Read-Only: - -- `disk_type` (String) -- `id` (String) -- `iops` (Attributes) (see [below for nested schema](#nestedatt--current_type--iops)) -- `name` (String) -- `status` (String) - - -### Nested Schema for `current_type.iops` - -Read-Only: - -- `read` (Number) -- `write` (Number) - - - - -### Nested Schema for `error` - -Read-Only: - -- `message` (String) -- `slug` (String) - +Required: - -### Nested Schema for `updated_at` +- `name` (String) The name of the block storage type. Read-Only: -- `string1` (String) -- `string2` (String) +- `disk_type` (String) The disk type of the block storage. +- `id` (String) The unique identifier of the block storage type. +- `status` (String) The status of the block storage type. diff --git a/docs/resources/dbaas_instances_backups.md b/docs/resources/dbaas_instances_backups.md index 8349c7f..86ec7ca 100644 --- a/docs/resources/dbaas_instances_backups.md +++ b/docs/resources/dbaas_instances_backups.md @@ -28,6 +28,7 @@ Database instances management. | backups - `engine_id` (String) - `finished_at` (String) - `id` (String) Value referring to backup Id. +- `instance` (Attributes) This response object provides details about a database instance associated with a backup. It is provided only if the originating database instance of the backup is not deleted. If the originating instance is deleted, no instance details will be provided. (see [below for nested schema](#nestedatt--instance)) - `location` (String) - `name` (String) - `size` (Number) Backup file size in kilobytes (1024 kilobytes = 1 megabyte). @@ -35,3 +36,11 @@ Database instances management. | backups - `status` (String) An enumeration. - `type` (String) An enumeration. - `updated_at` (String) + + +### Nested Schema for `instance` + +Read-Only: + +- `id` (String) Database instance unique identifier. +- `name` (String) Database instance unique name. diff --git a/docs/resources/object_storage_buckets.md b/docs/resources/object_storage_buckets.md index 3c393d5..b3b7616 100644 --- a/docs/resources/object_storage_buckets.md +++ b/docs/resources/object_storage_buckets.md @@ -3,7 +3,7 @@ page_title: "mgc_object_storage_buckets Resource - terraform-provider-mgc" subcategory: "Object Storage" description: |- - Bucket operations for Object Storage API + An object storage bucket. --- # mgc_object_storage_buckets (Resource) @@ -24,60 +24,63 @@ resource "mgc_object_storage_buckets" "my-bucket" { ### Required -- `bucket` (String) Name of the bucket to be created -- `bucket_is_prefix` (Boolean) Use bucket name as prefix value to generate a unique bucket name +- `bucket` (String) Name of the bucket to be created. +- `bucket_is_prefix` (Boolean) Use bucket name as prefix value to generate a unique bucket name. ### Optional -- `authenticated_read` (Boolean) Owner gets FULL_CONTROL. Authenticated users have READ rights +- `authenticated_read` (Boolean) Owner gets FULL_CONTROL. Authenticated users have READ rights. - `aws_exec_read` (Boolean) -- `enable_versioning` (Boolean) Enable versioning for this bucket -- `grant_full_control` (Attributes List) Grantees get FULL_CONTROL (see [below for nested schema](#nestedatt--grant_full_control)) -- `grant_read` (Attributes List) Allows grantees to list the objects in the bucket (see [below for nested schema](#nestedatt--grant_read)) -- `grant_read_acp` (Attributes List) Allows grantees to read the bucket ACL (see [below for nested schema](#nestedatt--grant_read_acp)) -- `grant_write` (Attributes List) Allows grantees to create objects in the bucket (see [below for nested schema](#nestedatt--grant_write)) -- `grant_write_acp` (Attributes List) Allows grantees to write the ACL for the applicable bucket (see [below for nested schema](#nestedatt--grant_write_acp)) -- `private` (Boolean) Owner gets FULL_CONTROL. Delegated users have access. No one else has access rights -- `public_read` (Boolean) Owner gets FULL_CONTROL. Everyone else has READ rights -- `public_read_write` (Boolean) Owner gets FULL_CONTROL. Everyone else has READ and WRITE rights -- `recursive` (Boolean) Delete bucket including objects inside +- `enable_versioning` (Boolean) Enable versioning for this bucket. +- `grant_full_control` (Attributes) Allows grantees FULL_CONTROL. (see [below for nested schema](#nestedatt--grant_full_control)) +- `grant_read` (Attributes) Allows grantees to list the objects in the bucket. (see [below for nested schema](#nestedatt--grant_read)) +- `grant_read_acp` (Attributes) Allows grantees to read the bucket ACL. (see [below for nested schema](#nestedatt--grant_read_acp)) +- `grant_write` (Attributes) Allows grantees to create objects in the bucket. (see [below for nested schema](#nestedatt--grant_write)) +- `grant_write_acp` (Attributes) Allows grantees to write the ACL for the applicable bucket. (see [below for nested schema](#nestedatt--grant_write_acp)) +- `private` (Boolean) Owner gets FULL_CONTROL. Delegated users have access. No one else has access rights. +- `public_read` (Boolean) Owner gets FULL_CONTROL. Everyone else has READ rights. +- `public_read_write` (Boolean) Owner gets FULL_CONTROL. Everyone else has READ and WRITE rights. +- `recursive` (Boolean) Delete bucket including objects inside. - +### Read-Only + +- `final_name` (String) Final name of the bucket, including the prefix and auto-generated suffix. + ### Nested Schema for `grant_full_control` Required: -- `id` (String) Either a Tenant ID or a User Project ID +- `id` (String) Either a Tenant ID or a User Project ID. - + ### Nested Schema for `grant_read` Required: -- `id` (String) Either a Tenant ID or a User Project ID +- `id` (String) Either a Tenant ID or a User Project ID. - + ### Nested Schema for `grant_read_acp` Required: -- `id` (String) Either a Tenant ID or a User Project ID +- `id` (String) Either a Tenant ID or a User Project ID. - + ### Nested Schema for `grant_write` Required: -- `id` (String) Either a Tenant ID or a User Project ID +- `id` (String) Either a Tenant ID or a User Project ID. - + ### Nested Schema for `grant_write_acp` Required: -- `id` (String) Either a Tenant ID or a User Project ID +- `id` (String) Either a Tenant ID or a User Project ID.