An open API service indexing awesome lists of open source software.

https://github.com/zoro16/terraform-hcloud-volume

Terraform module to provision Volume resouces in Hetzner Cloud
https://github.com/zoro16/terraform-hcloud-volume

hcloud-volume hetzner hetzner-cloud terraform-hcloud-volume terraform-hetzner-cloud terraform-modules

Last synced: about 1 year ago
JSON representation

Terraform module to provision Volume resouces in Hetzner Cloud

Awesome Lists containing this project

README

          

## Description

Terraform module to provision `Volume` and `Volume Attachment` resources in Hetzner Cloud.

## Usage

```hcl
# Configure the Hetzner Cloud Provider
provider "hcloud" {
token = var.hcloud_token
}

module "sv" {
source = "zoro16/server/hcloud"
version = "1.0.0"

create_server = true

server_name = "sample-server"
server_type = "cax11"
location = "fsn1"
backups = true
image = "debian-12"

placement_group_name = "placement-group-sample"

public_net_ipv4_enabled = true
public_net_ipv6_enabled = true
}

module "vol" {
source = "../../"

create_volume = true
volume_size = 10
volume_name = "example-vol1"
volume_automount = false
volume_format = "xfs"
volume_server_id = module.sv.server_id
# volume_location = "fsn1"
}
```

## Requirements

| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 1.2.0 |
| [hcloud](#requirement\_hcloud) | >= 1.42.1 |

## Providers

| Name | Version |
|------|---------|
| [hcloud](#provider\_hcloud) | >= 1.42.1 |

## Modules

No modules.

## Resources

| Name | Type |
|------|------|
| [hcloud_volume.vol](https://registry.terraform.io/providers/hetznercloud/hcloud/latest/docs/resources/volume) | resource |
| [hcloud_volume_attachment.vol_attach](https://registry.terraform.io/providers/hetznercloud/hcloud/latest/docs/resources/volume_attachment) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [create\_volume](#input\_create\_volume) | A boolean to check whether to create a Volume or not. | `bool` | `false` | no |
| [create\_volume\_attachment](#input\_create\_volume\_attachment) | A boolean to check whether to create a Volume Attachment or not. | `bool` | `false` | no |
| [volume\_attachment\_automount](#input\_volume\_attachment\_automount) | Automount the volume upon attaching it. | `bool` | `false` | no |
| [volume\_attachment\_server\_id](#input\_volume\_attachment\_server\_id) | Server to attach the Volume to. | `number` | `null` | no |
| [volume\_attachment\_volume\_id](#input\_volume\_attachment\_volume\_id) | ID of the Volume. | `number` | `null` | no |
| [volume\_automount](#input\_volume\_automount) | Automount the volume upon attaching it (server\_id must be provided). | `bool` | `true` | no |
| [volume\_delete\_protection](#input\_volume\_delete\_protection) | Enable or disable delete protection. | `bool` | `false` | no |
| [volume\_format](#input\_volume\_format) | Format volume after creation. `xfs` or `ext4` | `string` | `"xfs"` | no |
| [volume\_location](#input\_volume\_location) | The location name of the volume to create, not allowed if `server_id` argument is passed. | `string` | `null` | no |
| [volume\_name](#input\_volume\_name) | Name of the Volume to be created. | `string` | `""` | no |
| [volume\_server\_id](#input\_volume\_server\_id) | Server to attach the Volume to, not allowed if location argument is passed. | `number` | `null` | no |
| [volume\_size](#input\_volume\_size) | Size of the Volume to be created in GB. | `number` | `10` | no |

## Outputs

| Name | Description |
|------|-------------|
| [volume\_attachment\_id](#output\_volume\_attachment\_id) | Unique ID of the Volume Attachment. |
| [volume\_attachment\_server\_id](#output\_volume\_attachment\_server\_id) | Server to attach the Volume to. |
| [volume\_attachment\_volume\_id](#output\_volume\_attachment\_volume\_id) | ID of the Volume. |
| [volume\_delete\_protection](#output\_volume\_delete\_protection) | Enable or disable delete protection. |
| [volume\_format](#output\_volume\_format) | Format volume after creation. `xfs` or `ext4`. |
| [volume\_id](#output\_volume\_id) | Unique ID of the volume. |
| [volume\_labels](#output\_volume\_labels) | User-defined labels (key-value pairs). |
| [volume\_linux\_device](#output\_volume\_linux\_device) | Device path on the file system for the Volume. |
| [volume\_location](#output\_volume\_location) | The location name of the volume to create, not allowed if `server_id` argument is passed. |
| [volume\_name](#output\_volume\_name) | Name of the Volume to be created. |
| [volume\_server\_id](#output\_volume\_server\_id) | Server to attach the Volume to, not allowed if location argument is passed. |
| [volume\_size](#output\_volume\_size) | Size of the Volume to be created in GB. |