diff --git a/docs/guides/env-variables.md b/docs/guides/env-variables.md new file mode 100644 index 0000000..e26213d --- /dev/null +++ b/docs/guides/env-variables.md @@ -0,0 +1,74 @@ +--- +page_title: "Environment Variables MGC" +subcategory: "Guides" +description: |- + How to use Environment Variables in MGC Cloud. +--- + +# Environment Variables MGC + +## Introduction + +This documentation describes how to configure and use the following environment variables for Terraform and the CLI: + +- `MGC_API_KEY` +- `MGC_OBJ_KEY_ID` +- `MGC_OBJ_KEY_SECRET` +- `MGC_REGION` +- `MGC_ENV` + +These environment variables are used for authentication and environment configuration when interacting with the provided infrastructure and services. + +1. `MGC_API_KEY` - +API key for authentication. [More information](/docs/terraform/how-to/auth#autenticação-com-api-key). + +2. `MGC_OBJ_KEY_ID` - +Key ID to access the Object Storage product. [More information](/docs/terraform/how-to/auth#autenticação-com-api-key). + +3. `MGC_OBJ_KEY_SECRET` - +*Secret* of the key to access the Object Storage product. [More information](/docs/terraform/how-to/auth#autenticação-com-api-key). + +4. `MGC_REGION` - +Specifies the region where resources will be created and managed. + +5. `MGC_ENV` - +Defines the operating environment to differentiate between different phases of development.. + + +## Configuration in Terraform + +Example: + +```hcl +provider "mgc" { + alias = "nordeste" + region = var.mgc_region + api_key = var.mgc_api_key + object_storage = { + key_pair = { + key_id = var.mgc_obj_key_id + key_secret = var.mgc_obj_key_secret + } + } +} + +variable "mgc_api_key" { + description = "API key for authentication." +} + +variable "mgc_obj_key_id" { + description = "Key ID to access the Object Storage product." +} + +variable "mgc_obj_key_secret" { + description = "Secret of the key to access the Object Storage product." +} + +variable "mgc_region" { + description = "Specifies the region where resources will be created and managed." +} + +variable "mgc_env" { + description = "Defines the operating environment" +} +``` \ No newline at end of file diff --git a/docs/resources/block_storage_snapshots.md b/docs/resources/block_storage_snapshots.md index 71dc35f..ea5e1b8 100644 --- a/docs/resources/block_storage_snapshots.md +++ b/docs/resources/block_storage_snapshots.md @@ -1,43 +1,58 @@ --- -# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "mgc_block_storage_snapshots Resource - terraform-provider-mgc" -subcategory: "" +subcategory: "Block Storage" description: |- Operations with snapshots for volumes. --- # mgc_block_storage_snapshots (Resource) -Operations with snapshots for volumes. +## Introduction +The mgc_block_storage_snapshots resource allows you to manage snapshots of block storage volumes in Magalu Cloud. Snapshots are useful for backup and restore operations, enabling you to capture the state of a volume at a specific point in time. For more information see the [official documentation](https://docs.magalu.cloud/docs/block-storage/overview). +## Example Usage - -## Schema +```hcl +resource "mgc_block_storage_snapshots" "snapshot_example" { + description = "example of description" + name = "exemplo snapshot name" + volume = { + id = mgc_block_storage_volumes.example_volume.id + } +} +``` -### Required +-> For more examples, you can visit the [Magalu Cloud Terraform example repository.](https://github.com/MagaluCloud/terraform-examples) -- `description` (String) -- `name` (String) -- `volume` (Attributes) (see [below for nested schema](#nestedatt--volume)) + +## Arguments Reference -### Read-Only +### Required -- `created_at` (Attributes) (see [below for nested schema](#nestedatt--created_at)) -- `current_volume` (Attributes) (see [below for nested schema](#nestedatt--current_volume)) -- `id` (String) The ID of this resource. -- `size` (Number) -- `state` (String) -- `status` (String) -- `updated_at` (Attributes) (see [below for nested schema](#nestedatt--updated_at)) +- `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)) ### Nested Schema for `volume` -Optional: +Required: + +- `id` (String): ID of the volume. +- `name` (String): Name of the volume. -- `id` (String) -- `name` (String) +-> 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)) @@ -45,34 +60,65 @@ Optional: Read-Only: -- `string1` (String) -- `string2` (String) +- `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" + }, +``` ### Nested Schema for `current_volume` Read-Only: -- `id` (String) -- `name` (String) -- `size` (Number) -- `type` (Attributes) (see [below for nested schema](#nestedatt--current_volume--type)) +- `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)) + +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) -- `name` (String) - +- `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: -- `string1` (String) -- `string2` (String) +- `string1` (String): Timestamp of when the snapshot was last updated +- `string2` (String): Timestamp of when the snapshot was last updated + +Example: +```hcl +"updated_at": { + "string1": "2024-07-12T13:45:06Z", + "string2": "2024-07-12T13:45:06Z" + }, +``` diff --git a/docs/resources/block_storage_volume_attachment.md b/docs/resources/block_storage_volume_attachment.md index 8bdc7e0..463bde5 100644 --- a/docs/resources/block_storage_volume_attachment.md +++ b/docs/resources/block_storage_volume_attachment.md @@ -1,7 +1,7 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "mgc_block_storage_volume_attachment Resource - terraform-provider-mgc" -subcategory: "" +subcategory: "Block Storage" description: |- Block Storage Volume Attachment --- diff --git a/docs/resources/block_storage_volumes.md b/docs/resources/block_storage_volumes.md index cd4f493..2c4d3b4 100644 --- a/docs/resources/block_storage_volumes.md +++ b/docs/resources/block_storage_volumes.md @@ -1,7 +1,7 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "mgc_block_storage_volumes Resource - terraform-provider-mgc" -subcategory: "" +subcategory: "Block Storage" description: |- Operations with volumes, including create, delete, extend, retype, list and other actions. --- diff --git a/docs/resources/container_registry_registries.md b/docs/resources/container_registry_registries.md index 6a9904c..b65ed40 100644 --- a/docs/resources/container_registry_registries.md +++ b/docs/resources/container_registry_registries.md @@ -1,7 +1,7 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "mgc_container_registry_registries Resource - terraform-provider-mgc" -subcategory: "" +subcategory: "Kubernetes" description: |- Routes related to creation, listing and deletion of registries. --- diff --git a/docs/resources/dbaas_instances.md b/docs/resources/dbaas_instances.md index 76064a6..ad37a96 100644 --- a/docs/resources/dbaas_instances.md +++ b/docs/resources/dbaas_instances.md @@ -1,7 +1,7 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "mgc_dbaas_instances Resource - terraform-provider-mgc" -subcategory: "" +subcategory: "Database" description: |- Database instances management. --- diff --git a/docs/resources/dbaas_instances_backups.md b/docs/resources/dbaas_instances_backups.md index 1d0c694..8349c7f 100644 --- a/docs/resources/dbaas_instances_backups.md +++ b/docs/resources/dbaas_instances_backups.md @@ -1,7 +1,7 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "mgc_dbaas_instances_backups Resource - terraform-provider-mgc" -subcategory: "" +subcategory: "Database" description: |- Database instances management. | backups --- diff --git a/docs/resources/dbaas_replicas.md b/docs/resources/dbaas_replicas.md index f627bf0..f8c9dd6 100644 --- a/docs/resources/dbaas_replicas.md +++ b/docs/resources/dbaas_replicas.md @@ -1,7 +1,7 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "mgc_dbaas_replicas Resource - terraform-provider-mgc" -subcategory: "" +subcategory: "Database" description: |- Database replicas management. --- diff --git a/docs/resources/kubernetes_cluster.md b/docs/resources/kubernetes_cluster.md index 6d7d127..0b0081f 100644 --- a/docs/resources/kubernetes_cluster.md +++ b/docs/resources/kubernetes_cluster.md @@ -1,7 +1,7 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "mgc_kubernetes_cluster Resource - terraform-provider-mgc" -subcategory: "" +subcategory: "Kubernetes" description: |- Endpoints related to the creation, listing, deletion, and retrieval of the kubeconfig for a Kubernetes cluster. --- diff --git a/docs/resources/kubernetes_nodepool.md b/docs/resources/kubernetes_nodepool.md index e6fbafb..a5e25bb 100644 --- a/docs/resources/kubernetes_nodepool.md +++ b/docs/resources/kubernetes_nodepool.md @@ -1,7 +1,7 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "mgc_kubernetes_nodepool Resource - terraform-provider-mgc" -subcategory: "" +subcategory: "Kubernetes" description: |- Endpoints related to the creation, listing of nodepools and nodes, updating, and deletion of nodepools for a Kubernetes cluster. --- diff --git a/docs/resources/network_ports.md b/docs/resources/network_ports.md index 7ad6e4c..1a42736 100644 --- a/docs/resources/network_ports.md +++ b/docs/resources/network_ports.md @@ -1,7 +1,7 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "mgc_network_ports Resource - terraform-provider-mgc" -subcategory: "" +subcategory: "Network" description: |- VPC Port --- diff --git a/docs/resources/network_ports_security_group_attachment.md b/docs/resources/network_ports_security_group_attachment.md index b992d47..ffc4adc 100644 --- a/docs/resources/network_ports_security_group_attachment.md +++ b/docs/resources/network_ports_security_group_attachment.md @@ -1,7 +1,7 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "mgc_network_ports_security_group_attachment Resource - terraform-provider-mgc" -subcategory: "" +subcategory: "Network" description: |- Manage the attachment between a Security Group and a Port --- diff --git a/docs/resources/network_public_ips.md b/docs/resources/network_public_ips.md index cf9a98d..e472b88 100644 --- a/docs/resources/network_public_ips.md +++ b/docs/resources/network_public_ips.md @@ -1,7 +1,7 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "mgc_network_public_ips Resource - terraform-provider-mgc" -subcategory: "" +subcategory: "Network" description: |- VPC Public IPs --- diff --git a/docs/resources/network_public_ips_port_attachment.md b/docs/resources/network_public_ips_port_attachment.md index 78f2833..642e8b0 100644 --- a/docs/resources/network_public_ips_port_attachment.md +++ b/docs/resources/network_public_ips_port_attachment.md @@ -1,7 +1,7 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "mgc_network_public_ips_port_attachment Resource - terraform-provider-mgc" -subcategory: "" +subcategory: "Network" description: |- Manage the attachment between a Public IP and a Port --- diff --git a/docs/resources/network_rules.md b/docs/resources/network_rules.md index db5273b..c0eab4c 100644 --- a/docs/resources/network_rules.md +++ b/docs/resources/network_rules.md @@ -1,7 +1,7 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "mgc_network_rules Resource - terraform-provider-mgc" -subcategory: "" +subcategory: "Network" description: |- VPC Rules --- diff --git a/docs/resources/network_security_groups.md b/docs/resources/network_security_groups.md index 876c148..1fa2e3e 100644 --- a/docs/resources/network_security_groups.md +++ b/docs/resources/network_security_groups.md @@ -1,7 +1,7 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "mgc_network_security_groups Resource - terraform-provider-mgc" -subcategory: "" +subcategory: "Network" description: |- VPC Security Groups --- diff --git a/docs/resources/network_vpcs.md b/docs/resources/network_vpcs.md index 42017e5..ec4d33a 100644 --- a/docs/resources/network_vpcs.md +++ b/docs/resources/network_vpcs.md @@ -1,7 +1,7 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "mgc_network_vpcs Resource - terraform-provider-mgc" -subcategory: "" +subcategory: "Network" description: |- Virtual Private Cloud (VPC) --- diff --git a/docs/resources/object_storage_buckets.md b/docs/resources/object_storage_buckets.md index e922128..31b10d0 100644 --- a/docs/resources/object_storage_buckets.md +++ b/docs/resources/object_storage_buckets.md @@ -1,7 +1,7 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "mgc_object_storage_buckets Resource - terraform-provider-mgc" -subcategory: "" +subcategory: "Object Storage" description: |- Bucket operations for Object Storage API --- diff --git a/docs/resources/virtual_machine_instances.md b/docs/resources/virtual_machine_instances.md index 35ef759..0dea6d7 100644 --- a/docs/resources/virtual_machine_instances.md +++ b/docs/resources/virtual_machine_instances.md @@ -1,7 +1,7 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "mgc_virtual_machine_instances Resource - terraform-provider-mgc" -subcategory: "" +subcategory: "Virtual Machine" description: |- Operations with instances, including create, delete, start, stop, reboot and other actions. --- diff --git a/docs/resources/virtual_machine_snapshots.md b/docs/resources/virtual_machine_snapshots.md index 90b1567..bcaa2da 100644 --- a/docs/resources/virtual_machine_snapshots.md +++ b/docs/resources/virtual_machine_snapshots.md @@ -1,7 +1,7 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "mgc_virtual_machine_snapshots Resource - terraform-provider-mgc" -subcategory: "" +subcategory: "Virtual Machine" description: |- Operations with snapshots for instances. ---