Skip to content

Commit

Permalink
feat: merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiGuranIonos committed Nov 22, 2024
2 parents b58180b + beca0e3 commit e1ff7dd
Show file tree
Hide file tree
Showing 11 changed files with 448 additions and 21 deletions.
17 changes: 9 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
- Add bootvolume_selector to `https://docs.ionos.com/
- Add servers to `https://docs.ionos.com/`
- Add cube server and vcpu server to `https://docs.ionos.com/`
### Enhancement
- Add `allow_replace` to `ionoscloud_server` and `ionoscloud_cube_server` resources, which allows the update of immutable server fields by destroying and then re-creating the resource. This field should be used with care, understanding the risks.
### Fixes
- All `id` and `name` fields in data sources need to be computed, so value can be read on first apply.
- Refactor `ionoscloud_share` and `ionoscloud_nic` data sources
### Testing
- Fix template test
- Remove cpu_family from server test
- Add basic NFS tests

## 6.6.2
### Features
Expand All @@ -24,14 +33,6 @@
- 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

### Fixes
- All `id` and `name` fields in data sources need to be computed, so value can be read on first apply.
- Refactor `ionoscloud_share` and `ionoscloud_nic` data sources

### Testing
- Fix template test
- Remove cpu_family from server test

### New Product - **Network Security Groups**:
- `Resources`:
- [ionoscloud_nsg](docs/resources/nsg.md)
Expand Down
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@

The IonosCloud provider gives the ability to deploy and configure resources using the IonosCloud APIs.

---
### Warning: API Basic Authentication Deprecation Notice
Effective March 15, 2024, IONOS account holders using 2-Factor Authentication will no longer be able to utilize Basic Authentication for accessing our APIs, SDKs, and all related tools. Token creation and deletion via APIs and ionosCTL will also be restricted.

Affected users are required to switch to token-based authorization. These tokens will be accessible through our new Token Manager in the Data Center Designer, launching at the beginning of February 2024. More information can be found [here](https://docs.ionos.com/cloud/getting-started/basic-tutorials/deprecation-basic-authentication/basic-authentication-deprecation-faqs).

---

## Requirements
Expand Down Expand Up @@ -248,4 +242,7 @@ now you can see the response body incl. api error message:
## Frequently Asked Questions

### How can I find out the IP for the added NIC on a K8s nodepool?
Please check out this [module](https://github.com/ionos-cloud/terraform-ionoscloud-kube-lan-ip).
Please check out this [module](https://github.com/ionos-cloud/terraform-ionoscloud-kube-lan-ip).

### For more complex examples on how to use the provider
Please check out the [examples](examples/) directory.
3 changes: 3 additions & 0 deletions docs/resources/cube_server.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ resource "random_password" "server_image_password" {
- `ssh_key_path` - (Optional)[list] List of paths to files containing a public SSH key that will be injected into IonosCloud provided Linux images. Required for IonosCloud Linux images. Required if `image_password` is not provided.
- `image_password` - (Optional)[string] Required if `ssh_key_path` is not provided.
- `security_groups_ids` - (Optional) The list of Security Group IDs for the resource.
- `allow_replace` - (Optional)[bool] When set to true, allows the update of immutable fields by first destroying and then re-creating the server.

⚠️ **_Warning: `allow_replace` - lets you update immutable fields, but it first destroys and then re-creates the server in order to do it. This field should be used with care, understanding the risks._**

> **⚠ WARNING**
>
Expand Down
3 changes: 3 additions & 0 deletions docs/resources/server.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,9 @@ resource "ionoscloud_server" "test" {
- `value` - (Required)[string] The value of the label.
- `inline_volume_ids` - (Computed) A list with the IDs for the volumes that are defined inside the server resource.
- `security_groups_ids` - (Optional) The list of Security Group IDs for the
- `allow_replace` - (Optional)[bool] When set to true, allows the update of immutable fields by first destroying and then re-creating the server.

⚠️ **_Warning: `allow_replace` - lets you update immutable fields, but it first destroys and then re-creates the server in order to do it. This field should be used with care, understanding the risks._**

> **⚠ WARNING**
>
Expand Down
5 changes: 4 additions & 1 deletion gitbook_docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,7 @@ now you can see the response body incl. api error message:
"message" : "[VDC-yy-xxxx] Operation cannot be executed since this Kubernetes Nodepool is already marked for deletion. Current state of the resource is FAILED_DESTROYING."
}]
}
```
```

### For more complex examples on how to use the provider
Please check out the [examples](examples/) directory.
2 changes: 1 addition & 1 deletion ionoscloud/import_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestAccServerImportBasic(t *testing.T) {
ImportStateIdFunc: testAccServerImportStateIdWithNicAndFw,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"image_password", "ssh_key_path.#", "image_name", "volume.0.user_data", "volume.0.backup_unit_id", "firewallrule_id", "primary_nic", "inline_volume_ids"},
ImportStateVerifyIgnore: []string{"image_password", "ssh_key_path.#", "image_name", "volume.0.user_data", "volume.0.backup_unit_id", "firewallrule_id", "primary_nic", "inline_volume_ids", "allow_replace"},
},
},
})
Expand Down
13 changes: 13 additions & 0 deletions ionoscloud/resource_cube_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func resourceCubeServer() *schema.Resource {
"template_uuid": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"name": {
Type: schema.TypeString,
Expand All @@ -56,6 +57,7 @@ func resourceCubeServer() *schema.Resource {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
ValidateDiagFunc: validation.ToDiagFunc(validation.StringInSlice([]string{"AUTO", "ZONE_1", "ZONE_2"}, true)),
},
"boot_volume": {
Expand Down Expand Up @@ -103,6 +105,7 @@ func resourceCubeServer() *schema.Resource {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
},
"ssh_key_path": {
Type: schema.TypeList,
Expand All @@ -126,6 +129,7 @@ func resourceCubeServer() *schema.Resource {
"disk_type": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateDiagFunc: validation.ToDiagFunc(validation.StringIsNotWhiteSpace),
},
"image_password": {
Expand Down Expand Up @@ -180,6 +184,7 @@ func resourceCubeServer() *schema.Resource {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
ValidateDiagFunc: validation.ToDiagFunc(validation.StringInSlice([]string{"AUTO", "ZONE_1", "ZONE_2", "ZONE_3"}, true)),
},
"cpu_hot_plug": {
Expand Down Expand Up @@ -215,12 +220,14 @@ func resourceCubeServer() *schema.Resource {
Description: "The uuid of the Backup Unit that user has access to. The property is immutable and is only allowed to be set on a new volume creation. It is mandatory to provide either 'public image' or 'imageAlias' in conjunction with this property.",
Optional: true,
Computed: true,
ForceNew: true,
},
"user_data": {
Type: schema.TypeString,
Description: "The cloud-init configuration for the volume as base64 encoded string. The property is immutable and is only allowed to be set on a new volume creation. It is mandatory to provide either 'public image' or 'imageAlias' that has cloud-init compatibility in conjunction with this property.",
Optional: true,
Computed: true,
ForceNew: true,
},
"pci_slot": {
Type: schema.TypeInt,
Expand Down Expand Up @@ -375,6 +382,12 @@ func resourceCubeServer() *schema.Resource {
Type: schema.TypeString,
},
},
"allow_replace": {
Type: schema.TypeBool,
Optional: true,
Default: false,
Description: "When set to true, allows the update of immutable fields by destroying and re-creating the resource.",
},
},
Timeouts: &resourceDefaultTimeouts,
}
Expand Down
6 changes: 3 additions & 3 deletions ionoscloud/resource_networkloadbalancer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func TestAccNetworkLoadBalancerBasic(t *testing.T) {
resource.TestCheckResourceAttr(networkLoadBalancerResource, "name", constant.NetworkLoadBalancerTestResource),
resource.TestCheckResourceAttr(networkLoadBalancerResource, "ips.0", "10.12.118.224"),
resource.TestCheckResourceAttr(networkLoadBalancerResource, "lb_private_ips.0", "10.13.72.225/24"),
resource.TestCheckResourceAttr(networkLoadBalancerResource, "central_logging", true),
resource.TestCheckResourceAttr(networkLoadBalancerResource, "central_logging", "true"),
resource.TestCheckResourceAttr(networkLoadBalancerResource, "logging_format", `%{+Q}o %{-Q}ci - - [%trg] %r %ST %B "" "" %cp %ms %ft %b %s %TR %Tw %Tc %Tr %Ta %tsc %ac %fc %bc %sc %rc %sq %bq %CC %CS %hrl %hsl`),
resource.TestCheckResourceAttrPair(networkLoadBalancerResource, "listener_lan", constant.LanResource+".nlb_lan_1", "id"),
resource.TestCheckResourceAttrPair(networkLoadBalancerResource, "target_lan", constant.LanResource+".nlb_lan_2", "id"),
Expand All @@ -72,7 +72,7 @@ func TestAccNetworkLoadBalancerBasic(t *testing.T) {
resource.TestCheckResourceAttrPair(networkLoadBalancerResource, "ips", dataSourceNetworkLoadBalancerId, "ips"),
resource.TestCheckResourceAttrPair(networkLoadBalancerResource, "target_lan", dataSourceNetworkLoadBalancerId, "target_lan"),
resource.TestCheckResourceAttrPair(networkLoadBalancerResource, "lb_private_ips", dataSourceNetworkLoadBalancerId, "lb_private_ips"),
resource.TestCheckResourceAttrPair(networkLoadBalancerResource, "central_logging", true, "central_logging"),
resource.TestCheckResourceAttrPair(networkLoadBalancerResource, "central_logging", "true", "central_logging"),
resource.TestCheckResourceAttrPair(networkLoadBalancerResource, "logging_format", `%{+Q}o %{-Q}ci - - [%trg] %r %ST %B "" "" %cp %ms %ft %b %s %TR %Tw %Tc %Tr %Ta %tsc %ac %fc %bc %sc %rc %sq %bq %CC %CS %hrl %hsl`, "logging_format"),
resource.TestCheckResourceAttrPair(dataSourceNetworkLoadBalancerId, "flowlog.0.name", networkLoadBalancerResource, "flowlog.0.name"),
resource.TestCheckResourceAttrPair(dataSourceNetworkLoadBalancerId, "flowlog.0.action", networkLoadBalancerResource, "flowlog.0.action"),
Expand Down Expand Up @@ -102,7 +102,7 @@ func TestAccNetworkLoadBalancerBasic(t *testing.T) {
resource.TestCheckResourceAttr(networkLoadBalancerResource, "ips.1", "10.12.119.224"),
resource.TestCheckResourceAttr(networkLoadBalancerResource, "lb_private_ips.0", "10.13.72.225/24"),
resource.TestCheckResourceAttr(networkLoadBalancerResource, "lb_private_ips.1", "10.13.73.225/24"),
resource.TestCheckResourceAttr(networkLoadBalancerResource, "central_logging", false),
resource.TestCheckResourceAttr(networkLoadBalancerResource, "central_logging", "false"),
resource.TestCheckResourceAttr(networkLoadBalancerResource, "logging_format", `%{+Q}o %{-Q}ci - - [%trg] %r %ST %B "" "" %cp %ms %ft %b %s %TR %Tw %Tc %Tr %Ta %tsc %ac %fc %bc %sc %rc %sq %bq %CC %CS %hrl %hsl`),
resource.TestCheckResourceAttrPair(networkLoadBalancerResource, "listener_lan", constant.LanResource+".nlb_lan_3", "id"),
resource.TestCheckResourceAttrPair(networkLoadBalancerResource, "target_lan", constant.LanResource+".nlb_lan_4", "id"),
Expand Down
Loading

0 comments on commit e1ff7dd

Please sign in to comment.