Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
268 changes: 268 additions & 0 deletions docs/data-sources/pricing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,268 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "hcloud_pricing Data Source - hcloud"
subcategory: ""
description: |-
Provides prices for the resources offered by the Hetzner Cloud.
The prices are returned for the Hetzner Cloud project the API token used to configure the provider belongs to.
See the Pricing API documentation https://docs.hetzner.cloud/reference/cloud#pricing for more details.
---

# hcloud_pricing (Data Source)

Provides prices for the resources offered by the Hetzner Cloud.

The prices are returned for the Hetzner Cloud project the API token used to configure the provider belongs to.

See the [Pricing API documentation](https://docs.hetzner.cloud/reference/cloud#pricing) for more details.

## Example Usage

```terraform
data "hcloud_pricing" "prices" {}

output "monthly_traffic_price_per_tb" {
value = data.hcloud_pricing.prices.server_types[0].prices[0].per_tb_traffic.gross
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Optional

- `load_balancer_type` (String) Only return prices for the Load Balancer Type with this name (e.g. `lb11`).
- `location` (String) Only return per-location prices for the location with this name (e.g. `fsn1`).
- `server_type` (String) Only return prices for the Server Type with this name (e.g. `cx22`).

### Read-Only

- `currency` (String) Currency all prices are denominated in.
- `floating_ips` (Attributes List) Prices of the Floating IPs, grouped by type. (see [below for nested schema](#nestedatt--floating_ips))
- `image` (Attributes) Price of the disk space used by Images (Snapshots and Backups). (see [below for nested schema](#nestedatt--image))
- `load_balancer_types` (Attributes List) Prices of the Load Balancer Types, grouped by type. (see [below for nested schema](#nestedatt--load_balancer_types))
- `primary_ips` (Attributes List) Prices of the Primary IPs, grouped by type. (see [below for nested schema](#nestedatt--primary_ips))
- `server_backup` (Attributes) Will increase base server costs by specific percentage if server backups are enabled. (see [below for nested schema](#nestedatt--server_backup))
- `server_types` (Attributes List) Prices of the Server Types, grouped by type. (see [below for nested schema](#nestedatt--server_types))
- `vat_rate` (String) VAT rate in percent used to calculate the gross prices from the net prices.
- `volume` (Attributes) Price of the disk space used by Volumes. (see [below for nested schema](#nestedatt--volume))

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

Read-Only:

- `prices` (Attributes List) Prices of the Floating IP type, per location. (see [below for nested schema](#nestedatt--floating_ips--prices))
- `type` (String) Type of the Floating IP (`ipv4` or `ipv6`).

<a id="nestedatt--floating_ips--prices"></a>
### Nested Schema for `floating_ips.prices`

Read-Only:

- `location` (String) Name of the location the price applies to.
- `monthly` (Attributes) Monthly costs for a Floating IP type in this location. (see [below for nested schema](#nestedatt--floating_ips--prices--monthly))

<a id="nestedatt--floating_ips--prices--monthly"></a>
### Nested Schema for `floating_ips.prices.monthly`

Read-Only:

- `currency` (String) Currency the price is denominated in.
- `gross` (String) Price with VAT added.
- `net` (String) Price without VAT.
- `vat_rate` (String) VAT rate in percent used to calculate the gross price from the net price.




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

Read-Only:

- `per_gb_month` (Attributes) Price per GB and month. (see [below for nested schema](#nestedatt--image--per_gb_month))

<a id="nestedatt--image--per_gb_month"></a>
### Nested Schema for `image.per_gb_month`

Read-Only:

- `currency` (String) Currency the price is denominated in.
- `gross` (String) Price with VAT added.
- `net` (String) Price without VAT.
- `vat_rate` (String) VAT rate in percent used to calculate the gross price from the net price.



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

Read-Only:

- `id` (Number) ID of the Load Balancer Type.
- `name` (String) Name of the Load Balancer Type.
- `prices` (Attributes List) Prices of the Load Balancer Type, per location. (see [below for nested schema](#nestedatt--load_balancer_types--prices))

<a id="nestedatt--load_balancer_types--prices"></a>
### Nested Schema for `load_balancer_types.prices`

Read-Only:

- `hourly` (Attributes) Hourly costs for a Load Balancer Type in this location. (see [below for nested schema](#nestedatt--load_balancer_types--prices--hourly))
- `included_traffic` (Number) Free traffic per month in bytes.
- `location` (String) Name of the location the price applies to.
- `monthly` (Attributes) Monthly costs for a Load Balancer Type in this location. (see [below for nested schema](#nestedatt--load_balancer_types--prices--monthly))
- `per_tb_traffic` (Attributes) Costs per additional TB of traffic in this location. (see [below for nested schema](#nestedatt--load_balancer_types--prices--per_tb_traffic))

<a id="nestedatt--load_balancer_types--prices--hourly"></a>
### Nested Schema for `load_balancer_types.prices.hourly`

Read-Only:

- `currency` (String) Currency the price is denominated in.
- `gross` (String) Price with VAT added.
- `net` (String) Price without VAT.
- `vat_rate` (String) VAT rate in percent used to calculate the gross price from the net price.


<a id="nestedatt--load_balancer_types--prices--monthly"></a>
### Nested Schema for `load_balancer_types.prices.monthly`

Read-Only:

- `currency` (String) Currency the price is denominated in.
- `gross` (String) Price with VAT added.
- `net` (String) Price without VAT.
- `vat_rate` (String) VAT rate in percent used to calculate the gross price from the net price.


<a id="nestedatt--load_balancer_types--prices--per_tb_traffic"></a>
### Nested Schema for `load_balancer_types.prices.per_tb_traffic`

Read-Only:

- `currency` (String) Currency the price is denominated in.
- `gross` (String) Price with VAT added.
- `net` (String) Price without VAT.
- `vat_rate` (String) VAT rate in percent used to calculate the gross price from the net price.




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

Read-Only:

- `prices` (Attributes List) Prices of the Primary IP type, per location. (see [below for nested schema](#nestedatt--primary_ips--prices))
- `type` (String) Type of the Primary IP (`ipv4` or `ipv6`).

<a id="nestedatt--primary_ips--prices"></a>
### Nested Schema for `primary_ips.prices`

Read-Only:

- `hourly` (Attributes) Hourly costs for a Primary IP type in this location. (see [below for nested schema](#nestedatt--primary_ips--prices--hourly))
- `location` (String) Name of the location the price applies to.
- `monthly` (Attributes) Monthly costs for a Primary IP type in this location. (see [below for nested schema](#nestedatt--primary_ips--prices--monthly))

<a id="nestedatt--primary_ips--prices--hourly"></a>
### Nested Schema for `primary_ips.prices.hourly`

Read-Only:

- `gross` (String) Price with VAT added.
- `net` (String) Price without VAT.


<a id="nestedatt--primary_ips--prices--monthly"></a>
### Nested Schema for `primary_ips.prices.monthly`

Read-Only:

- `gross` (String) Price with VAT added.
- `net` (String) Price without VAT.




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

Read-Only:

- `percentage` (String) Percentage by which the base server costs increase if server backups are enabled.


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

Read-Only:

- `id` (Number) ID of the Server Type.
- `name` (String) Name of the Server Type.
- `prices` (Attributes List) Prices of the Server Type, per location. (see [below for nested schema](#nestedatt--server_types--prices))

<a id="nestedatt--server_types--prices"></a>
### Nested Schema for `server_types.prices`

Read-Only:

- `hourly` (Attributes) Hourly costs for a Server Type in this location. (see [below for nested schema](#nestedatt--server_types--prices--hourly))
- `included_traffic` (Number) Free traffic per month in bytes.
- `location` (String) Name of the location the price applies to.
- `monthly` (Attributes) Monthly costs for a Server Type in this location. (see [below for nested schema](#nestedatt--server_types--prices--monthly))
- `per_tb_traffic` (Attributes) Costs per additional TB of traffic in this location. (see [below for nested schema](#nestedatt--server_types--prices--per_tb_traffic))

<a id="nestedatt--server_types--prices--hourly"></a>
### Nested Schema for `server_types.prices.hourly`

Read-Only:

- `currency` (String) Currency the price is denominated in.
- `gross` (String) Price with VAT added.
- `net` (String) Price without VAT.
- `vat_rate` (String) VAT rate in percent used to calculate the gross price from the net price.


<a id="nestedatt--server_types--prices--monthly"></a>
### Nested Schema for `server_types.prices.monthly`

Read-Only:

- `currency` (String) Currency the price is denominated in.
- `gross` (String) Price with VAT added.
- `net` (String) Price without VAT.
- `vat_rate` (String) VAT rate in percent used to calculate the gross price from the net price.


<a id="nestedatt--server_types--prices--per_tb_traffic"></a>
### Nested Schema for `server_types.prices.per_tb_traffic`

Read-Only:

- `currency` (String) Currency the price is denominated in.
- `gross` (String) Price with VAT added.
- `net` (String) Price without VAT.
- `vat_rate` (String) VAT rate in percent used to calculate the gross price from the net price.




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

Read-Only:

- `per_gb_month` (Attributes) Price per GB and month. (see [below for nested schema](#nestedatt--volume--per_gb_month))

<a id="nestedatt--volume--per_gb_month"></a>
### Nested Schema for `volume.per_gb_month`

Read-Only:

- `currency` (String) Currency the price is denominated in.
- `gross` (String) Price with VAT added.
- `net` (String) Price without VAT.
- `vat_rate` (String) VAT rate in percent used to calculate the gross price from the net price.
5 changes: 5 additions & 0 deletions examples/data-sources/hcloud_pricing/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
data "hcloud_pricing" "prices" {}

output "monthly_traffic_price_per_tb" {
value = data.hcloud_pricing.prices.server_types[0].prices[0].per_tb_traffic.gross
}
2 changes: 2 additions & 0 deletions hcloud/plugin_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/hetznercloud/terraform-provider-hcloud/internal/loadbalancer"
"github.com/hetznercloud/terraform-provider-hcloud/internal/loadbalancertype"
"github.com/hetznercloud/terraform-provider-hcloud/internal/location"
"github.com/hetznercloud/terraform-provider-hcloud/internal/pricing"
"github.com/hetznercloud/terraform-provider-hcloud/internal/primaryip"
"github.com/hetznercloud/terraform-provider-hcloud/internal/rdns"
"github.com/hetznercloud/terraform-provider-hcloud/internal/server"
Expand Down Expand Up @@ -216,6 +217,7 @@ func (p *PluginProvider) DataSources(_ context.Context) []func() datasource.Data
loadbalancertype.NewDataSourceList,
location.NewDataSource,
location.NewDataSourceList,
pricing.NewDataSource,
primaryip.NewDataSource,
primaryip.NewDataSourceList,
servertype.NewDataSource,
Expand Down
Loading