Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: provide consistency across data sources in terms of case sensitivity #253

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
- added units where missing
- added example for adding a secondary NIC to an IP Failover
- updated provider version to the latest release in main registry page
- documented the behavior of data-sources in terms of case-sensitivity

### Enhancement
- add `allow_replace` to node pool resource, which allows the update of immutable node_pool fields will first
destroy and then re-create the resource. This field should be used with care, understanding the risks.
- update sdk-go dependency to v6.0.2
- update sdk-go-dbaas-postgres dependency to v1.0.2
- update terraform-plugin-sdk to v2.12.0
- made all data-sources case-insensitive for name argument

### Fixes
- fixed image data-source bug when `name` not provided - data-source returned 0 results
Expand Down
6 changes: 3 additions & 3 deletions docs/data-sources/backup_unit.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ description: |-

The **Backup Unit data source** can be used to search for and return an existing Backup Unit.
You can provide a string for either id or name parameters which will be compared with provisioned Backup Units.
If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned.
When this happens, please refine your search string so that it is specific enough to return only one result.
If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned.
When this happens, please make sure that your resources have unique names.

## Example Usage

Expand All @@ -34,7 +34,7 @@ data "ionoscloud_backup_unit" "example" {

The following arguments are supported:

* `name` - (Optional) Name of an existing backup unit that you want to search for.
* `name` - (Optional) Name of an existing backup unit that you want to search for. Search by name is case-insensitive, but the whole resource name is required (we do not support partial matching).
* `id` - (Optional) ID of the backup unit you want to search for.

Either `name` or `id` must be provided. If none, or both are provided, the datasource will return an error.
Expand Down
5 changes: 3 additions & 2 deletions docs/data-sources/datacenter.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ description: |-
The **Datacenter data source** can be used to search for and return an existing Virtual Data Center.
You can provide a string for the name and location parameters which will be compared with provisioned Virtual Data Centers.
If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned.
When this happens, please refine your search string so that it is specific enough to return only one result.
When this happens, please refine your search and make sure that your resources have unique names.


## Example Usage

Expand All @@ -34,7 +35,7 @@ data "ionoscloud_datacenter" "example" {
## Argument Reference

* `id` - (Optional) Id of an existing Virtual Data Center that you want to search for.
* `name` - (Optional) Name of an existing Virtual Data Center that you want to search for.
* `name` - (Optional) Name of an existing Virtual Data Center that you want to search for.Search by name is case-insensitive, but the whole resource name is required (we do not support partial matching).
* `location` - (Optional) Id of the existing Virtual Data Center's location.

Either `name`, `location` or `id` must be provided. If none, the datasource will return an error.
Expand Down
4 changes: 2 additions & 2 deletions docs/data-sources/dbaas_pgsql_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description: |-

The **DbaaS Postgres Cluster data source** can be used to search for and return an existing DbaaS Postgres Cluster.
If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned.
When this happens, please refine your search string so that it is specific enough to return only one result.
When this happens, please make sure that your resources have unique names.

## Example Usage

Expand All @@ -32,7 +32,7 @@ data "ionoscloud_pg_cluster" "example" {

## Argument Reference

* `display_name` - (Optional) Display name or an existing cluster that you want to search for.
* `display_name` - (Optional) Display name or an existing cluster that you want to search for. Search by name is case-insensitive, but the whole resource name is required (we do not support partial matching).
* `id` - (Optional) ID of the cluster you want to search for.

Either `display_name` or `id` must be provided. If none, or both are provided, the datasource will return an error.
Expand Down
7 changes: 4 additions & 3 deletions docs/data-sources/firewall.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ description: |-

The **Firewall data source** can be used to search for and return an existing FirewallRules.
You can provide a string for either id or name parameters which will be compared with provisioned Firewall Rules.
If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned.
When this happens, please refine your search string so that it is specific enough to return only one result.
If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned.
When this happens, please make sure that your resources have unique names.

## Example Usage

### By ID
```hcl
data "ionoscloud_firewall" "example" {
Expand All @@ -39,7 +40,7 @@ data "ionoscloud_firewall" "example" {

The following arguments are supported:

* `name` - (Optional) Name of an existing firewall rule that you want to search for.
* `name` - (Optional) Name of an existing firewall rule that you want to search for. Search by name is case-insensitive, but the whole resource name is required (we do not support partial matching).
* `id` - (Optional) ID of the firewall rule you want to search for.
* `datacenter_id` - (Required) The Virtual Data Center ID.
* `server_id` - (Required) The Server ID.
Expand Down
6 changes: 3 additions & 3 deletions docs/data-sources/group.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ description: |-
# ionoscloud\_group

The **Group data source** can be used to search for and return existing groups.
If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned.
When this happens, please refine your search string so that it is specific enough to return only one result.
If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned.
When this happens, please make sure that your resources have unique names.

## Example Usage

Expand All @@ -31,7 +31,7 @@ data "ionoscloud_group" "example" {

## Argument Reference

* `name` - (Optional) Name of an existing group that you want to search for.
* `name` - (Optional) Name of an existing group that you want to search for. Search by name is case-insensitive, but the whole resource name is required (we do not support partial matching).
* `id` - (Optional) ID of the group you want to search for.

Either `name` or `id` must be provided. If none, or both are provided, the datasource will return an error.
Expand Down
12 changes: 5 additions & 7 deletions docs/data-sources/image.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,24 @@ description: |-
# ionoscloud\_image

The **Image data source** can be used to search for and return an existing image which can then be used to provision a server.
If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned.
When this happens, please refine your search string so that it is specific enough to return only one result.

## Example Usage

```hcl
data "ionoscloud_image" "example" {
name = "ubuntu"
type = "CDROM"
location = "de/fkb"
cloud_init = "NONE"
type = "HDD"
cloud_init = "V1"
location = "us/las"
}
```

## Argument Reference

* `name` - (Required) Name of an existing image that you want to search for.
* `name` - (Required) Name of an existing image that you want to search for. Search by name is case-insensitive, but the whole resource name is required (we do not support partial matching).
* `location` - (Optional) Id of the existing image's location.
* `type` - (Optional) The image type, HDD or CD-ROM.
* `cloud_init` - (Optional) Cloud init compatibility ("NONE" or "V1")
* `version` - (Optional) Version of the image (see details below). Please note that this argument is **DEPRECATED**, and we do not recommend using it since it does not assure correct results.

If both "name" and "version" are provided the plugin will concatenate the two strings in this format [name]-[version].

Expand Down
4 changes: 2 additions & 2 deletions docs/data-sources/ipblock.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ description: |-
The **IP Block data source** can be used to search for and return an existing Ip Block.
You can provide a string for the id, the name or the location parameters which will be compared with the provisioned Ip Blocks.
If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned.
When this happens, please refine your search string so that it is specific enough to return only one result.
When this happens, please make sure that your resources have unique names.

## Example Usage

Expand Down Expand Up @@ -48,7 +48,7 @@ data "ionoscloud_ipblock" "example" {
## Argument reference

* `id` - (Optional) ID of an existing Ip Block that you want to search for.
* `name` - (Optional) Name of an existing Ip Block that you want to search for.
* `name` - (Optional) Name of an existing Ip Block that you want to search for. Search by name is case-insensitive, but the whole resource name is required (we do not support partial matching).
* `location` - (Optional) The regional location for this IP Block: us/las, us/ewr, de/fra, de/fkb.

## Attributes Reference
Expand Down
5 changes: 3 additions & 2 deletions docs/data-sources/k8s_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ description: |-
# ionoscloud\_k8s\_cluster

The **k8s Cluster data source** can be used to search for and return existing k8s clusters.
You can provide a string for either id or name parameters which will be compared with provisioned K8s Clusters.
If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned.
When this happens, please refine your search string so that it is specific enough to return only one result.
When this happens, please make sure that your resources have unique names.

## Example Usage
### By ID
Expand All @@ -30,7 +31,7 @@ data "ionoscloud_k8s_cluster" "example" {

## Argument Reference

* `name` - (Optional) Name or an existing cluster that you want to search for.
* `name` - (Optional) Name or an existing cluster that you want to search for. Search by name is case-insensitive, but the whole resource name is required (we do not support partial matching).
* `id` - (Optional) ID of the cluster you want to search for.

Either `name` or `id` must be provided. If none, or both are provided, the datasource will return an error.
Expand Down
5 changes: 3 additions & 2 deletions docs/data-sources/k8s_node_pool.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ description: |-
# ionoscloud\_k8s\_node\_pool

The **k8s Node Pool** data source can be used to search for and return existing k8s Node Pools.
You can provide a string for either id or name parameters which will be compared with provisioned K8s Node Pools.
If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned.
When this happens, please refine your search string so that it is specific enough to return only one result.
When this happens, please make sure that your resources have unique names.

## Example Usage

Expand All @@ -34,7 +35,7 @@ data "ionoscloud_k8s_node_pool" "example" {
## Argument Reference

* `k8s_cluster_id` (Required) K8s Cluster' UUID
* `name` - (Optional) Name of an existing node pool that you want to search for.
* `name` - (Optional) Name of an existing node pool that you want to search for. Search by name is case-insensitive, but the whole resource name is required (we do not support partial matching).
* `id` - (Optional) ID of the node pool you want to search for.

`k8s_cluster_id` and either `name` or `id` must be provided. If none, or both of `name` and `id` are provided, the datasource will return an error.
Expand Down
4 changes: 2 additions & 2 deletions docs/data-sources/lan.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description: |-

The **LAN data source** can be used to search for and return existing lans.
If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned.
When this happens, please refine your search string so that it is specific enough to return only one result.
When this happens, please make sure that your resources have unique names.

## Example Usage

Expand All @@ -34,7 +34,7 @@ data "ionoscloud_lan" "example" {
## Argument Reference

* `datacenter_id` - (Required) Datacenter's UUID.
* `name` - (Optional) Name of an existing lan that you want to search for.
* `name` - (Optional) Name of an existing lan that you want to search for. Search by name is case-insensitive, but the whole resource name is required (we do not support partial matching).
* `id` - (Optional) ID of the lan you want to search for.

`datacenter_id` and either `name` or `id` must be provided. If none, or both of `name` and `id` are provided, the datasource will return an error.
Expand Down
4 changes: 2 additions & 2 deletions docs/data-sources/location.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description: |-

The **Location data source** can be used to search for and return an existing location which can then be used elsewhere in the configuration.
If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned.
When this happens, please refine your search string so that it is specific enough to return only one result.
When this happens, please make sure that your resources have unique names.

## Example Usage

Expand All @@ -24,7 +24,7 @@ data "ionoscloud_location" "example" {

## Argument Reference

* `name` - (Required) Name of the location to search for.
* `name` - (Required) Name of the location to search for. Search by name is case-insensitive, but the whole resource name is required (we do not support partial matching).
* `feature` - (Optional) A desired feature that the location must be able to provide.

## Attributes Reference
Expand Down
4 changes: 2 additions & 2 deletions docs/data-sources/natgateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description: |-

The **NAT gateway data source** can be used to search for and return existing NAT Gateways.
If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned.
When this happens, please refine your search string so that it is specific enough to return only one result.
When this happens, please make sure that your resources have unique names.

## Example Usage
### By ID
Expand All @@ -33,7 +33,7 @@ data "ionoscloud_natgateway" "example" {
## Argument Reference

* `datacenter_id` - (Required) Datacenter's UUID.
* `name` - (Optional) Name of an existing network load balancer forwarding rule that you want to search for.
* `name` - (Optional) Name of an existing network load balancer forwarding rule that you want to search for. Search by name is case-insensitive, but the whole resource name is required (we do not support partial matching).
* `id` - (Optional) ID of the network load balancer forwarding rule you want to search for.

`datacenter_id` and either `name` or `id` must be provided. If none, or both of `name` and `id` are provided, the datasource will return an error.
Expand Down
4 changes: 2 additions & 2 deletions docs/data-sources/natgateway_rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description: |-

The **NAT Gateway Rule data source** can be used to search for and return existing NAT Gateway Rules.
If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned.
When this happens, please refine your search string so that it is specific enough to return only one result.
When this happens, please make sure that your resources have unique names.

## Example Usage

Expand All @@ -37,7 +37,7 @@ data "ionoscloud_natgateway_rule" "example" {

* `datacenter_id` - (Required) Datacenter's UUID.
* `natgateway_id` - (Required) Nat Gateway's UUID.
* `name` - (Optional) Name of an existing NAT gateway rule that you want to search for.
* `name` - (Optional) Name of an existing NAT gateway rule that you want to search for. Search by name is case-insensitive, but the whole resource name is required (we do not support partial matching).
* `id` - (Optional) ID of the NAT gateway rule you want to search for.

Both `datacenter_id` and `natgateway_id` and either `name` or `id` must be provided. If none, or both of `name` and `id` are provided, the datasource will return an error.
Expand Down
4 changes: 2 additions & 2 deletions docs/data-sources/networkloadbalancer.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description: |-

The **Network Load Balancer data source** can be used to search for and return existing network load balancers.
If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned.
When this happens, please refine your search string so that it is specific enough to return only one result.
When this happens, please make sure that your resources have unique names.

## Example Usage

Expand All @@ -34,7 +34,7 @@ data "ionoscloud_networkloadbalancer" "example" {
## Argument Reference

* `datacenter_id` - (Required) Datacenter's UUID.
* `name` - (Optional) Name of an existing network load balancer that you want to search for.
* `name` - (Optional) Name of an existing network load balancer that you want to search for. Search by name is case-insensitive, but the whole resource name is required (we do not support partial matching).
* `id` - (Optional) ID of the network load balancer you want to search for.

`datacenter_id` and either `name` or `id` must be provided. If none, or both of `name` and `id` are provided, the datasource will return an error.
Expand Down
4 changes: 2 additions & 2 deletions docs/data-sources/networkloadbalancer_forwardingrule.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description: |-

The **Network Load Balancer Forwarding Rule data source** can be used to search for and return existing network forwarding rules.
If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned.
When this happens, please refine your search string so that it is specific enough to return only one result.
When this happens, please make sure that your resources have unique names.

## Example Usage

Expand All @@ -38,7 +38,7 @@ data "ionoscloud_networkloadbalancer_forwardingrule" "example" {

* `datacenter_id` - (Required) Datacenter's UUID.
* `networkloadbalancer_id` - (Required) Network Load Balancer's UUID.
* `name` - (Optional) Name of an existing network load balancer forwarding rule that you want to search for.
* `name` - (Optional) Name of an existing network load balancer forwarding rule that you want to search for. Search by name is case-insensitive, but the whole resource name is required (we do not support partial matching).
* `id` - (Optional) ID of the network load balancer forwarding rule you want to search for.

Both `datacenter_id` and `networkloadbalancer_id` and either `name` or `id` must be provided. If none, or both of `name` and `id` are provided, the datasource will return an error.
Expand Down
4 changes: 2 additions & 2 deletions docs/data-sources/nic.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description: |-

The **Nic data source** can be used to search for and return existing nics.
If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned.
When this happens, please refine your search string so that it is specific enough to return only one result.
When this happens, please make sure that your resources have unique names.

## Example Usage

Expand All @@ -37,7 +37,7 @@ data "ionoscloud_nic" "example" {

- `datacenter_id` - (Required)[string] The ID of a Virtual Data Center.
- `server_id` - (Required)[string] The ID of a server.
- `name` - (Optional)[string] The name of the LAN.
- `name` - (Optional)[string] The name of the LAN. Search by name is case-insensitive, but the whole resource name is required (we do not support partial matching).
* `id` - (Optional) ID of the nic you want to search for.

`datacenter_id` and either `name` or `id` must be provided.
Expand Down
Loading