Skip to content

Commit

Permalink
Fixed tests + docs update + merged fixes (#49)
Browse files Browse the repository at this point in the history
* fixed server and group tests 

* replaced apiResponse.Status.StatusCode with apiResponse.StatusCode

* merged nic fix to accept multiple ips

* modified image_name in test with a more generic one and created documentantion for natgateway

* updated documentation + changelog + fix test

* correctly setting the active property of the s3 key upon creation and fix of NetworkLoadBalancerForwardingRule resource at setting health_check
  • Loading branch information
iblindu authored Jul 5, 2021
1 parent a87ef6d commit 524c3bc
Show file tree
Hide file tree
Showing 54 changed files with 790 additions and 190 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 6.0.0-alpha.4

- documentation updates
- terraform plugin sdk upgrade to v2.4.3
- fix: create volume without password
- fix: ability to create server without image
- fix: fixes #25 correctly set of dhcp + nil check + added firewall_type field in server resource
- fix: fixes #39 - new imports for volume, user, group, share, IPfailover and loadbalancer
- fix: fixes #47 - corrected nic resource to accept a list of strings for ips parameter
- fix: fixes #36 - correctly setting the active property of the s3 key upon creation

## 6.0.0-alpha.3

- documentation updates
Expand Down
4 changes: 3 additions & 1 deletion docs/data-sources/k8s_node_pool.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@ The k8s node pool data source can be used to search for and return existing k8s
```hcl
data "ionoscloud_k8s_node_pool" "k8s_node_pool_example" {
name = "My_Node_Pool"
k8s_cluster_id = ionoscloud_k8s_cluster.k8s_cluster_example.id
}
```

## Argument Reference

* `k8s_cluster_id` (Required) K8s Cluster' UUID
* `name` - (Optional) Name of an existing node pool that you want to search for.
* `id` - (Optional) ID of the node pool you want to search for.

Either `name` or `id` must be provided. If none, or both are provided, the datasource will return an error.
`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.

## Attributes Reference

Expand Down
8 changes: 5 additions & 3 deletions docs/data-sources/lan.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: "ionoscloud"
page_title: "ProfitBricks : ionoscloud_lan"
page_title: "IonosCloud : ionoscloud_lan"
sidebar_current: "docs-ionoscloud-datasource-lan"
description: |-
Get information on a Ionos Cloud Lans
Expand All @@ -14,16 +14,18 @@ The lans data source can be used to search for and return existing lans.

```hcl
data "ionoscloud_lan" "lan_example" {
name = "My Lan"
datacenter_id = ionoscloud_datacenter.example.id
name = "example_"
}
```

## Argument Reference

* `datacenter_id` - (Required) Datacenter's UUID.
* `name` - (Optional) Name of an existing lan that you want to search for.
* `id` - (Optional) ID of the lan you want to search for.

Either `name` or `id` must be provided. If none, or both are provided, the datasource will return an error.
`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.

## Attributes Reference

Expand Down
39 changes: 39 additions & 0 deletions docs/data-sources/natgateway.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
layout: "ionoscloud"
page_title: "IonosCloud : ionoscloud_natgateway"
sidebar_current: "docs-ionoscloud-datasource-natgateway"
description: |-
Get information on a Nat Gateway
---

# ionoscloud_natgateway

The nat gateway data source can be used to search for and return existing natgateways.

## Example Usage

```hcl
data "ionoscloud_natgateway" "natgateway_example" {
datacenter_id = ionoscloud_datacenter.datacenter_example.id
name = "example_"
}
```

## Argument Reference

* `datacenter_id` - (Required) Datacenter's UUID.
* `name` - (Optional) Name of an existing network loadbalancer forwarding rule that you want to search for.
* `id` - (Optional) ID of the network loadbalancer 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.

## Attributes Reference

The following attributes are returned by the datasource:

* `id`
* `name`
* `public_ips`
* `lans` - list of
* `id`
* `gateway_ips`
46 changes: 46 additions & 0 deletions docs/data-sources/natgateway_rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
layout: "ionoscloud"
page_title: "IonosCloud : ionoscloud_natgateway_rule"
sidebar_current: "docs-ionoscloud-datasource-natgateway_rule"
description: |-
Get information on a Nat Gateway Rule
---

# ionoscloud_natgateway_rule

The nat gateway rule data source can be used to search for and return existing natgateway rules.

## Example Usage

```hcl
data "ionoscloud_natgateway_rule" "natgateway_rule_example" {
datacenter_id = ionoscloud_datacenter.datacenter_example.id
natgateway_id = ionoscloud_natgateway.natgateway_example.id
name = "example_"
}
```

## Argument Reference

* `datacenter_id` - (Required) Datacenter's UUID.
* `natgateway_id` - (Required) Nat Gateway's UUID.
* `name` - (Optional) Name of an existing network loadbalancer forwarding rule that you want to search for.
* `id` - (Optional) ID of the network loadbalancer forwarding 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.

## Attributes Reference

The following attributes are returned by the datasource:

* `id`
* `name`
* `type`
* `protocol`
* `source_subnet`
* `public_ip`
* `target_subnet`
* `target_port_range` - list of
* `start`
* `end`

40 changes: 40 additions & 0 deletions docs/data-sources/networkloadbalancer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
layout: "ionoscloud"
page_title: "IonosCloud : ionoscloud_networkloadbalancer"
sidebar_current: "docs-ionoscloud-datasource-networkloadbalancer"
description: |-
Get information on a Network Loadbalancer
---

# ionoscloud_networkloadbalancer

The network loadbalancer data source can be used to search for and return existing network loadbalancers.

## Example Usage

```hcl
data "ionoscloud_networkloadbalancer" "example" {
datacenter_id = ionoscloud_datacenter.example.id
name = "example_"
}
```

## Argument Reference

* `datacenter_id` - (Required) Datacenter's UUID.
* `name` - (Optional) Name of an existing network loadbalancer that you want to search for.
* `id` - (Optional) ID of the network loadbalancer 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.

## Attributes Reference

The following attributes are returned by the datasource:

* `id`
* `name`
* `listener_lan`
* `target_lan`
* `ips`
* `lb_private_ips`

56 changes: 56 additions & 0 deletions docs/data-sources/networkloadbalancer_forwardingrule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
layout: "ionoscloud"
page_title: "IonosCloud : ionoscloud_networkloadbalancer_forwardingrule"
sidebar_current: "docs-ionoscloud-datasource-networkloadbalancer_forwardingrule"
description: |-
Get information on a Network Loadbalancer Forwarding Rule
---

# ionoscloud_networkloadbalancer_forwardingrule

The network loadbalancer forwarding rule data source can be used to search for and return existing network forwarding rules.

## Example Usage

```hcl
data "ionoscloud_networkloadbalancer_forwardingrule" "example" {
datacenter_id = ionoscloud_datacenter.example.id
networkloadbalancer_id = ionoscloud_networkloadbalancer.example.id
name = "example_"
}
```

## Argument Reference

* `datacenter_id` - (Required) Datacenter's UUID.
* `networkloadbalancer_id` - (Required) Network Loadbalancer's UUID.
* `name` - (Optional) Name of an existing network loadbalancer forwarding rule that you want to search for.
* `id` - (Optional) ID of the network loadbalancer 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.

## Attributes Reference

The following attributes are returned by the datasource:

* `id`
* `name`
* `algorithm`
* `protocol`
* `listener_ip`
* `listener_port`
* `health_check` - list of
* `client_timeout`
* `check_timeout`
* `connect_timeout`
* `target_timeout`
* `retries`
* `targets`
* `ip`
* `port`
* `weight`
* `health_check`
* `check`
* `check_interval`
* `maintenance`

2 changes: 1 addition & 1 deletion docs/data-sources/private_crossconnect.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: "ionoscloud"
page_title: "ProfitBricks : ionoscloud_private_crossconnect"
page_title: "IonosCloud : ionoscloud_private_crossconnect"
sidebar_current: "docs-ionoscloud-datasource-private-crossconnect"
description: |-
Get information on a Ionos Cloud Private Crossconnects
Expand Down
10 changes: 6 additions & 4 deletions docs/data-sources/server.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
---
layout: "ionoscloud"
page_title: "ProfitBricks : ionoscloud_server"
page_title: "IonosCloud : ionoscloud_server"
sidebar_current: "docs-ionoscloud-datasource-server"
description: |-
Get information on a Ionos Cloud Servers
---

# ionoscloud\_server

The lans data source can be used to search for and return existing servers.
The server data source can be used to search for and return existing servers.

## Example Usage

```hcl
data "ionoscloud_server" "server_example" {
name = "My Server"
datacenter_id = ionoscloud_datacenter.datacenter_example.id
name = "example_"
}
```

## Argument Reference

* `datacenter_id` - (Required) Datacenter's UUID.
* `name` - (Optional) Name of an existing server that you want to search for.
* `id` - (Optional) ID of the server you want to search for.

Either `name` or `id` must be provided. If none, or both are provided, the datasource will return an error.
`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.

## Attributes Reference

Expand Down
41 changes: 41 additions & 0 deletions docs/data-sources/template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
layout: "ionoscloud"
page_title: "IonosCloud : ionoscloud_template"
sidebar_current: "docs-ionoscloud-datasource-template"
description: |-
Get information on a Ionos Cloud Template
---

# ionoscloud_template

The template data source can be used to search for and return existing templates.

## Example Usage

```hcl
data "ionoscloud_template" "example" {
name = "BETA CUBES S"
cores = 1
ram = 2048
storage_size = 50
}
```

## Argument Reference

* `name` - (Required) A name of that resource.
* `cores` - (Required) The CPU cores count.
* `ram` - (Required) The RAM size in MB.
* `storage_size` - (Required) The storage size in GB.

All arguments must be provided. If none, the datasource will return an error.

## Attributes Reference

The following attributes are returned by the datasource:

* `id`
* `name`
* `cores`
* `ram`
* `storage_size`
34 changes: 34 additions & 0 deletions docs/resources/natgateway.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
layout: "ionoscloud"
page_title: "IonosCloud: natgateway"
sidebar_current: "docs-resource-natgateway"
description: |-
Creates and manages Nat Gateway objects.
---

# ionoscloud_natgateway

Manages a Nat Gateway on IonosCloud.

## Example Usage

```hcl
resource "ionoscloud_natgateway" "example" {
datacenter_id = ionoscloud_datacenter.example.id
name = "example"
public_ips = ["${ionoscloud_ipblock.example.ips[0]}", "${ionoscloud_ipblock.example.ips[1]}"]
lans {
id = ionoscloud_lan.example.id
gateway_ips = [ "10.11.2.5/32"]
}
}
```

## Argument reference

- `name` - (Required)[string] Name of the NAT gateway.
- `public_ips` - (Required)[list]Collection of public IP addresses of the NAT gateway. Should be customer reserved IP addresses in that location.
- `lans` - (Required)[list] A list of Local Area Networks the node pool should be part of.
- `id` - (Required)[int] Id for the LAN connected to the NAT gateway.
- `gateway_ips` - (Optional)[list] Collection of gateway IP addresses of the NAT gateway. Will be auto-generated if not provided. Should ideally be an IP belonging to the same subnet as the LAN.
- `datacenter_id` - (Required)[string] A Datacenter's UUID.
Loading

0 comments on commit 524c3bc

Please sign in to comment.