Skip to content

Commit

Permalink
fix: allow custom urls for products that have location based urls (#708)
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiGuranIonos authored Nov 14, 2024
1 parent d25ae74 commit ff8d03b
Show file tree
Hide file tree
Showing 76 changed files with 601 additions and 191 deletions.
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
## 6.6.3 - upcoming release
## 6.6.2 - upcoming release
### Features
- Make `location` optional for `certificate_manager` resources and datasources
- Make `location` optional for `vpn` resources and datasources
- Make `location` optional for `nfs` resources and datasources
- Make `location` optional for `kafka` resources and datasources
- Add `IONOS_API_URL_NFS` to set a custom API URL for the NAS/NFS product. `location` field needs to be empty, otherwise it will override the custom API URL. Setting `token` or `IONOS_API_URL` does not have any effect.
- Add `IONOS_API_URL_VPN` to set a custom API URL for the VPN product. `location` field needs to be empty, otherwise it will override the custom API URL. Setting `token` or `IONOS_API_URL` does not have any effect.
- Add `IONOS_API_URL_CERT` to set a custom API URL for the Certificate Manager product. `location` field needs to be empty, otherwise it will override the custom API URL. Setting `token` or `IONOS_API_URL` does not have any effect.
- Add `IONOS_API_URL_KAFKA` to set a custom API URL for the Event Streams product. `location` field needs to be empty, otherwise it will override the custom API URL. Setting `token` or `IONOS_API_URL` does not have any effect.
- Add `IONOS_API_URL_MARIADB` to set a custom API URL for the MariaDB product. `location` field needs to be empty, otherwise it will override the custom API URL. Setting `token` or `IONOS_API_URL` does not have any effect.
- Add `IONOS_API_URL_INMEMORYDB` to set a custom API URL for InMemoryDB product. `location` field needs to be empty, otherwise it will override the custom API URL. Setting `token` or `IONOS_API_URL` does not have any effect.
- Add `IONOS_API_URL_OBJECT_STORAGE` to set a custom API URL for Object Storage product. `region` field needs to be empty, otherwise it will override the custom API URL. Setting `token` or `IONOS_API_URL` does not have any effect.
- Add `IONOS_ALLOW_INSECURE` env variable and `insecure` field to allow insecure connections to the API. This is useful for testing purposes only.
- Add import tests for VPN Gateway resources
- Add `security_groups_ids` to `ionoscloud_server`, `ionoscloud_cube_server`, `ionoscloud_nic`, `ionoscloud_vcpu_server` resources and data sources
### New Product - **Network Security Groups**:
Expand All @@ -8,10 +20,15 @@
- [ionoscloud_nsg_firewallrule](docs/resources/nsg_firewallrule.md)
- `Data Sources`:
- [ionoscloud_nsg](docs/data-sources/nsg.md)
### Documentation
- Update documentation for `s3_region` and `IONOS_S3_REGION` variables

## 6.6.2
### Fixes
- Fix empty `ssh_key` used as variable in `ssh_keys` field in `ionoscloud_server` resource
- `hostname` needs to be computed as it gets the value of the server name if not set. Fix for `resource_server`, `resource_vcpu_server` and `resource_cube_server`
- Add import tests for VPN Gateway resources

## 6.6.1

### Features
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ token = var.ionos_token
# endpoint = "custom_cloud_api_url"
# s3_access_key = <your_access_key>
# s3_secret_key = <your_secret_key>
# s3_region = <your_bucket_region>
}
```

Expand All @@ -89,6 +90,7 @@ export TF_VAR_ionos_username="username"
export TF_VAR_ionos_password="password"
export TF_VAR_ionos_s3_access_key="accesskey"
export TF_VAR_ionos_s3_secret_key="secretkey"
export TF_VAR_ionos_s3_region="eu-central-3" # optional
```

See the [IonosCloud Provider documentation](https://registry.terraform.io/providers/ionos-cloud/ionoscloud/latest/docs) for more details.
Expand All @@ -104,8 +106,9 @@ See the [IonosCloud Provider documentation](https://registry.terraform.io/provid
| `IONOS_LOG_LEVEL` | Specify the Log Level used to log messages. Possible values: Off, Debug, Trace |
| `IONOS_PINNED_CERT` | Specify the SHA-256 public fingerprint here, enables certificate pinning |
| `IONOS_CONTRACT_NUMBER` | Specify the contract number on which you wish to provision. Only valid for reseller accounts, for other types of accounts the header will be ignored |
| `IONOS_S3_ACCESS_KEY` | Specify the access key used to authenticate against the IONOS Object Storage API |
| `IONOS_S3_SECRET_KEY` | Specify the secret key used to authenticate against the IONOS Object Storage API |
| `IONOS_S3_ACCESS_KEY` | Specify the access key used to authenticate against the IONOS Object Storage API |
| `IONOS_S3_SECRET_KEY` | Specify the secret key used to authenticate against the IONOS Object Storage API |
| `IONOS_S3_REGION` | Region for IONOS Object Storage operations. Default value: eu-central-3. **If you use IONOS_API_URL_OBJECT_STORAGE, `IONOS_S3_REGION` is mandatory** |


## Certificate pinning:
Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/dbaas_inmemorydb_replica_set.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ data "ionoscloud_inmemorydb_replicaset" "example" {

* `id` - (Optional) The ID of the InMemoryDB Replica Set.
* `display_name` - (Optional) The display name of the InMemoryDB Replica Set.
* `location` - (Required) The location of the InMemoryDB Replica Set.
* `location` - (Optional) The location of the InMemoryDB Replica Set.

> **Note:** Either `id` or `display_name` must be provided. If none, or both are provided, the datasource will return an error.
Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/dbaas_inmemorydb_snapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ data "ionoscloud_inmemorydb_snapshot" "example" {
## Argument Reference

* `id` - (Required) The ID of the InMemoryDB Snapshot.
* `location` - (Required) The location of the InMemoryDB Snapshot.
* `location` - (Optional) The location of the InMemoryDB Snapshot.

## Attributes Reference

Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/kafka_topic.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ data "ionoscloud_kafka_cluster_topic" "example" {
* `id` - (Optional) ID of an existing Kafka Cluster Topic that you want to search for.
* `name` - (Optional) Name of an existing Kafka Cluster Topic that you want to search for.
* `cluster_id` - (Required) ID of the Kafka Cluster that the topic belongs to.
* `location` - (Required) The location of the Kafka Cluster Topic. Must be the same as the location of the Kafka
* `location` - (Optional) The location of the Kafka Cluster Topic. Must be the same as the location of the Kafka
Cluster. Possible values: `de/fra`, `de/txl`

## Attributes Reference
Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/nfs_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ output "cluster_test_output" {

## Argument Reference

* `location` - (Required) The location where the Network File Storage cluster is located.
* `location` - (Optional) The location where the Network File Storage cluster is located.
* `name` - (Optional) Name of the Network File Storage cluster.
* `id` - (Optional) ID of the Network File Storage cluster.
* `partial_match` - (Optional) Whether partial matching is allowed or not when using the name filter. Defaults to `false`.
Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/nfs_share.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ output "share_test_output" {

## Argument Reference

- `location` - (Required) The location where the Network File Storage share is located.
- `location` - (Optional) The location where the Network File Storage share is located.
- `cluster_id` - (Required) The ID of the Network File Storage cluster.
- `name` - (Optional) Name of the Network File Storage share.
- `id` - (Optional) ID of the Network File Storage share.
Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/vpn_ipsec_gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ data "ionoscloud_vpn_ipsec_gateway" "example" {

* `id` - (Optional) ID of an existing IPSec Gateway that you want to search for.
* `name` - (Optional) Name of an existing IPSec Gateway that you want to search for.
* `location` - (Required) The location of the IPSec Gateway.
* `location` - (Optional) The location of the IPSec Gateway.

## Attributes Reference

Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/vpn_ipsec_tunnel.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ data "ionoscloud_vpn_ipsec_gateway" "example" {
* `id` - (Optional) ID of an existing IPSec Gateway Tunnel that you want to search for.
* `name` - (Optional) Name of an existing IPSec Gateway Tunnel that you want to search for.
* `gateway_id` - (Required) The ID of the IPSec Gateway that the tunnel belongs to.
* `location` - (Required) The location of the IPSec Gateway Tunnel.
* `location` - (Optional) The location of the IPSec Gateway Tunnel.

## Attributes reference

Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/vpn_wireguard_gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The following arguments are supported:

- `name` - (Optional)[String] The name of the WireGuard Gateway.
- `id` - (Optional)[String] The ID of the WireGuard Gateway.
- `location` - (Required)[String] The location of the WireGuard Gateway.
- `location` - (Optional)[String] The location of the WireGuard Gateway.

## Attributes Reference

Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/vpn_wireguard_peer.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ output "vpn_wireguard_peer_public_key" {
The following arguments are supported:

- `gateway_id` - (Required)[String] The ID of the WireGuard Gateway.
- `location` - (Required)[String] The location of the WireGuard Gateway.
- `location` - (Optional)[String] The location of the WireGuard Gateway.
- `name` - (Optional)[String] The name of the WireGuard Peer.
- `id` - (Optional)[String] The ID of the WireGuard Peer.

Expand Down
9 changes: 7 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export TF_VAR_ionos_token="token"
#export TF_VAR_ionos_password="password"
#export TF_VAR_ionos_s3_access_key="accesskey"
#export TF_VAR_ionos_s3_secret_key="secretkey"
#export TF_VAR_ionos_s3_region="region"
```


Expand Down Expand Up @@ -95,6 +96,7 @@ provider "ionoscloud" {
# endpoint = "custom_cloud_api_url"
# s3_access_key = <your_access_key>
# s3_secret_key = <your_secret_key>
# s3_region = <your_bucket_region>
}
resource "ionoscloud_datacenter" "main" {
Expand Down Expand Up @@ -126,6 +128,8 @@ The following arguments are supported:
- `s3_access_key` - Required for managing IONOS Object Storage resources.

- `s3_secret_key` - Required for managing IONOS Object Storage resources.
-
- `s3_region` - Optional, defines the region of the Object Storage resource.

### Environment Variables

Expand All @@ -138,8 +142,9 @@ The following arguments are supported:
| `IONOS_LOG_LEVEL` | Specify the Log Level used to log messages. Possible values: Off, Debug, Trace |
| `IONOS_PINNED_CERT` | Specify the SHA-256 public fingerprint here, enables certificate pinning |
| `IONOS_CONTRACT_NUMBER` | Specify the contract number on which you wish to provision. Only valid for reseller accounts, for other types of accounts the header will be ignored |
| `IONOS_S3_ACCESS_KEY` | Specify the access key used to authenticate against the IONOS Object Storage API |
| `IONOS_S3_SECRET_KEY` | Specify the secret key used to authenticate against the IONOS Object Storage API |
| `IONOS_S3_ACCESS_KEY` | Specify the access key used to authenticate against the IONOS Object Storage API |
| `IONOS_S3_SECRET_KEY` | Specify the secret key used to authenticate against the IONOS Object Storage API |
| `IONOS_S3_REGION` | Region for IONOS Object Storage operations. Default value: eu-central-3. **If you use IONOS_API_URL_OBJECT_STORAGE, `IONOS_S3_REGION` is mandatory** |

## Resource Timeout

Expand Down
2 changes: 1 addition & 1 deletion docs/resources/certificate_manager_provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ resource "ionoscloud_auto_certificate_provider" "example" {

* `name` - (Required)[string] The name of the certificate provider.
* `email` - (Required)[string] The email address of the certificate requester.
* `location` - (Required)[string] The location of the provider.
* `location` - (Optional)[string] The location of the provider.
* `server` - (Required)[string] The URL of the certificate provider.
* `external_account_binding` - (Optional)[list] External account binding details.
* `key_id` - (Required)[string] The key ID of the external account binding.
Expand Down
4 changes: 3 additions & 1 deletion docs/resources/dbaas_inmemorydb_replica_set.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ resource "ionoscloud_inmemorydb_replicaset" "example" {

## Argument Reference
* `display_name` - (Required)[string] The human-readable name of your replica set.
* `location` - (Required)[string] The location of your replica set. Updates to the value of the field force the replica set to be re-created.
* `location` - (Optional)[string] The location of your replica set. Updates to the value of the field force the replica set to be re-created.
* `version` - (Required)[string] The InMemoryDB version of your replica set.
* `replicas` - (Required)[int] The total number of replicas in the replica set (one active and n-1 passive). In case of a standalone instance, the value is 1. In all other cases, the value is > 1. The replicas will not be available as read replicas, they are only standby for a failure of the active instance.
* `resources` - (Required)[object] The resources of the individual replicas.
Expand Down Expand Up @@ -119,6 +119,8 @@ resource "ionoscloud_inmemorydb_replicaset" "example" {
* `initial_snapshot_id` - (Optional)[string] The ID of a snapshot to restore the replica set from. If set, the replica set will be created from the snapshot.
* `dns_name` - (Computed)[string] The DNS name pointing to your replica set. Will be used to connect to the active/standalone instance.

> **⚠ NOTE:** `IONOS_API_URL_INMEMORYDB` can be used to set a custom API URL for the resource. `location` field needs to be empty, otherwise it will override the custom API URL. Setting `token` or `IONOS_API_URL` does not have any effect.
## Import

Resource DBaaS InMemoryDB Replica Set can be imported using the `replicaset_id` and the `location`, separated by `:`, e.g:
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/dbaas_mariadb_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ resource "random_password" "cluster_password" {
* `password` - (Required)[string] The password for a MariaDB user.
* `dns_name` - (Computed)[string] The DNS name pointing to your cluster.

> **⚠ WARNING:** `Location` attribute will become required in the future.
> **⚠ WARNING:** `IONOS_API_URL_MARIADB` can be used to set a custom API URL for the MariaDB Cluster. `location` field needs to be empty, otherwise it will override the custom API URL. Setting `token` or `IONOS_API_URL` does not have any effect.
## Import

Expand Down
5 changes: 4 additions & 1 deletion docs/resources/kafka_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ resource "ionoscloud_kafka_cluster" "example" {

* `id` - (Computed)[string] The UUID of the Kafka Cluster.
* `name` - (Required)[string] Name of the Kafka Cluster.
* `location` - (Required)[string] The location of the Kafka Cluster. Possible values: `de/fra`, `de/txl`
* `location` - (Optional)[string] The location of the Kafka Cluster. Possible values: `de/fra`, `de/txl`
* `version` - (Required)[string] Version of the Kafka Cluster. Possible values: `3.7.0`
* `size` - (Required)[string] Size of the Kafka Cluster. Possible values: `XS`, `S`
* `connections` - (Required) Connection information of the Kafka Cluster. Minimum items: 1, maximum items: 1.
Expand All @@ -122,6 +122,9 @@ resource "ionoscloud_kafka_cluster" "example" {
unavailable IP range: 10.224.0.0/11
* `broker_addresses` - (Computed)[list] IP address and port of cluster brokers.

> **⚠ NOTE:** `IONOS_API_URL_KAFKA` can be used to set a custom API URL for the kafka resource. `location` field needs to be empty, otherwise it will override the custom API URL. Setting `token` or `IONOS_API_URL` does not have any effect.

## Import

Kafka Cluster can be imported using the `location` and `kafka cluster id`:
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/kafka_topic.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ resource "ionoscloud_kafka_cluster_topic" "example" {

* `id` - (Computed)[string] The UUID of the Kafka Cluster Topic.
* `name` - (Required)[string] Name of the Kafka Cluster.
* `location` - (Required)[string] The location of the Kafka Cluster Topic. Possible values: `de/fra`, `de/txl`
* `location` - (Optional)[string] The location of the Kafka Cluster Topic. Possible values: `de/fra`, `de/txl`
* `cluster_id` - (Required)[string] ID of the Kafka Cluster that the topic belongs to.
* `replication_factor` - (Optional)[int] The number of replicas of the topic. The replication factor determines how many
copies of the topic are stored on different brokers. The replication factor must be less than or equal to the number
Expand Down
4 changes: 3 additions & 1 deletion docs/resources/nfs_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ resource "ionoscloud_nfs_cluster" "example" {
The following arguments are supported:

- `name` - (Required) The name of the Network File Storage cluster.
- `location` - (Required) The location where the Network File Storage cluster is located.
- `location` - (Optional) The location where the Network File Storage cluster is located.
- `de/fra` - Frankfurt
- `de/txl` - Berlin
- `size` - (Required) The size of the Network File Storage cluster in TiB. Note that the cluster size cannot be reduced after provisioning. This value determines the billing fees. Default is `2`. The minimum value is `2` and the maximum value is `42`.
Expand All @@ -135,6 +135,8 @@ The following arguments are supported:
- `datacenter_id` - (Required) The ID of the datacenter where the Network File Storage cluster is located.
- `ip_address` - (Required) The IP address and prefix of the Network File Storage cluster. The IP address can be either IPv4 or IPv6. The IP address has to be given with CIDR notation.
- `lan` - (Required) The Private LAN to which the Network File Storage cluster must be connected.
-
> **⚠ NOTE:** `IONOS_API_URL_NFS` can be used to set a custom API URL for the resource. `location` field needs to be empty, otherwise it will override the custom API URL. Setting `token` or `IONOS_API_URL` does not have any effect.
## Import

Expand Down
2 changes: 1 addition & 1 deletion docs/resources/nfs_share.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ resource "ionoscloud_nfs_share" "example" {

The following arguments are supported:

- `location` - (Required) The location of the Network File Storage Cluster.
- `location` - (Optional) The location of the Network File Storage Cluster.
- `cluster_id` - (Required) The ID of the Network File Storage Cluster.
- `name` - (Required) The directory being exported.
- `quota` - (Optional) The quota in MiB for the export. The quota can restrict the amount of data that can be stored within the export. The quota can be disabled using `0`. Default is `0`.
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/vpn_ipsec_gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ resource "ionoscloud_vpn_ipsec_gateway" "example" {
## Argument reference

* `name` - (Required)[string] The name of the IPSec Gateway.
* `location` - (Required)[string] The location of the IPSec Gateway. Supported locations: de/fra, de/txl, es/vit,
* `location` - (Optional)[string] The location of the IPSec Gateway. Supported locations: de/fra, de/txl, es/vit,
gb/lhr, us/ewr, us/las, us/mci, fr/par
* `gateway_ip` - (Required)[string] Public IP address to be assigned to the gateway. Note: This must be an IP address in
the same datacenter as the connections.
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/vpn_ipsec_tunnel.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ resource "ionoscloud_vpn_ipsec_tunnel" "example" {
## Argument reference

* `name` - (Required)[string] The name of the IPSec Gateway Tunnel.
* `location` - (Required)[string] The location of the IPSec Gateway Tunnel. Supported locations: de/fra, de/txl, es/vit,
* `location` - (Optional)[string] The location of the IPSec Gateway Tunnel. Supported locations: de/fra, de/txl, es/vit,
gb/lhr, us/ewr, us/las, us/mci, fr/par
* `gateway_id` - (Required)[string] The ID of the IPSec Gateway that the tunnel belongs to.
* `description` - (Optional)[string] The human-readable description of your IPSec Gateway Tunnel.
Expand Down
Loading

0 comments on commit ff8d03b

Please sign in to comment.