diff --git a/CHANGELOG.md b/CHANGELOG.md index b76e247..ceea495 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,30 @@ -## 0.1.0 (Unreleased) +## 1.0.0 (2026-03-16) + +Complete rewrite of the VirtFusion Terraform provider. + +BREAKING CHANGES: + +* Provider rewritten using Terraform Plugin Framework (previously SDKv2). State from v0.x is not compatible. +* `virtfusion_ssh` resource renamed to `virtfusion_ssh_key`. +* `virtfusion_build` resource renamed to `virtfusion_server_build`. +* Server data source schema changed: `user_id` replaced with `owner_id`, resource fields (cpu_cores, memory, storage) removed from list view (available on single server data source). +* IP block `type` attribute changed from string to int64 (4=IPv4, 6=IPv6). Gateway/netmask now sourced from nested IPv4 object. FEATURES: + +* **20 managed resources**: server, server_build, server_firewall, server_ipv4, server_network_whitelist, server_traffic_block, server_power_action, server_password_reset, ssh_key, user, user_auth_token, user_server_auth_token, user_password_reset, ip_block_range, self_service_credit, self_service_resource_pack, self_service_hourly_group_profile, self_service_hourly_resource_pack, self_service_resource_group_profile, self_service_pack_servers_action. +* **30 data sources**: server, servers, servers_by_user, server_backups, server_firewall, server_templates, server_traffic, server_traffic_blocks, server_vnc, hypervisor, hypervisors, hypervisor_group, hypervisor_groups, hypervisor_group_resources, package, packages, package_templates, ip_block, ip_blocks, ssh_key, ssh_keys_by_user, user, dns_service, iso, queue_item, self_service_currencies, self_service_resource_pack, self_service_hourly_stats, self_service_report, self_service_usage. +* Automatic multipage pagination for all list data sources via `GetAllPages` client method. +* Configurable `results` attribute on all list data sources (default: 300). +* Provider endpoint accepts hostname, full URL, or URL with `/api/v1` path — normalizes automatically. +* Environment variable support: `VIRTFUSION_ENDPOINT` and `VIRTFUSION_API_TOKEN`. + +SECURITY: + +* URL path injection prevention: all user-supplied strings are escaped with `url.PathEscape` before URL interpolation. +* Sensitive attributes: `api_token`, auth token `token` and `url`, and password reset `password` fields are marked sensitive. +* API error response bodies truncated to 500 bytes to prevent leaking sensitive data. + +## 0.0.3 (2023-06-16) + +* Initial public release with basic server, build, and SSH key resources. diff --git a/docs/data-sources/dns_service.md b/docs/data-sources/dns_service.md new file mode 100644 index 0000000..a444998 --- /dev/null +++ b/docs/data-sources/dns_service.md @@ -0,0 +1,25 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_dns_service Data Source - virtfusion" +subcategory: "" +description: |- + Fetches a single VirtFusion DNS service by ID. +--- + +# virtfusion_dns_service (Data Source) + +Fetches a single VirtFusion DNS service by ID. + + + + +## Schema + +### Required + +- `id` (Number) The DNS service ID. + +### Read-Only + +- `name` (String) The DNS service name. +- `type` (String) The DNS service type. diff --git a/docs/data-sources/hypervisor.md b/docs/data-sources/hypervisor.md new file mode 100644 index 0000000..4b5049a --- /dev/null +++ b/docs/data-sources/hypervisor.md @@ -0,0 +1,27 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_hypervisor Data Source - virtfusion" +subcategory: "" +description: |- + Fetches a single VirtFusion hypervisor by ID. +--- + +# virtfusion_hypervisor (Data Source) + +Fetches a single VirtFusion hypervisor by ID. + + + + +## Schema + +### Required + +- `id` (Number) The hypervisor ID. + +### Read-Only + +- `enabled` (Boolean) Whether the hypervisor is enabled. +- `hostname` (String) The hypervisor hostname. +- `name` (String) The hypervisor name. +- `type` (String) The hypervisor type. diff --git a/docs/data-sources/hypervisor_group.md b/docs/data-sources/hypervisor_group.md new file mode 100644 index 0000000..3537554 --- /dev/null +++ b/docs/data-sources/hypervisor_group.md @@ -0,0 +1,25 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_hypervisor_group Data Source - virtfusion" +subcategory: "" +description: |- + Fetches a single VirtFusion hypervisor group by ID. +--- + +# virtfusion_hypervisor_group (Data Source) + +Fetches a single VirtFusion hypervisor group by ID. + + + + +## Schema + +### Required + +- `id` (Number) The hypervisor group ID. + +### Read-Only + +- `enabled` (Boolean) Whether the hypervisor group is enabled. +- `name` (String) The hypervisor group name. diff --git a/docs/data-sources/hypervisor_group_resources.md b/docs/data-sources/hypervisor_group_resources.md new file mode 100644 index 0000000..918019f --- /dev/null +++ b/docs/data-sources/hypervisor_group_resources.md @@ -0,0 +1,30 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_hypervisor_group_resources Data Source - virtfusion" +subcategory: "" +description: |- + Fetches resource information for a VirtFusion hypervisor group. +--- + +# virtfusion_hypervisor_group_resources (Data Source) + +Fetches resource information for a VirtFusion hypervisor group. + + + + +## Schema + +### Required + +- `id` (Number) The hypervisor group ID. + +### Optional + +- `results` (Number) Maximum number of results to return. Defaults to 300. + +### Read-Only + +- `cpu_cores` (Number) The number of CPU cores available in the group. +- `memory` (Number) The amount of memory available in the group. +- `storage` (Number) The amount of storage available in the group. diff --git a/docs/data-sources/hypervisor_groups.md b/docs/data-sources/hypervisor_groups.md new file mode 100644 index 0000000..5eec1c9 --- /dev/null +++ b/docs/data-sources/hypervisor_groups.md @@ -0,0 +1,33 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_hypervisor_groups Data Source - virtfusion" +subcategory: "" +description: |- + Fetches all VirtFusion hypervisor groups. +--- + +# virtfusion_hypervisor_groups (Data Source) + +Fetches all VirtFusion hypervisor groups. + + + + +## Schema + +### Optional + +- `results` (Number) Maximum number of results to return. Defaults to 300. + +### Read-Only + +- `groups` (Attributes List) List of hypervisor groups. (see [below for nested schema](#nestedatt--groups)) + + +### Nested Schema for `groups` + +Read-Only: + +- `enabled` (Boolean) Whether the hypervisor group is enabled. +- `id` (Number) The hypervisor group ID. +- `name` (String) The hypervisor group name. diff --git a/docs/data-sources/hypervisors.md b/docs/data-sources/hypervisors.md new file mode 100644 index 0000000..05c0378 --- /dev/null +++ b/docs/data-sources/hypervisors.md @@ -0,0 +1,43 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_hypervisors Data Source - virtfusion" +subcategory: "" +description: |- + Fetches all VirtFusion hypervisors. +--- + +# virtfusion_hypervisors (Data Source) + +Fetches all VirtFusion hypervisors. + +## Example Usage + +```terraform +data "virtfusion_hypervisors" "all" {} + +output "hypervisor_names" { + value = [for h in data.virtfusion_hypervisors.all.hypervisors : h.name] +} +``` + + +## Schema + +### Optional + +- `results` (Number) Maximum number of results to return. Defaults to 300. + +### Read-Only + +- `hypervisors` (Attributes List) List of hypervisors. (see [below for nested schema](#nestedatt--hypervisors)) + + +### Nested Schema for `hypervisors` + +Read-Only: + +- `enabled` (Boolean) Whether the hypervisor is enabled. +- `hostname` (String) The hypervisor hostname. +- `id` (Number) The hypervisor ID. +- `name` (String) The hypervisor name. +- `type` (String) The hypervisor type. diff --git a/docs/data-sources/ip_block.md b/docs/data-sources/ip_block.md new file mode 100644 index 0000000..60895d9 --- /dev/null +++ b/docs/data-sources/ip_block.md @@ -0,0 +1,28 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_ip_block Data Source - virtfusion" +subcategory: "" +description: |- + Fetches a single VirtFusion IP block by ID. +--- + +# virtfusion_ip_block (Data Source) + +Fetches a single VirtFusion IP block by ID. + + + + +## Schema + +### Required + +- `id` (Number) The IP block ID. + +### Read-Only + +- `enabled` (Boolean) Whether the IP block is enabled. +- `gateway` (String) The IPv4 gateway address. +- `name` (String) The IP block name. +- `netmask` (String) The IPv4 netmask. +- `type` (Number) The IP block type (4 = IPv4, 6 = IPv6). diff --git a/docs/data-sources/ip_blocks.md b/docs/data-sources/ip_blocks.md new file mode 100644 index 0000000..f2cfa5d --- /dev/null +++ b/docs/data-sources/ip_blocks.md @@ -0,0 +1,36 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_ip_blocks Data Source - virtfusion" +subcategory: "" +description: |- + Fetches all VirtFusion IP blocks. +--- + +# virtfusion_ip_blocks (Data Source) + +Fetches all VirtFusion IP blocks. + + + + +## Schema + +### Optional + +- `results` (Number) Maximum number of results to return. Defaults to 300. + +### Read-Only + +- `ip_blocks` (Attributes List) List of IP blocks. (see [below for nested schema](#nestedatt--ip_blocks)) + + +### Nested Schema for `ip_blocks` + +Read-Only: + +- `enabled` (Boolean) Whether the IP block is enabled. +- `gateway` (String) The IPv4 gateway address. +- `id` (Number) The IP block ID. +- `name` (String) The IP block name. +- `netmask` (String) The IPv4 netmask. +- `type` (Number) The IP block type (4 = IPv4, 6 = IPv6). diff --git a/docs/data-sources/iso.md b/docs/data-sources/iso.md new file mode 100644 index 0000000..67d394d --- /dev/null +++ b/docs/data-sources/iso.md @@ -0,0 +1,24 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_iso Data Source - virtfusion" +subcategory: "" +description: |- + Fetches a single VirtFusion ISO by ID. +--- + +# virtfusion_iso (Data Source) + +Fetches a single VirtFusion ISO by ID. + + + + +## Schema + +### Required + +- `id` (Number) The ISO ID. + +### Read-Only + +- `name` (String) The ISO name. diff --git a/docs/data-sources/package.md b/docs/data-sources/package.md new file mode 100644 index 0000000..e8b4495 --- /dev/null +++ b/docs/data-sources/package.md @@ -0,0 +1,32 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_package Data Source - virtfusion" +subcategory: "" +description: |- + Fetches a single VirtFusion package by ID. +--- + +# virtfusion_package (Data Source) + +Fetches a single VirtFusion package by ID. + + + + +## Schema + +### Required + +- `id` (Number) The package ID. + +### Read-Only + +- `cpu_cores` (Number) The number of CPU cores in the package. +- `enabled` (Boolean) Whether the package is enabled. +- `ipv4` (Number) The number of IPv4 addresses in the package. +- `memory` (Number) The amount of memory in the package. +- `name` (String) The package name. +- `network_speed_inbound` (Number) The inbound network speed in the package. +- `network_speed_outbound` (Number) The outbound network speed in the package. +- `storage` (Number) The amount of storage in the package. +- `traffic` (Number) The traffic limit in the package. diff --git a/docs/data-sources/package_templates.md b/docs/data-sources/package_templates.md new file mode 100644 index 0000000..d49d977 --- /dev/null +++ b/docs/data-sources/package_templates.md @@ -0,0 +1,36 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_package_templates Data Source - virtfusion" +subcategory: "" +description: |- + Fetches templates available for a VirtFusion server package. +--- + +# virtfusion_package_templates (Data Source) + +Fetches templates available for a VirtFusion server package. + + + + +## Schema + +### Required + +- `package_id` (Number) The package ID to fetch templates for. + +### Optional + +- `results` (Number) Maximum number of results to return. Defaults to 300. + +### Read-Only + +- `templates` (Attributes List) List of templates available for the package. (see [below for nested schema](#nestedatt--templates)) + + +### Nested Schema for `templates` + +Read-Only: + +- `id` (Number) The template ID. +- `name` (String) The template name. diff --git a/docs/data-sources/packages.md b/docs/data-sources/packages.md new file mode 100644 index 0000000..7d596d0 --- /dev/null +++ b/docs/data-sources/packages.md @@ -0,0 +1,48 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_packages Data Source - virtfusion" +subcategory: "" +description: |- + Fetches all VirtFusion packages. +--- + +# virtfusion_packages (Data Source) + +Fetches all VirtFusion packages. + +## Example Usage + +```terraform +data "virtfusion_packages" "all" {} + +output "package_names" { + value = [for p in data.virtfusion_packages.all.packages : p.name] +} +``` + + +## Schema + +### Optional + +- `results` (Number) Maximum number of results to return. Defaults to 300. + +### Read-Only + +- `packages` (Attributes List) List of packages. (see [below for nested schema](#nestedatt--packages)) + + +### Nested Schema for `packages` + +Read-Only: + +- `cpu_cores` (Number) The number of CPU cores in the package. +- `enabled` (Boolean) Whether the package is enabled. +- `id` (Number) The package ID. +- `ipv4` (Number) The number of IPv4 addresses in the package. +- `memory` (Number) The amount of memory in the package. +- `name` (String) The package name. +- `network_speed_inbound` (Number) The inbound network speed in the package. +- `network_speed_outbound` (Number) The outbound network speed in the package. +- `storage` (Number) The amount of storage in the package. +- `traffic` (Number) The traffic limit in the package. diff --git a/docs/data-sources/queue_item.md b/docs/data-sources/queue_item.md new file mode 100644 index 0000000..b392a69 --- /dev/null +++ b/docs/data-sources/queue_item.md @@ -0,0 +1,26 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_queue_item Data Source - virtfusion" +subcategory: "" +description: |- + Fetches a single VirtFusion queue item by ID. +--- + +# virtfusion_queue_item (Data Source) + +Fetches a single VirtFusion queue item by ID. + + + + +## Schema + +### Required + +- `id` (Number) The queue item ID. + +### Read-Only + +- `action` (String) The queue item action. +- `created_at` (String) The creation timestamp. +- `status` (String) The queue item status. diff --git a/docs/data-sources/self_service_currencies.md b/docs/data-sources/self_service_currencies.md new file mode 100644 index 0000000..6a320da --- /dev/null +++ b/docs/data-sources/self_service_currencies.md @@ -0,0 +1,33 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_self_service_currencies Data Source - virtfusion" +subcategory: "" +description: |- + Fetches all available VirtFusion self-service currencies. +--- + +# virtfusion_self_service_currencies (Data Source) + +Fetches all available VirtFusion self-service currencies. + + + + +## Schema + +### Optional + +- `results` (Number) Maximum number of results to return. Defaults to 300. + +### Read-Only + +- `currencies` (Attributes List) List of available currencies. (see [below for nested schema](#nestedatt--currencies)) + + +### Nested Schema for `currencies` + +Read-Only: + +- `code` (String) The currency code. +- `id` (Number) The currency ID. +- `name` (String) The currency name. diff --git a/docs/data-sources/self_service_hourly_stats.md b/docs/data-sources/self_service_hourly_stats.md new file mode 100644 index 0000000..7220580 --- /dev/null +++ b/docs/data-sources/self_service_hourly_stats.md @@ -0,0 +1,25 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_self_service_hourly_stats Data Source - virtfusion" +subcategory: "" +description: |- + Fetches VirtFusion self-service hourly stats for a user and group. +--- + +# virtfusion_self_service_hourly_stats (Data Source) + +Fetches VirtFusion self-service hourly stats for a user and group. + + + + +## Schema + +### Required + +- `group_id` (Number) The group ID to fetch hourly stats for. +- `user_id` (Number) The user ID to fetch hourly stats for. + +### Read-Only + +- `stats_json` (String) The raw JSON response containing hourly stats. diff --git a/docs/data-sources/self_service_report.md b/docs/data-sources/self_service_report.md new file mode 100644 index 0000000..e8e7057 --- /dev/null +++ b/docs/data-sources/self_service_report.md @@ -0,0 +1,25 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_self_service_report Data Source - virtfusion" +subcategory: "" +description: |- + Fetches a VirtFusion self-service report for a user and group. +--- + +# virtfusion_self_service_report (Data Source) + +Fetches a VirtFusion self-service report for a user and group. + + + + +## Schema + +### Required + +- `group_id` (Number) The group ID to fetch the report for. +- `user_id` (Number) The user ID to fetch the report for. + +### Read-Only + +- `report_json` (String) The raw JSON response containing the report. diff --git a/docs/data-sources/self_service_resource_pack.md b/docs/data-sources/self_service_resource_pack.md new file mode 100644 index 0000000..b77a0e6 --- /dev/null +++ b/docs/data-sources/self_service_resource_pack.md @@ -0,0 +1,26 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_self_service_resource_pack Data Source - virtfusion" +subcategory: "" +description: |- + Fetches a single VirtFusion self-service resource pack by ID. +--- + +# virtfusion_self_service_resource_pack (Data Source) + +Fetches a single VirtFusion self-service resource pack by ID. + + + + +## Schema + +### Required + +- `id` (Number) The resource pack ID. + +### Read-Only + +- `name` (String) The resource pack name. +- `pack_id` (Number) The pack ID associated with the resource pack. +- `user_id` (Number) The user ID associated with the resource pack. diff --git a/docs/data-sources/self_service_usage.md b/docs/data-sources/self_service_usage.md new file mode 100644 index 0000000..a2deeda --- /dev/null +++ b/docs/data-sources/self_service_usage.md @@ -0,0 +1,25 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_self_service_usage Data Source - virtfusion" +subcategory: "" +description: |- + Fetches VirtFusion self-service usage data for a user and group. +--- + +# virtfusion_self_service_usage (Data Source) + +Fetches VirtFusion self-service usage data for a user and group. + + + + +## Schema + +### Required + +- `group_id` (Number) The group ID to fetch usage data for. +- `user_id` (Number) The user ID to fetch usage data for. + +### Read-Only + +- `usage_json` (String) The raw JSON response containing usage data. diff --git a/docs/data-sources/server.md b/docs/data-sources/server.md new file mode 100644 index 0000000..4db1e50 --- /dev/null +++ b/docs/data-sources/server.md @@ -0,0 +1,42 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_server Data Source - virtfusion" +subcategory: "" +description: |- + Use this data source to read a single VirtFusion server by ID. +--- + +# virtfusion_server (Data Source) + +Use this data source to read a single VirtFusion server by ID. + +## Example Usage + +```terraform +data "virtfusion_server" "example" { + id = 1 +} + +output "server_name" { + value = data.virtfusion_server.example.name +} +``` + + +## Schema + +### Required + +- `id` (Number) The server ID. + +### Read-Only + +- `cpu_cores` (Number) The number of CPU cores. +- `hostname` (String) The server hostname. +- `hypervisor_id` (Number) The hypervisor ID where the server is hosted. +- `memory` (Number) The memory size in MB. +- `name` (String) The server display name. +- `owner_id` (Number) The owner (user) ID who owns the server. +- `storage` (Number) The storage size in GB. +- `suspended` (Boolean) Whether the server is suspended. +- `uuid` (String) The server UUID. diff --git a/docs/data-sources/server_backups.md b/docs/data-sources/server_backups.md new file mode 100644 index 0000000..83d7a61 --- /dev/null +++ b/docs/data-sources/server_backups.md @@ -0,0 +1,37 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_server_backups Data Source - virtfusion" +subcategory: "" +description: |- + Use this data source to list backups for a VirtFusion server. +--- + +# virtfusion_server_backups (Data Source) + +Use this data source to list backups for a VirtFusion server. + + + + +## Schema + +### Required + +- `server_id` (Number) The server ID to list backups for. + +### Optional + +- `results` (Number) Maximum number of results to return. Defaults to 300. + +### Read-Only + +- `backups` (Attributes List) The list of backups. (see [below for nested schema](#nestedatt--backups)) + + +### Nested Schema for `backups` + +Read-Only: + +- `created_at` (String) The backup creation timestamp. +- `id` (Number) The backup ID. +- `type` (String) The backup type. diff --git a/docs/data-sources/server_firewall.md b/docs/data-sources/server_firewall.md new file mode 100644 index 0000000..d586c6a --- /dev/null +++ b/docs/data-sources/server_firewall.md @@ -0,0 +1,40 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_server_firewall Data Source - virtfusion" +subcategory: "" +description: |- + Use this data source to read firewall information for a VirtFusion server. +--- + +# virtfusion_server_firewall (Data Source) + +Use this data source to read firewall information for a VirtFusion server. + + + + +## Schema + +### Required + +- `server_id` (Number) The server ID to read firewall information for. + +### Optional + +- `interface_name` (String) The network interface name. Defaults to `eth0`. + +### Read-Only + +- `enabled` (Boolean) Whether the firewall is enabled. +- `rules` (Attributes List) The firewall rules. (see [below for nested schema](#nestedatt--rules)) + + +### Nested Schema for `rules` + +Read-Only: + +- `action` (String) The action for the rule (e.g. `accept`, `drop`). +- `direction` (String) The direction for the rule (e.g. `in`, `out`). +- `ip` (String) The IP address or CIDR for the rule. +- `port` (String) The port or port range for the rule. +- `protocol` (String) The protocol for the rule (e.g. `tcp`, `udp`). diff --git a/docs/data-sources/server_templates.md b/docs/data-sources/server_templates.md new file mode 100644 index 0000000..06de39d --- /dev/null +++ b/docs/data-sources/server_templates.md @@ -0,0 +1,36 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_server_templates Data Source - virtfusion" +subcategory: "" +description: |- + Use this data source to list available templates for a VirtFusion server. +--- + +# virtfusion_server_templates (Data Source) + +Use this data source to list available templates for a VirtFusion server. + + + + +## Schema + +### Required + +- `server_id` (Number) The server ID to list templates for. + +### Optional + +- `results` (Number) Maximum number of results to return. Defaults to 300. + +### Read-Only + +- `templates` (Attributes List) The list of available templates. (see [below for nested schema](#nestedatt--templates)) + + +### Nested Schema for `templates` + +Read-Only: + +- `id` (Number) The template ID. +- `name` (String) The template name. diff --git a/docs/data-sources/server_traffic.md b/docs/data-sources/server_traffic.md new file mode 100644 index 0000000..8401ebc --- /dev/null +++ b/docs/data-sources/server_traffic.md @@ -0,0 +1,25 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_server_traffic Data Source - virtfusion" +subcategory: "" +description: |- + Use this data source to read traffic usage for a VirtFusion server. +--- + +# virtfusion_server_traffic (Data Source) + +Use this data source to read traffic usage for a VirtFusion server. + + + + +## Schema + +### Required + +- `server_id` (Number) The server ID to read traffic for. + +### Read-Only + +- `limit` (Number) The traffic limit. +- `used` (Number) The amount of traffic used. diff --git a/docs/data-sources/server_traffic_blocks.md b/docs/data-sources/server_traffic_blocks.md new file mode 100644 index 0000000..6a443f9 --- /dev/null +++ b/docs/data-sources/server_traffic_blocks.md @@ -0,0 +1,36 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_server_traffic_blocks Data Source - virtfusion" +subcategory: "" +description: |- + Use this data source to list traffic blocks for a VirtFusion server. +--- + +# virtfusion_server_traffic_blocks (Data Source) + +Use this data source to list traffic blocks for a VirtFusion server. + + + + +## Schema + +### Required + +- `server_id` (Number) The server ID to list traffic blocks for. + +### Optional + +- `results` (Number) Maximum number of results to return. Defaults to 300. + +### Read-Only + +- `blocks` (Attributes List) The list of traffic blocks. (see [below for nested schema](#nestedatt--blocks)) + + +### Nested Schema for `blocks` + +Read-Only: + +- `id` (Number) The traffic block ID. +- `type` (String) The traffic block type. diff --git a/docs/data-sources/server_vnc.md b/docs/data-sources/server_vnc.md new file mode 100644 index 0000000..fef1d25 --- /dev/null +++ b/docs/data-sources/server_vnc.md @@ -0,0 +1,24 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_server_vnc Data Source - virtfusion" +subcategory: "" +description: |- + Use this data source to read VNC connection information for a VirtFusion server. +--- + +# virtfusion_server_vnc (Data Source) + +Use this data source to read VNC connection information for a VirtFusion server. + + + + +## Schema + +### Required + +- `server_id` (Number) The server ID to read VNC information for. + +### Read-Only + +- `url` (String, Sensitive) The VNC connection URL. diff --git a/docs/data-sources/servers.md b/docs/data-sources/servers.md new file mode 100644 index 0000000..8daf5c8 --- /dev/null +++ b/docs/data-sources/servers.md @@ -0,0 +1,37 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_servers Data Source - virtfusion" +subcategory: "" +description: |- + Use this data source to list all VirtFusion servers. +--- + +# virtfusion_servers (Data Source) + +Use this data source to list all VirtFusion servers. + + + + +## Schema + +### Optional + +- `results` (Number) Maximum number of results to return. Defaults to 300. + +### Read-Only + +- `servers` (Attributes List) The list of servers. (see [below for nested schema](#nestedatt--servers)) + + +### Nested Schema for `servers` + +Read-Only: + +- `hostname` (String) The server hostname. +- `hypervisor_id` (Number) The hypervisor ID where the server is hosted. +- `id` (Number) The server ID. +- `name` (String) The server display name. +- `owner_id` (Number) The owner (user) ID who owns the server. +- `suspended` (Boolean) Whether the server is suspended. +- `uuid` (String) The server UUID. diff --git a/docs/data-sources/servers_by_user.md b/docs/data-sources/servers_by_user.md new file mode 100644 index 0000000..3959873 --- /dev/null +++ b/docs/data-sources/servers_by_user.md @@ -0,0 +1,41 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_servers_by_user Data Source - virtfusion" +subcategory: "" +description: |- + Use this data source to list all VirtFusion servers owned by a specific user. +--- + +# virtfusion_servers_by_user (Data Source) + +Use this data source to list all VirtFusion servers owned by a specific user. + + + + +## Schema + +### Required + +- `user_id` (Number) The user ID to filter servers by. + +### Optional + +- `results` (Number) Maximum number of results to return. Defaults to 300. + +### Read-Only + +- `servers` (Attributes List) The list of servers owned by the user. (see [below for nested schema](#nestedatt--servers)) + + +### Nested Schema for `servers` + +Read-Only: + +- `hostname` (String) The server hostname. +- `hypervisor_id` (Number) The hypervisor ID where the server is hosted. +- `id` (Number) The server ID. +- `name` (String) The server display name. +- `owner_id` (Number) The owner (user) ID who owns the server. +- `suspended` (Boolean) Whether the server is suspended. +- `uuid` (String) The server UUID. diff --git a/docs/data-sources/ssh_key.md b/docs/data-sources/ssh_key.md new file mode 100644 index 0000000..10f88c9 --- /dev/null +++ b/docs/data-sources/ssh_key.md @@ -0,0 +1,30 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_ssh_key Data Source - virtfusion" +subcategory: "" +description: |- + Fetches a single VirtFusion SSH key by ID. +--- + +# virtfusion_ssh_key (Data Source) + +Fetches a single VirtFusion SSH key by ID. + + + + +## Schema + +### Required + +- `id` (Number) The SSH key ID. + +### Read-Only + +- `created_at` (String) The creation timestamp. +- `enabled` (Boolean) Whether the SSH key is enabled. +- `name` (String) The SSH key name. +- `public_key` (String) The public key content. +- `type` (String) The SSH key type. +- `updated_at` (String) The last update timestamp. +- `user_id` (Number) The ID of the user who owns this SSH key. diff --git a/docs/data-sources/ssh_keys_by_user.md b/docs/data-sources/ssh_keys_by_user.md new file mode 100644 index 0000000..d825c54 --- /dev/null +++ b/docs/data-sources/ssh_keys_by_user.md @@ -0,0 +1,39 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_ssh_keys_by_user Data Source - virtfusion" +subcategory: "" +description: |- + Fetches all SSH keys for a VirtFusion user. +--- + +# virtfusion_ssh_keys_by_user (Data Source) + +Fetches all SSH keys for a VirtFusion user. + + + + +## Schema + +### Required + +- `user_id` (Number) The user ID to fetch SSH keys for. + +### Optional + +- `results` (Number) Maximum number of results to return. Defaults to 300. + +### Read-Only + +- `ssh_keys` (Attributes List) List of SSH keys belonging to the user. (see [below for nested schema](#nestedatt--ssh_keys)) + + +### Nested Schema for `ssh_keys` + +Read-Only: + +- `enabled` (Boolean) Whether the SSH key is enabled. +- `id` (Number) The SSH key ID. +- `name` (String) The SSH key name. +- `public_key` (String) The public key content. +- `type` (String) The SSH key type. diff --git a/docs/data-sources/user.md b/docs/data-sources/user.md new file mode 100644 index 0000000..d8552a9 --- /dev/null +++ b/docs/data-sources/user.md @@ -0,0 +1,29 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_user Data Source - virtfusion" +subcategory: "" +description: |- + Fetches a VirtFusion user by external relation ID. +--- + +# virtfusion_user (Data Source) + +Fetches a VirtFusion user by external relation ID. + + + + +## Schema + +### Required + +- `ext_relation_id` (String) The external relation ID of the user. + +### Read-Only + +- `created_at` (String) The creation timestamp. +- `email` (String) The user email address. +- `enabled` (Boolean) Whether the user is enabled. +- `id` (Number) The numeric ID of the user. +- `name` (String) The user name. +- `updated_at` (String) The last update timestamp. diff --git a/docs/index.md b/docs/index.md index 664d730..ccbb69f 100644 --- a/docs/index.md +++ b/docs/index.md @@ -3,26 +3,31 @@ page_title: "virtfusion Provider" subcategory: "" description: |- - + The VirtFusion provider allows managing VirtFusion virtualization platform resources. --- # virtfusion Provider - +The VirtFusion provider allows managing VirtFusion virtualization platform resources. ## Example Usage ```terraform provider "virtfusion" { - endpoint = "example.com" - api_token = "myapikey" + endpoint = "https://cp.example.com" + api_token = var.virtfusion_api_token +} + +variable "virtfusion_api_token" { + type = string + sensitive = true } ``` ## Schema -### Required +### Optional -- `api_token` (String) The API token to use for API requests. -- `endpoint` (String) The endpoint to use for API requests. +- `api_token` (String, Sensitive) The API token for authentication. Can also be set with the `VIRTFUSION_API_TOKEN` environment variable. +- `endpoint` (String) The VirtFusion API endpoint. Can be a hostname (e.g. `cp.example.com`) or full URL (e.g. `https://cp.example.com/api/v1`). Can also be set with the `VIRTFUSION_ENDPOINT` environment variable. diff --git a/docs/resources/build.md b/docs/resources/build.md deleted file mode 100644 index 308f9d8..0000000 --- a/docs/resources/build.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -# generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "virtfusion_build Resource - terraform-provider-virtfusion" -subcategory: "" -description: |- - Virtfusion Server Build Resource ---- - -# virtfusion_build (Resource) - -Virtfusion Server Build Resource - -## Example Usage - -```terraform -resource "virtfusion_build" "node1" { - server_id = virtfusion_server.node1.id - name = "node1-demo" - hostname = "node1.example.com" - osid = 1 - vnc = true - ipv6 = true - ssh_keys = [virtfusion_ssh.dummy_key.id] - email = true -} -``` - - -## Schema - -### Required - -- `name` (String) Server Name -- `osid` (Number) Server Operating System ID -- `server_id` (Number) Server ID - -### Optional - -- `email` (Boolean) Server Email -- `hostname` (String) Server Hostname -- `ipv6` (Boolean) Server IPv6 -- `ssh_keys` (List of Number) Server SSH Keys IDs -- `vnc` (Boolean) Server VNC diff --git a/docs/resources/ip_block_range.md b/docs/resources/ip_block_range.md new file mode 100644 index 0000000..f89b676 --- /dev/null +++ b/docs/resources/ip_block_range.md @@ -0,0 +1,28 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_ip_block_range Resource - virtfusion" +subcategory: "" +description: |- + Adds an IPv4 address range to a VirtFusion IP block. This is a create-only resource — ranges cannot be deleted via the API. +--- + +# virtfusion_ip_block_range (Resource) + +Adds an IPv4 address range to a VirtFusion IP block. This is a create-only resource — ranges cannot be deleted via the API. + + + + +## Schema + +### Required + +- `end_ip` (String) The ending IP address of the range. +- `gateway` (String) The gateway address for the range. +- `ip_block_id` (Number) The ID of the IP block to add the range to. +- `netmask` (String) The netmask for the range. +- `start_ip` (String) The starting IP address of the range. + +### Read-Only + +- `id` (String) The identifier of the IP block range. diff --git a/docs/resources/self_service_credit.md b/docs/resources/self_service_credit.md new file mode 100644 index 0000000..359041f --- /dev/null +++ b/docs/resources/self_service_credit.md @@ -0,0 +1,26 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_self_service_credit Resource - virtfusion" +subcategory: "" +description: |- + Manages self-service credit in VirtFusion. Deleting this resource cancels the credit. +--- + +# virtfusion_self_service_credit (Resource) + +Manages self-service credit in VirtFusion. Deleting this resource cancels the credit. + + + + +## Schema + +### Required + +- `amount` (Number) The credit amount. +- `currency_code` (String) The currency code (e.g. `USD`, `EUR`). +- `user_id` (Number) The ID of the user to add credit to. + +### Read-Only + +- `id` (Number) The identifier of the credit entry. diff --git a/docs/resources/self_service_hourly_group_profile.md b/docs/resources/self_service_hourly_group_profile.md new file mode 100644 index 0000000..4acdbd9 --- /dev/null +++ b/docs/resources/self_service_hourly_group_profile.md @@ -0,0 +1,26 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_self_service_hourly_group_profile Resource - virtfusion" +subcategory: "" +description: |- + Manages a self-service hourly group profile assignment in VirtFusion. +--- + +# virtfusion_self_service_hourly_group_profile (Resource) + +Manages a self-service hourly group profile assignment in VirtFusion. + + + + +## Schema + +### Required + +- `group_id` (Number) The ID of the hypervisor group. +- `profile_id` (Number) The ID of the hourly profile. +- `user_id` (Number) The ID of the user. + +### Read-Only + +- `id` (String) The composite identifier of the hourly group profile (userId/groupId/profileId). diff --git a/docs/resources/self_service_hourly_resource_pack.md b/docs/resources/self_service_hourly_resource_pack.md new file mode 100644 index 0000000..61652af --- /dev/null +++ b/docs/resources/self_service_hourly_resource_pack.md @@ -0,0 +1,26 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_self_service_hourly_resource_pack Resource - virtfusion" +subcategory: "" +description: |- + Sets the hourly resource pack for a user and group in VirtFusion self-service. Changing any attribute forces recreation. +--- + +# virtfusion_self_service_hourly_resource_pack (Resource) + +Sets the hourly resource pack for a user and group in VirtFusion self-service. Changing any attribute forces recreation. + + + + +## Schema + +### Required + +- `group_id` (Number) The ID of the group. +- `resource_pack_id` (Number) The ID of the resource pack. +- `user_id` (Number) The ID of the user. + +### Read-Only + +- `id` (String) The composite identifier for this hourly resource pack assignment. diff --git a/docs/resources/self_service_pack_servers_action.md b/docs/resources/self_service_pack_servers_action.md new file mode 100644 index 0000000..79cfefa --- /dev/null +++ b/docs/resources/self_service_pack_servers_action.md @@ -0,0 +1,29 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_self_service_pack_servers_action Resource - virtfusion" +subcategory: "" +description: |- + Performs an action on all servers in a self-service resource pack. This is a trigger-style resource — the action is executed on create and can be re-triggered by changing the triggers attribute. +--- + +# virtfusion_self_service_pack_servers_action (Resource) + +Performs an action on all servers in a self-service resource pack. This is a trigger-style resource — the action is executed on create and can be re-triggered by changing the `triggers` attribute. + + + + +## Schema + +### Required + +- `action` (String) The action to perform on the pack servers. Must be one of: `suspend`, `unsuspend`, `delete`. +- `pack_id` (Number) The ID of the resource pack. + +### Optional + +- `triggers` (Map of String) A map of arbitrary strings that, when changed, will cause the action to be re-executed. Works like `triggers` in `terraform_data`. + +### Read-Only + +- `id` (String) The identifier for this pack servers action. diff --git a/docs/resources/self_service_resource_group_profile.md b/docs/resources/self_service_resource_group_profile.md new file mode 100644 index 0000000..71fe6cf --- /dev/null +++ b/docs/resources/self_service_resource_group_profile.md @@ -0,0 +1,26 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_self_service_resource_group_profile Resource - virtfusion" +subcategory: "" +description: |- + Associates a resource group profile with a user in VirtFusion self-service. Changing any attribute forces recreation of the association. +--- + +# virtfusion_self_service_resource_group_profile (Resource) + +Associates a resource group profile with a user in VirtFusion self-service. Changing any attribute forces recreation of the association. + + + + +## Schema + +### Required + +- `group_id` (Number) The ID of the resource group. +- `profile_id` (Number) The ID of the profile. +- `user_id` (Number) The ID of the user. + +### Read-Only + +- `id` (String) The composite identifier for this resource group profile association. diff --git a/docs/resources/self_service_resource_pack.md b/docs/resources/self_service_resource_pack.md new file mode 100644 index 0000000..215553d --- /dev/null +++ b/docs/resources/self_service_resource_pack.md @@ -0,0 +1,26 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_self_service_resource_pack Resource - virtfusion" +subcategory: "" +description: |- + Manages a self-service resource pack in VirtFusion. +--- + +# virtfusion_self_service_resource_pack (Resource) + +Manages a self-service resource pack in VirtFusion. + + + + +## Schema + +### Required + +- `name` (String) The name of the resource pack. +- `pack_id` (Number) The ID of the pack. +- `user_id` (Number) The ID of the user who owns the resource pack. + +### Read-Only + +- `id` (Number) The identifier of the resource pack. diff --git a/docs/resources/server.md b/docs/resources/server.md index 092157a..ae7ae39 100644 --- a/docs/resources/server.md +++ b/docs/resources/server.md @@ -1,14 +1,14 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "virtfusion_server Resource - terraform-provider-virtfusion" +page_title: "virtfusion_server Resource - virtfusion" subcategory: "" description: |- - Virtfusion Server Resource + Manages a VirtFusion server. --- # virtfusion_server (Resource) -Virtfusion Server Resource +Manages a VirtFusion server. ## Example Usage @@ -27,6 +27,10 @@ resource "virtfusion_server" "node1" { storage_profile = 1 network_profile = 1 } + +output "server_id" { + value = virtfusion_server.node1.id +} ``` @@ -34,22 +38,36 @@ resource "virtfusion_server" "node1" { ### Required -- `hypervisor_id` (Number) Hypervisor Group ID -- `package_id` (Number) Package ID -- `user_id` (Number) User ID +- `hypervisor_id` (Number) The hypervisor ID where the server will be created. +- `package_id` (Number) The package ID for the server. +- `user_id` (Number) The user ID who owns the server. ### Optional -- `cores` (Number) How many cores to allocate. Omit to use the default core count from the package. -- `inbound_network_speed` (Number) Inbound network speed in kB/s. Omit to use the default inbound network speed from the package. -- `ipv4` (Number) IPv4 Addresses to assign. Omit to use the default of 1 IPv4. -- `memory` (Number) How much memory to allocate in MB. Omit to use the default memory size from the package. -- `network_profile` (Number) Network profile ID. Omit to use the default network profile from the package. -- `outbound_network_speed` (Number) Outbound network speed in kB/s. Omit to use the default outbound network speed from the package. -- `storage` (Number) Primary storage size in GB. Omit to use the default storage size from the package. -- `storage_profile` (Number) Storage profile ID. Omit to use the default storage profile from the package. -- `traffic` (Number) How much traffic to allocate in GB. Omit to use the default traffic size from the package. 0=Unlimited +- `additional_storage_1` (Number) Additional storage 1 size in GB. +- `additional_storage_1_profile` (Number) Additional storage 1 profile ID. +- `additional_storage_2` (Number) Additional storage 2 size in GB. +- `additional_storage_2_profile` (Number) Additional storage 2 profile ID. +- `backup_plan_id` (Number) Backup plan ID. Set to 0 to remove the backup plan. +- `cores` (Number) Number of CPU cores override. +- `cpu_throttle` (Number) CPU throttle percentage (0-100). +- `custom_xml` (String) Custom XML configuration for the server. +- `dry_run` (Boolean) If true, validates the request without creating the server. +- `inbound_network_speed` (Number) Inbound network speed override in Mbps. +- `ipv4` (Number) Number of IPv4 addresses to assign. Defaults to 1. +- `memory` (Number) Memory size override in MB. +- `name` (String) The server display name. +- `network_profile` (Number) Network profile ID. +- `outbound_network_speed` (Number) Outbound network speed override in Mbps. +- `owner_user_id` (Number) The user ID to transfer ownership to. +- `storage` (Number) Storage size override in GB. +- `storage_profile` (Number) Storage profile ID. +- `suspended` (Boolean) Whether the server is suspended. +- `traffic` (Number) Traffic limit override in GB. +- `vnc_enabled` (Boolean) Whether VNC is enabled on the server. ### Read-Only -- `id` (Number) Server ID +- `hostname` (String) The server hostname. +- `id` (Number) The server ID. +- `uuid` (String) The server UUID. diff --git a/docs/resources/server_build.md b/docs/resources/server_build.md new file mode 100644 index 0000000..d3f1d61 --- /dev/null +++ b/docs/resources/server_build.md @@ -0,0 +1,47 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_server_build Resource - virtfusion" +subcategory: "" +description: |- + Builds a VirtFusion server with an operating system. This is a one-time operation — once a server is built, it stays built. +--- + +# virtfusion_server_build (Resource) + +Builds a VirtFusion server with an operating system. This is a one-time operation — once a server is built, it stays built. + +## Example Usage + +```terraform +resource "virtfusion_server_build" "node1_build" { + server_id = virtfusion_server.node1.id + name = "my-server" + hostname = "my-server.example.com" + osid = 1 + vnc = true + ipv6 = false + ssh_keys = [virtfusion_ssh_key.mykey.id] + email = false +} +``` + + +## Schema + +### Required + +- `name` (String) The name for the server build. +- `osid` (Number) The operating system ID to install. +- `server_id` (Number) The ID of the server to build. + +### Optional + +- `email` (Boolean) Whether to send a notification email after build. +- `hostname` (String) The hostname for the server. +- `ipv6` (Boolean) Whether to enable IPv6. +- `ssh_keys` (List of Number) List of SSH key IDs to add to the server. +- `vnc` (Boolean) Whether to enable VNC access. + +### Read-Only + +- `id` (String) The identifier of the server build (same as server_id). diff --git a/docs/resources/server_firewall.md b/docs/resources/server_firewall.md new file mode 100644 index 0000000..427e50c --- /dev/null +++ b/docs/resources/server_firewall.md @@ -0,0 +1,40 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_server_firewall Resource - virtfusion" +subcategory: "" +description: |- + Manages a VirtFusion server firewall. +--- + +# virtfusion_server_firewall (Resource) + +Manages a VirtFusion server firewall. + + + + +## Schema + +### Required + +- `server_id` (Number) The ID of the server. + +### Optional + +- `interface_name` (String) The network interface name. Defaults to `eth0`. +- `rules` (Attributes List) The firewall rules. (see [below for nested schema](#nestedatt--rules)) + +### Read-Only + +- `id` (String) Composite identifier in the format `server_id/interface_name`. + + +### Nested Schema for `rules` + +Required: + +- `action` (String) The action for the rule (e.g. `accept`, `drop`). +- `direction` (String) The direction for the rule (e.g. `in`, `out`). +- `ip` (String) The IP address or CIDR for the rule. +- `port` (String) The port or port range for the rule. +- `protocol` (String) The protocol for the rule (e.g. `tcp`, `udp`). diff --git a/docs/resources/server_ipv4.md b/docs/resources/server_ipv4.md new file mode 100644 index 0000000..abb0af1 --- /dev/null +++ b/docs/resources/server_ipv4.md @@ -0,0 +1,28 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_server_ipv4 Resource - virtfusion" +subcategory: "" +description: |- + Adds IPv4 addresses to a VirtFusion server. +--- + +# virtfusion_server_ipv4 (Resource) + +Adds IPv4 addresses to a VirtFusion server. + + + + +## Schema + +### Required + +- `server_id` (Number) The ID of the server. Changing this forces a new resource to be created. + +### Optional + +- `quantity` (Number) The number of IPv4 addresses to add. Defaults to `1`. Changing this forces a new resource to be created. + +### Read-Only + +- `id` (String) Resource identifier. diff --git a/docs/resources/server_network_whitelist.md b/docs/resources/server_network_whitelist.md new file mode 100644 index 0000000..b467661 --- /dev/null +++ b/docs/resources/server_network_whitelist.md @@ -0,0 +1,25 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_server_network_whitelist Resource - virtfusion" +subcategory: "" +description: |- + Manages a VirtFusion server network whitelist entry. +--- + +# virtfusion_server_network_whitelist (Resource) + +Manages a VirtFusion server network whitelist entry. + + + + +## Schema + +### Required + +- `ip` (String) The IP address to whitelist. Changing this forces a new resource to be created. +- `server_id` (Number) The ID of the server. Changing this forces a new resource to be created. + +### Read-Only + +- `id` (String) Composite identifier in the format `server_id/ip`. diff --git a/docs/resources/server_password_reset.md b/docs/resources/server_password_reset.md new file mode 100644 index 0000000..2e1ca8d --- /dev/null +++ b/docs/resources/server_password_reset.md @@ -0,0 +1,30 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_server_password_reset Resource - virtfusion" +subcategory: "" +description: |- + Resets the password for a VirtFusion server. This is a trigger-style resource — the reset is executed on create and can be re-triggered by changing the triggers attribute. +--- + +# virtfusion_server_password_reset (Resource) + +Resets the password for a VirtFusion server. This is a trigger-style resource — the reset is executed on create and can be re-triggered by changing the `triggers` attribute. + + + + +## Schema + +### Required + +- `server_id` (Number) The ID of the server to reset the password for. +- `user` (String) The user to reset the password for. Must be `root` (Linux) or `Administrator` (Windows). + +### Optional + +- `triggers` (Map of String) A map of arbitrary strings that, when changed, will cause the password reset to be re-executed. Works like `triggers` in `terraform_data`. + +### Read-Only + +- `id` (String) The identifier for this password reset. +- `password` (String, Sensitive) The new password generated by the reset operation. diff --git a/docs/resources/server_power_action.md b/docs/resources/server_power_action.md new file mode 100644 index 0000000..889a9c3 --- /dev/null +++ b/docs/resources/server_power_action.md @@ -0,0 +1,29 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_server_power_action Resource - virtfusion" +subcategory: "" +description: |- + Performs a power action on a VirtFusion server. This is a trigger-style resource — the action is executed on create and can be re-triggered by changing the triggers attribute. +--- + +# virtfusion_server_power_action (Resource) + +Performs a power action on a VirtFusion server. This is a trigger-style resource — the action is executed on create and can be re-triggered by changing the `triggers` attribute. + + + + +## Schema + +### Required + +- `action` (String) The power action to perform. Must be one of: `boot`, `shutdown`, `restart`, `poweroff`. +- `server_id` (Number) The ID of the server to perform the power action on. + +### Optional + +- `triggers` (Map of String) A map of arbitrary strings that, when changed, will cause the power action to be re-executed. Works like `triggers` in `terraform_data`. + +### Read-Only + +- `id` (String) The identifier for this power action. diff --git a/docs/resources/server_traffic_block.md b/docs/resources/server_traffic_block.md new file mode 100644 index 0000000..a77888a --- /dev/null +++ b/docs/resources/server_traffic_block.md @@ -0,0 +1,25 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_server_traffic_block Resource - virtfusion" +subcategory: "" +description: |- + Manages a traffic block on a VirtFusion server. +--- + +# virtfusion_server_traffic_block (Resource) + +Manages a traffic block on a VirtFusion server. + + + + +## Schema + +### Required + +- `server_id` (Number) The ID of the server to add the traffic block to. +- `type` (String) The type of traffic block (e.g. `inbound` or `outbound`). + +### Read-Only + +- `id` (Number) The identifier of the traffic block. diff --git a/docs/resources/ssh.md b/docs/resources/ssh.md deleted file mode 100644 index 530acf9..0000000 --- a/docs/resources/ssh.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -# generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "virtfusion_ssh Resource - terraform-provider-virtfusion" -subcategory: "" -description: |- - Virtfusion SSH Resource ---- - -# virtfusion_ssh (Resource) - -Virtfusion SSH Resource - -## Example Usage - -```terraform -resource "virtfusion_ssh" "dummy_key" { - # This is what is displayed in the UI on the SSH keys page. - name = "dummy_key" - - public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCRM5gzj6BpVbTEZ8XX5meQOC9X+znTMCQbXTfdqm9IP3HY2JbqH+yfCBWSsLpXim6WvsYtfkAhrtrkdmaX66Wn1uo6XvARwi/5D1VRTM94vwoitJb0rne4OorpwGIGCpDIi1iRA/ERIbAIQpw/2PJfm7q+fEj9TS+n/MzYOOmwTaKPEJ8+wHwXbjcSNoBQmEPonafbQKQN5PXe5rwnTNAqJWhGPHqF2t7lvZy+m7Sl7X1vUVlw+7iZzOVm9iDXmUInc8A0kz18l/O+4ELhRxxzjmSX5/KkN0GG7wS7CHlq9MS2741MS6p0ZNMgTT/04RfsY5JXoOa1gCeAdnXQST9ylvBd6hXubV95lRM8AXAhEJFHpa0Xn1gHMJ4F0cjjvmBIDx39QztuYsNJPk8veBBQwhOzhnJ3Zh2IYTQD+Mwu5yUrJzUt7ia8X5fhjbrYlfUgdH+siBbvJRzyXwnZdHArher55U4xPCJO4qRrFr72Jn+WGzkcY53oLnW5K3NnPaYViCJD2BgJZU1YF8oA3RyEG+2GS7Ksqs2nXXlZ1c+RXLUXM0pxDrwqvYrE3Ae+O/PtZ0cqpesyjxDfH/R2cj86jjdEi7S8nhgkumHwkoac8LCJnoAeC9S7sxmI99VBHcNwCazx3ZL2UAI3Ik/DQBZXcCPXw9MfY25SyQwEYftMKw== dummy_key" - - # This is the user ID that the key will be associated with. - user_id = 1 -} -``` - - -## Schema - -### Required - -- `name` (String) Key Name -- `public_key` (String) Public Key -- `user_id` (Number) User ID - -### Read-Only - -- `id` (Number) SSH Key ID -- `public_key_hash` (String) Public Key Hash diff --git a/docs/resources/ssh_key.md b/docs/resources/ssh_key.md new file mode 100644 index 0000000..bc5964a --- /dev/null +++ b/docs/resources/ssh_key.md @@ -0,0 +1,38 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_ssh_key Resource - virtfusion" +subcategory: "" +description: |- + Manages a VirtFusion SSH key. +--- + +# virtfusion_ssh_key (Resource) + +Manages a VirtFusion SSH key. + +## Example Usage + +```terraform +resource "virtfusion_ssh_key" "mykey" { + user_id = 1 + name = "my-ssh-key" + public_key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExample user@example.com" +} + +output "ssh_key_id" { + value = virtfusion_ssh_key.mykey.id +} +``` + + +## Schema + +### Required + +- `name` (String) The name of the SSH key. +- `public_key` (String) The public key content. +- `user_id` (Number) The ID of the user who owns this SSH key. + +### Read-Only + +- `id` (Number) The ID of the SSH key. diff --git a/docs/resources/user.md b/docs/resources/user.md new file mode 100644 index 0000000..11d4071 --- /dev/null +++ b/docs/resources/user.md @@ -0,0 +1,35 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_user Resource - virtfusion" +subcategory: "" +description: |- + Manages a VirtFusion user. +--- + +# virtfusion_user (Resource) + +Manages a VirtFusion user. + +## Example Usage + +```terraform +resource "virtfusion_user" "customer1" { + name = "John Doe" + email = "john@example.com" + ext_relation_id = "cust-12345" +} +``` + + +## Schema + +### Required + +- `email` (String) The email address of the user. +- `ext_relation_id` (String) The external relation ID used to look up the user. Changing this forces a new resource to be created. +- `name` (String) The name of the user. + +### Read-Only + +- `enabled` (Boolean) Whether the user is enabled. +- `id` (Number) The numeric ID of the user. diff --git a/docs/resources/user_auth_token.md b/docs/resources/user_auth_token.md new file mode 100644 index 0000000..987829a --- /dev/null +++ b/docs/resources/user_auth_token.md @@ -0,0 +1,30 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_user_auth_token Resource - virtfusion" +subcategory: "" +description: |- + Generates an authentication token for a VirtFusion user. This is a trigger-style resource — the token is generated on create and can be re-generated by changing the triggers attribute. +--- + +# virtfusion_user_auth_token (Resource) + +Generates an authentication token for a VirtFusion user. This is a trigger-style resource — the token is generated on create and can be re-generated by changing the `triggers` attribute. + + + + +## Schema + +### Required + +- `ext_relation_id` (String) The external relation ID of the user to generate the auth token for. + +### Optional + +- `triggers` (Map of String) A map of arbitrary strings that, when changed, will cause the auth token to be re-generated. Works like `triggers` in `terraform_data`. + +### Read-Only + +- `id` (String) The identifier for this auth token generation. +- `token` (String, Sensitive) The generated authentication token. +- `url` (String, Sensitive) The authentication URL for the generated token. diff --git a/docs/resources/user_password_reset.md b/docs/resources/user_password_reset.md new file mode 100644 index 0000000..1e9b862 --- /dev/null +++ b/docs/resources/user_password_reset.md @@ -0,0 +1,28 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_user_password_reset Resource - virtfusion" +subcategory: "" +description: |- + Resets the password for a VirtFusion user by external relation ID. This is a trigger-style resource — the reset is executed on create and can be re-triggered by changing the triggers attribute. +--- + +# virtfusion_user_password_reset (Resource) + +Resets the password for a VirtFusion user by external relation ID. This is a trigger-style resource — the reset is executed on create and can be re-triggered by changing the `triggers` attribute. + + + + +## Schema + +### Required + +- `ext_relation_id` (String) The external relation ID of the user to reset the password for. + +### Optional + +- `triggers` (Map of String) A map of arbitrary strings that, when changed, will cause the password reset to be re-executed. Works like `triggers` in `terraform_data`. + +### Read-Only + +- `id` (String) The identifier for this password reset. diff --git a/docs/resources/user_server_auth_token.md b/docs/resources/user_server_auth_token.md new file mode 100644 index 0000000..6b0575d --- /dev/null +++ b/docs/resources/user_server_auth_token.md @@ -0,0 +1,31 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "virtfusion_user_server_auth_token Resource - virtfusion" +subcategory: "" +description: |- + Generates a server-scoped authentication token for a VirtFusion user. This is a trigger-style resource — the token is generated on create and can be re-generated by changing the triggers attribute. +--- + +# virtfusion_user_server_auth_token (Resource) + +Generates a server-scoped authentication token for a VirtFusion user. This is a trigger-style resource — the token is generated on create and can be re-generated by changing the `triggers` attribute. + + + + +## Schema + +### Required + +- `ext_relation_id` (String) The external relation ID of the user to generate the server auth token for. +- `server_id` (Number) The ID of the server to scope the auth token to. + +### Optional + +- `triggers` (Map of String) A map of arbitrary strings that, when changed, will cause the server auth token to be re-generated. Works like `triggers` in `terraform_data`. + +### Read-Only + +- `id` (String) The identifier for this server auth token generation. +- `token` (String, Sensitive) The generated server authentication token. +- `url` (String, Sensitive) The authentication URL for the generated server token. diff --git a/terraform-registry-manifest.json b/terraform-registry-manifest.json index fec2a56..295001a 100644 --- a/terraform-registry-manifest.json +++ b/terraform-registry-manifest.json @@ -1,6 +1,6 @@ { - "version": 1, - "metadata": { - "protocol_versions": ["6.0"] - } + "version": 1, + "metadata": { + "protocol_versions": ["6.0"] + } }