Skip to content

Commit

Permalink
Merge pull request #34 from MagaluCloud/fix/tf-docs
Browse files Browse the repository at this point in the history
docs: Update block storage volume and attachment resources documentation
  • Loading branch information
publi0 authored Aug 6, 2024
2 parents dcd21da + 7bcb3a0 commit 264dd8d
Show file tree
Hide file tree
Showing 6 changed files with 141 additions and 225 deletions.
61 changes: 61 additions & 0 deletions docs/guides/region.md
Original file line number Diff line number Diff line change
@@ -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"
}
}
```
106 changes: 19 additions & 87 deletions docs/resources/block_storage_snapshots.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

<!-- schema generated by tfplugindocs -->
## 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))

<a id="nestedatt--volume"></a>
### 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))


<a id="nestedatt--created_at"></a>
### 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

<a id="nestedatt--current_volume"></a>
### 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
},
```

<a id="nestedatt--current_volume--type"></a>
### 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"
},
```

<a id="nestedatt--updated_at"></a>
### Nested Schema for `updated_at`

Read-Only:
<a id="nestedatt--volume"></a>
### 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
6 changes: 3 additions & 3 deletions docs/resources/block_storage_volume_attachment.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ resource "mgc_block_storage_volume_attachment" "attach_example" {
<!-- schema generated by tfplugindocs -->
## 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.
133 changes: 22 additions & 111 deletions docs/resources/block_storage_volumes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand All @@ -20,128 +21,38 @@ resource "mgc_block_storage_volumes" "example_volume" {
}
```


<!-- schema generated by tfplugindocs -->
## 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.

<a id="nestedatt--type"></a>
### Nested Schema for `type`

Optional:

- `id` (String)
- `name` (String)


<a id="nestedatt--attachment"></a>
### 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))

<a id="nestedatt--attachment--attached_at"></a>
### Nested Schema for `attachment.attached_at`

Read-Only:

- `string1` (String)
- `string2` (String)


<a id="nestedatt--attachment--instance"></a>
### 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))

<a id="nestedatt--attachment--instance--created_at"></a>
### Nested Schema for `attachment.instance.created_at`

Read-Only:

- `string1` (String)
- `string2` (String)


<a id="nestedatt--attachment--instance--updated_at"></a>
### Nested Schema for `attachment.instance.updated_at`

Read-Only:

- `string1` (String)
- `string2` (String)




<a id="nestedatt--created_at"></a>
### Nested Schema for `created_at`

Read-Only:

- `string1` (String)
- `string2` (String)


<a id="nestedatt--current_type"></a>
### 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)

<a id="nestedatt--current_type--iops"></a>
### Nested Schema for `current_type.iops`

Read-Only:

- `read` (Number)
- `write` (Number)



<a id="nestedatt--error"></a>
### Nested Schema for `error`

Read-Only:

- `message` (String)
- `slug` (String)

Required:

<a id="nestedatt--updated_at"></a>
### 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.
9 changes: 9 additions & 0 deletions docs/resources/dbaas_instances_backups.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,19 @@ 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).
- `started_at` (String)
- `status` (String) An enumeration.
- `type` (String) An enumeration.
- `updated_at` (String)

<a id="nestedatt--instance"></a>
### Nested Schema for `instance`

Read-Only:

- `id` (String) Database instance unique identifier.
- `name` (String) Database instance unique name.
Loading

0 comments on commit 264dd8d

Please sign in to comment.