diff --git a/.gitignore b/.gitignore index 0723b9c2..09fb0713 100644 --- a/.gitignore +++ b/.gitignore @@ -30,4 +30,7 @@ vendor/ # Go workspace file go.work -go.work.sum \ No newline at end of file +go.work.sum + +# Unit test files +stackit/internal/services/iaas/test-512k.img diff --git a/docs/data-sources/image.md b/docs/data-sources/image.md index 50a2fe16..23566526 100644 --- a/docs/data-sources/image.md +++ b/docs/data-sources/image.md @@ -4,15 +4,12 @@ page_title: "stackit_image Data Source - stackit" subcategory: "" description: |- Image datasource schema. Must have a region specified in the provider configuration. - ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources. --- # stackit_image (Data Source) Image datasource schema. Must have a `region` specified in the provider configuration. -~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources. - ## Example Usage ```terraform diff --git a/docs/data-sources/key_pair.md b/docs/data-sources/key_pair.md index f370793b..6000df6e 100644 --- a/docs/data-sources/key_pair.md +++ b/docs/data-sources/key_pair.md @@ -4,15 +4,12 @@ page_title: "stackit_key_pair Data Source - stackit" subcategory: "" description: |- Key pair resource schema. Must have a region specified in the provider configuration. - ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources. --- # stackit_key_pair (Data Source) Key pair resource schema. Must have a `region` specified in the provider configuration. -~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources. - ## Example Usage ```terraform diff --git a/docs/data-sources/network_area.md b/docs/data-sources/network_area.md index 9b092aa5..d561f3b3 100644 --- a/docs/data-sources/network_area.md +++ b/docs/data-sources/network_area.md @@ -4,15 +4,12 @@ page_title: "stackit_network_area Data Source - stackit" subcategory: "" description: |- Network area datasource schema. Must have a region specified in the provider configuration. - ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources. --- # stackit_network_area (Data Source) Network area datasource schema. Must have a `region` specified in the provider configuration. -~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources. - ## Example Usage ```terraform diff --git a/docs/data-sources/network_area_route.md b/docs/data-sources/network_area_route.md index f2b03e7d..688864a9 100644 --- a/docs/data-sources/network_area_route.md +++ b/docs/data-sources/network_area_route.md @@ -3,15 +3,12 @@ page_title: "stackit_network_area_route Data Source - stackit" subcategory: "" description: |- - Network area route data source schema. Must have a region specified in the provider configuration. - ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources. + Network area route data resource schema. Must have a region specified in the provider configuration. --- # stackit_network_area_route (Data Source) -Network area route data source schema. Must have a `region` specified in the provider configuration. - -~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources. +Network area route data resource schema. Must have a `region` specified in the provider configuration. ## Example Usage diff --git a/docs/data-sources/network_interface.md b/docs/data-sources/network_interface.md index c62e75ec..14c0566f 100644 --- a/docs/data-sources/network_interface.md +++ b/docs/data-sources/network_interface.md @@ -4,15 +4,12 @@ page_title: "stackit_network_interface Data Source - stackit" subcategory: "" description: |- Network interface datasource schema. Must have a region specified in the provider configuration. - ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources. --- # stackit_network_interface (Data Source) Network interface datasource schema. Must have a `region` specified in the provider configuration. -~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources. - ## Example Usage ```terraform diff --git a/docs/data-sources/public_ip.md b/docs/data-sources/public_ip.md index bd4a480f..a2db13a7 100644 --- a/docs/data-sources/public_ip.md +++ b/docs/data-sources/public_ip.md @@ -4,15 +4,12 @@ page_title: "stackit_public_ip Data Source - stackit" subcategory: "" description: |- Public IP resource schema. Must have a region specified in the provider configuration. - ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources. --- # stackit_public_ip (Data Source) Public IP resource schema. Must have a `region` specified in the provider configuration. -~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources. - ## Example Usage ```terraform diff --git a/docs/data-sources/public_ip_ranges.md b/docs/data-sources/public_ip_ranges.md index 6cbacf18..0a1fbb27 100644 --- a/docs/data-sources/public_ip_ranges.md +++ b/docs/data-sources/public_ip_ranges.md @@ -4,15 +4,12 @@ page_title: "stackit_public_ip_ranges Data Source - stackit" subcategory: "" description: |- A list of all public IP ranges that STACKIT uses. - ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources. --- # stackit_public_ip_ranges (Data Source) A list of all public IP ranges that STACKIT uses. -~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources. - ## Example Usage ```terraform diff --git a/docs/data-sources/security_group.md b/docs/data-sources/security_group.md index f8622cea..5a5af8a4 100644 --- a/docs/data-sources/security_group.md +++ b/docs/data-sources/security_group.md @@ -4,15 +4,12 @@ page_title: "stackit_security_group Data Source - stackit" subcategory: "" description: |- Security group datasource schema. Must have a region specified in the provider configuration. - ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources. --- # stackit_security_group (Data Source) Security group datasource schema. Must have a `region` specified in the provider configuration. -~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources. - ## Example Usage ```terraform diff --git a/docs/data-sources/security_group_rule.md b/docs/data-sources/security_group_rule.md index 4d14d944..124f0bfe 100644 --- a/docs/data-sources/security_group_rule.md +++ b/docs/data-sources/security_group_rule.md @@ -4,15 +4,12 @@ page_title: "stackit_security_group_rule Data Source - stackit" subcategory: "" description: |- Security group datasource schema. Must have a region specified in the provider configuration. - ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources. --- # stackit_security_group_rule (Data Source) Security group datasource schema. Must have a `region` specified in the provider configuration. -~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources. - ## Example Usage ```terraform diff --git a/docs/data-sources/server.md b/docs/data-sources/server.md index 9999722c..ff7d0ab8 100644 --- a/docs/data-sources/server.md +++ b/docs/data-sources/server.md @@ -4,15 +4,12 @@ page_title: "stackit_server Data Source - stackit" subcategory: "" description: |- Server datasource schema. Must have a region specified in the provider configuration. - ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources. --- # stackit_server (Data Source) Server datasource schema. Must have a `region` specified in the provider configuration. -~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources. - diff --git a/docs/data-sources/volume.md b/docs/data-sources/volume.md index 41bc4fa9..26d554d9 100644 --- a/docs/data-sources/volume.md +++ b/docs/data-sources/volume.md @@ -4,15 +4,12 @@ page_title: "stackit_volume Data Source - stackit" subcategory: "" description: |- Volume resource schema. Must have a region specified in the provider configuration. - ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources. --- # stackit_volume (Data Source) Volume resource schema. Must have a `region` specified in the provider configuration. -~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources. - ## Example Usage ```terraform diff --git a/docs/resources/affinity_group.md b/docs/resources/affinity_group.md index 944adb90..bd1470e1 100644 --- a/docs/resources/affinity_group.md +++ b/docs/resources/affinity_group.md @@ -35,7 +35,6 @@ description: |- on the same compute node if possible, but if not possible they still will be scheduled instead of failure. soft-anti-affinity- All servers launched in this group will be hosted on different compute nodes if possible, but if not possible they still will be scheduled instead of failure. - ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources. --- # stackit_affinity_group (Resource) @@ -80,9 +79,6 @@ resource "stackit_server" "example-server" { * `soft-anti-affinity`- All servers launched in this group will be hosted on different compute nodes if possible, but if not possible they still will be scheduled instead of failure. - -~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources. - ## Example Usage ```terraform diff --git a/docs/resources/key_pair.md b/docs/resources/key_pair.md index 0a6472fe..69aaf59d 100644 --- a/docs/resources/key_pair.md +++ b/docs/resources/key_pair.md @@ -23,9 +23,6 @@ description: |- machine_type = "g1.1" keypair_name = "example-key-pair" } - - - ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources. --- # stackit_key_pair (Resource) @@ -56,8 +53,6 @@ resource "stackit_server" "example-server" { ``` -~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources. - diff --git a/docs/resources/network_area.md b/docs/resources/network_area.md index 2c2985a5..c35f8cd1 100644 --- a/docs/resources/network_area.md +++ b/docs/resources/network_area.md @@ -4,15 +4,12 @@ page_title: "stackit_network_area Resource - stackit" subcategory: "" description: |- Network area resource schema. Must have a region specified in the provider configuration. - ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources. --- # stackit_network_area (Resource) Network area resource schema. Must have a `region` specified in the provider configuration. -~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources. - ## Example Usage ```terraform diff --git a/docs/resources/network_area_route.md b/docs/resources/network_area_route.md index ef3dd862..e9c0693f 100644 --- a/docs/resources/network_area_route.md +++ b/docs/resources/network_area_route.md @@ -4,15 +4,12 @@ page_title: "stackit_network_area_route Resource - stackit" subcategory: "" description: |- Network area route resource schema. Must have a region specified in the provider configuration. - ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources. --- # stackit_network_area_route (Resource) Network area route resource schema. Must have a `region` specified in the provider configuration. -~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources. - ## Example Usage ```terraform diff --git a/docs/resources/network_interface.md b/docs/resources/network_interface.md index 29b7e4cd..6f264ad2 100644 --- a/docs/resources/network_interface.md +++ b/docs/resources/network_interface.md @@ -4,15 +4,12 @@ page_title: "stackit_network_interface Resource - stackit" subcategory: "" description: |- Network interface resource schema. Must have a region specified in the provider configuration. - ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources. --- # stackit_network_interface (Resource) Network interface resource schema. Must have a `region` specified in the provider configuration. -~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources. - ## Example Usage ```terraform diff --git a/docs/resources/public_ip.md b/docs/resources/public_ip.md index f2f2c797..ab3e7593 100644 --- a/docs/resources/public_ip.md +++ b/docs/resources/public_ip.md @@ -4,15 +4,12 @@ page_title: "stackit_public_ip Resource - stackit" subcategory: "" description: |- Public IP resource schema. Must have a region specified in the provider configuration. - ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources. --- # stackit_public_ip (Resource) Public IP resource schema. Must have a `region` specified in the provider configuration. -~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources. - ## Example Usage ```terraform diff --git a/docs/resources/public_ip_associate.md b/docs/resources/public_ip_associate.md index 829ea4af..58285593 100644 --- a/docs/resources/public_ip_associate.md +++ b/docs/resources/public_ip_associate.md @@ -6,7 +6,6 @@ description: |- Associates an existing public IP to a network interface. This is useful for situations where you have a pre-allocated public IP or unable to use the stackit_public_ip resource to create a new public IP. Must have a region specified in the provider configuration. !> The stackit_public_ip_associate resource should not be used together with the stackit_public_ip resource for the same public IP or for the same network interface. Using both resources together for the same public IP or network interface WILL lead to conflicts, as they both have control of the public IP and network interface association. - ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources. --- # stackit_public_ip_associate (Resource) @@ -16,8 +15,6 @@ Associates an existing public IP to a network interface. This is useful for situ !> The `stackit_public_ip_associate` resource should not be used together with the `stackit_public_ip` resource for the same public IP or for the same network interface. Using both resources together for the same public IP or network interface WILL lead to conflicts, as they both have control of the public IP and network interface association. -~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources. - ## Example Usage ```terraform diff --git a/docs/resources/security_group.md b/docs/resources/security_group.md index bc5ee7ca..f2b6915b 100644 --- a/docs/resources/security_group.md +++ b/docs/resources/security_group.md @@ -4,15 +4,12 @@ page_title: "stackit_security_group Resource - stackit" subcategory: "" description: |- Security group resource schema. Must have a region specified in the provider configuration. - ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources. --- # stackit_security_group (Resource) Security group resource schema. Must have a `region` specified in the provider configuration. -~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources. - ## Example Usage ```terraform diff --git a/docs/resources/security_group_rule.md b/docs/resources/security_group_rule.md index ac8a3f6f..0354cd84 100644 --- a/docs/resources/security_group_rule.md +++ b/docs/resources/security_group_rule.md @@ -4,15 +4,12 @@ page_title: "stackit_security_group_rule Resource - stackit" subcategory: "" description: |- Security group rule resource schema. Must have a region specified in the provider configuration. - ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources. --- # stackit_security_group_rule (Resource) Security group rule resource schema. Must have a `region` specified in the provider configuration. -~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources. - ## Example Usage ```terraform diff --git a/docs/resources/server.md b/docs/resources/server.md index ac9b146d..b49e3299 100644 --- a/docs/resources/server.md +++ b/docs/resources/server.md @@ -4,7 +4,6 @@ page_title: "stackit_server Resource - stackit" subcategory: "" description: |- Server resource schema. Must have a region specified in the provider configuration. - ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources. Example Usage With key pair @@ -184,7 +183,6 @@ description: |- Server resource schema. Must have a region specified in the provider configuration. -~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources. ## Example Usage diff --git a/docs/resources/server_network_interface_attach.md b/docs/resources/server_network_interface_attach.md index 27ddbc0c..b2cd6b1f 100644 --- a/docs/resources/server_network_interface_attach.md +++ b/docs/resources/server_network_interface_attach.md @@ -4,15 +4,12 @@ page_title: "stackit_server_network_interface_attach Resource - stackit" subcategory: "" description: |- Network interface attachment resource schema. Attaches a network interface to a server. Must have a region specified in the provider configuration. The attachment only takes full effect after server reboot. - ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources. --- # stackit_server_network_interface_attach (Resource) Network interface attachment resource schema. Attaches a network interface to a server. Must have a `region` specified in the provider configuration. The attachment only takes full effect after server reboot. -~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources. - ## Example Usage ```terraform diff --git a/docs/resources/server_service_account_attach.md b/docs/resources/server_service_account_attach.md index d826cac1..40034417 100644 --- a/docs/resources/server_service_account_attach.md +++ b/docs/resources/server_service_account_attach.md @@ -4,15 +4,12 @@ page_title: "stackit_server_service_account_attach Resource - stackit" subcategory: "" description: |- Service account attachment resource schema. Attaches a service account to a server. Must have a region specified in the provider configuration. - ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources. --- # stackit_server_service_account_attach (Resource) Service account attachment resource schema. Attaches a service account to a server. Must have a `region` specified in the provider configuration. -~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources. - ## Example Usage ```terraform diff --git a/docs/resources/server_volume_attach.md b/docs/resources/server_volume_attach.md index 8841bae4..8743717d 100644 --- a/docs/resources/server_volume_attach.md +++ b/docs/resources/server_volume_attach.md @@ -4,15 +4,12 @@ page_title: "stackit_server_volume_attach Resource - stackit" subcategory: "" description: |- Volume attachment resource schema. Attaches a volume to a server. Must have a region specified in the provider configuration. - ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources. --- # stackit_server_volume_attach (Resource) Volume attachment resource schema. Attaches a volume to a server. Must have a `region` specified in the provider configuration. -~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources. - ## Example Usage ```terraform diff --git a/docs/resources/volume.md b/docs/resources/volume.md index b080b202..46456198 100644 --- a/docs/resources/volume.md +++ b/docs/resources/volume.md @@ -4,15 +4,12 @@ page_title: "stackit_volume Resource - stackit" subcategory: "" description: |- Volume resource schema. Must have a region specified in the provider configuration. - ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources. --- # stackit_volume (Resource) Volume resource schema. Must have a `region` specified in the provider configuration. -~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources. - ## Example Usage ```terraform diff --git a/go.mod b/go.mod index 5775a9db..60667fd9 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/stackitcloud/stackit-sdk-go/core v0.16.0 github.com/stackitcloud/stackit-sdk-go/services/argus v0.11.0 github.com/stackitcloud/stackit-sdk-go/services/dns v0.13.0 - github.com/stackitcloud/stackit-sdk-go/services/iaas v0.21.1 + github.com/stackitcloud/stackit-sdk-go/services/iaas v0.22.0 github.com/stackitcloud/stackit-sdk-go/services/loadbalancer v1.0.0 github.com/stackitcloud/stackit-sdk-go/services/logme v0.21.0 github.com/stackitcloud/stackit-sdk-go/services/mariadb v0.21.0 diff --git a/go.sum b/go.sum index f2e1c114..8ec6eb02 100644 --- a/go.sum +++ b/go.sum @@ -159,10 +159,8 @@ github.com/stackitcloud/stackit-sdk-go/services/authorization v0.6.0 h1:nSaSvo9o github.com/stackitcloud/stackit-sdk-go/services/authorization v0.6.0/go.mod h1:LoOkWrUropfVm72oE5aWSC9yRiM3s8Vf3TvC7HtC3b8= github.com/stackitcloud/stackit-sdk-go/services/dns v0.13.0 h1:gEoA2oj3OcDg3XI0KSJm8mCjQz9WOZENeSgfTFPK8ow= github.com/stackitcloud/stackit-sdk-go/services/dns v0.13.0/go.mod h1:JE8POcTfSxTo+g1MkgVQ+OjT4jWEr08MIY8qx3Hi+Tw= -github.com/stackitcloud/stackit-sdk-go/services/iaas v0.21.1 h1:ZFFJr54FcYTUBjE+5E3Cx92jTDdHGKT2DTIvvJSRrTc= -github.com/stackitcloud/stackit-sdk-go/services/iaas v0.21.1/go.mod h1:9p5IIdOKOM5/DIjbenKrWvz6GlSps4jsPJZkH7QJuRU= -github.com/stackitcloud/stackit-sdk-go/services/loadbalancer v0.18.0 h1:7nNjIIcBQRDVnW4NL7+R8DaCKEqxxxsmVsgOVe50ZMU= -github.com/stackitcloud/stackit-sdk-go/services/loadbalancer v0.18.0/go.mod h1:UFujBT+JlNvl6JNrY96UpLGqp+lZTD+JWL7siqhGPlw= +github.com/stackitcloud/stackit-sdk-go/services/iaas v0.22.0 h1:xaNory8kBIsBG7PJnBfPP1cERc+ERqjebxmEmEOvRHU= +github.com/stackitcloud/stackit-sdk-go/services/iaas v0.22.0/go.mod h1:LVOYlzNt5BXDC42AHd/GZj6KvlCg4w94of/E6pZOj5k= github.com/stackitcloud/stackit-sdk-go/services/loadbalancer v1.0.0 h1:z2p0OobEAgSE5bQr+KR+4Y1QTvDbSC2a7w2eCV/oSp4= github.com/stackitcloud/stackit-sdk-go/services/loadbalancer v1.0.0/go.mod h1:x0jgrL+/K2cE4BvcIQByFUf0nOPVZRqq5Z074kjjr64= github.com/stackitcloud/stackit-sdk-go/services/logme v0.21.0 h1:P7bxaVzkZPGMWItLynKIvc88Xh6jCnK4dPTTT+L607o= diff --git a/stackit/internal/services/iaas/affinitygroup/datasource.go b/stackit/internal/services/iaas/affinitygroup/datasource.go index 6f1e50e2..cbbec093 100644 --- a/stackit/internal/services/iaas/affinitygroup/datasource.go +++ b/stackit/internal/services/iaas/affinitygroup/datasource.go @@ -7,7 +7,6 @@ import ( "regexp" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" - "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/features" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate" "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" @@ -22,8 +21,6 @@ import ( "github.com/stackitcloud/stackit-sdk-go/services/iaas" ) -var affinityGroupDataSourceBetaCheckDone bool - var ( _ datasource.DataSource = &affinityGroupDatasource{} _ datasource.DataSourceWithConfigure = &affinityGroupDatasource{} @@ -49,14 +46,6 @@ func (d *affinityGroupDatasource) Configure(ctx context.Context, req datasource. return } - if !affinityGroupDataSourceBetaCheckDone { - features.CheckBetaResourcesEnabled(ctx, &providerData, &resp.Diagnostics, "stackit_affinity_group", "data source") - if resp.Diagnostics.HasError() { - return - } - affinityGroupDataSourceBetaCheckDone = true - } - var apiClient *iaas.APIClient var err error if providerData.IaaSCustomEndpoint != "" { diff --git a/stackit/internal/services/iaas/affinitygroup/resource.go b/stackit/internal/services/iaas/affinitygroup/resource.go index e5748eb8..d50481b0 100644 --- a/stackit/internal/services/iaas/affinitygroup/resource.go +++ b/stackit/internal/services/iaas/affinitygroup/resource.go @@ -9,7 +9,6 @@ import ( "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/conversion" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" - "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/features" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate" "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" @@ -27,11 +26,6 @@ import ( "github.com/stackitcloud/stackit-sdk-go/services/iaas" ) -// affinityGroupResourceBetaCheckDone is used to prevent multiple checks for beta resources. -// This is a workaround for the lack of a global state in the provider and -// needs to exist because the Configure method is called twice. -var affinityGroupResourceBetaCheckDone bool - var ( _ resource.Resource = &affinityGroupResource{} _ resource.ResourceWithConfigure = &affinityGroupResource{} @@ -75,14 +69,6 @@ func (r *affinityGroupResource) Configure(ctx context.Context, req resource.Conf return } - if !affinityGroupResourceBetaCheckDone { - features.CheckBetaResourcesEnabled(ctx, &providerData, &resp.Diagnostics, "stackit_affinity_group", "resource") - if resp.Diagnostics.HasError() { - return - } - affinityGroupResourceBetaCheckDone = true - } - var apiClient *iaas.APIClient var err error if providerData.IaaSCustomEndpoint != "" { @@ -111,7 +97,7 @@ func (r *affinityGroupResource) Schema(_ context.Context, _ resource.SchemaReque description := "Affinity Group schema. Must have a `region` specified in the provider configuration." resp.Schema = schema.Schema{ Description: description, - MarkdownDescription: features.AddBetaDescription(description + "\n\n" + exampleUsageWithServer + policies), + MarkdownDescription: description + "\n\n" + exampleUsageWithServer + policies, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Description: "Terraform's internal resource identifier. It is structured as \"`project_id`,`affinity_group_id`\".", diff --git a/stackit/internal/services/iaas/image/datasource.go b/stackit/internal/services/iaas/image/datasource.go index f12d7e13..04e676e6 100644 --- a/stackit/internal/services/iaas/image/datasource.go +++ b/stackit/internal/services/iaas/image/datasource.go @@ -18,15 +18,9 @@ import ( "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/services/iaas" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" - "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/features" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate" ) -// imageDataSourceBetaCheckDone is used to prevent multiple checks for beta resources. -// This is a workaround for the lack of a global state in the provider and -// needs to exist because the Configure method is called twice. -var imageDataSourceBetaCheckDone bool - // Ensure the implementation satisfies the expected interfaces. var ( _ datasource.DataSource = &imageDataSource{} @@ -77,14 +71,6 @@ func (d *imageDataSource) Configure(ctx context.Context, req datasource.Configur return } - if !imageDataSourceBetaCheckDone { - features.CheckBetaResourcesEnabled(ctx, &providerData, &resp.Diagnostics, "stackit_image", "data source") - if resp.Diagnostics.HasError() { - return - } - imageDataSourceBetaCheckDone = true - } - if providerData.IaaSCustomEndpoint != "" { apiClient, err = iaas.NewAPIClient( config.WithCustomAuth(providerData.RoundTripper), @@ -107,9 +93,10 @@ func (d *imageDataSource) Configure(ctx context.Context, req datasource.Configur // Schema defines the schema for the datasource. func (r *imageDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) { + description := "Image datasource schema. Must have a `region` specified in the provider configuration." resp.Schema = schema.Schema{ - MarkdownDescription: features.AddBetaDescription("Image datasource schema. Must have a `region` specified in the provider configuration."), - Description: "Image datasource schema. Must have a `region` specified in the provider configuration.", + MarkdownDescription: description, + Description: description, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Description: "Terraform's internal resource ID. It is structured as \"`project_id`,`image_id`\".", diff --git a/stackit/internal/services/iaas/image/resource.go b/stackit/internal/services/iaas/image/resource.go index 8a441104..ddb1e784 100644 --- a/stackit/internal/services/iaas/image/resource.go +++ b/stackit/internal/services/iaas/image/resource.go @@ -28,15 +28,9 @@ import ( "github.com/stackitcloud/stackit-sdk-go/services/iaas/wait" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/conversion" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" - "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/features" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate" ) -// resourceBetaCheckDone is used to prevent multiple checks for beta resources. -// This is a workaround for the lack of a global state in the provider and -// needs to exist because the Configure method is called twice. -var resourceBetaCheckDone bool - // Ensure the implementation satisfies the expected interfaces. var ( _ resource.Resource = &imageResource{} @@ -134,14 +128,6 @@ func (r *imageResource) Configure(ctx context.Context, req resource.ConfigureReq return } - if !resourceBetaCheckDone { - features.CheckBetaResourcesEnabled(ctx, &providerData, &resp.Diagnostics, "stackit_image", "resource") - if resp.Diagnostics.HasError() { - return - } - resourceBetaCheckDone = true - } - var apiClient *iaas.APIClient var err error if providerData.IaaSCustomEndpoint != "" { diff --git a/stackit/internal/services/iaas/keypair/datasource.go b/stackit/internal/services/iaas/keypair/datasource.go index 0faeb2d5..d6cbd1b3 100644 --- a/stackit/internal/services/iaas/keypair/datasource.go +++ b/stackit/internal/services/iaas/keypair/datasource.go @@ -14,14 +14,8 @@ import ( "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/services/iaas" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" - "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/features" ) -// keyPairDataSourceBetaCheckDone is used to prevent multiple checks for beta resources. -// This is a workaround for the lack of a global state in the provider and -// needs to exist because the Configure method is called twice. -var keyPairDataSourceBetaCheckDone bool - // Ensure the implementation satisfies the expected interfaces. var ( _ datasource.DataSource = &keyPairDataSource{} @@ -57,14 +51,6 @@ func (d *keyPairDataSource) Configure(ctx context.Context, req datasource.Config return } - if !keyPairDataSourceBetaCheckDone { - features.CheckBetaResourcesEnabled(ctx, &providerData, &resp.Diagnostics, "stackit_key_pair", "data source") - if resp.Diagnostics.HasError() { - return - } - keyPairDataSourceBetaCheckDone = true - } - if providerData.IaaSCustomEndpoint != "" { apiClient, err = iaas.NewAPIClient( config.WithCustomAuth(providerData.RoundTripper), @@ -90,7 +76,7 @@ func (r *keyPairDataSource) Schema(_ context.Context, _ datasource.SchemaRequest description := "Key pair resource schema. Must have a `region` specified in the provider configuration." resp.Schema = schema.Schema{ - MarkdownDescription: features.AddBetaDescription(description), + MarkdownDescription: description, Description: description, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ diff --git a/stackit/internal/services/iaas/keypair/resource.go b/stackit/internal/services/iaas/keypair/resource.go index 63c87ac2..853b1fb7 100644 --- a/stackit/internal/services/iaas/keypair/resource.go +++ b/stackit/internal/services/iaas/keypair/resource.go @@ -19,14 +19,8 @@ import ( "github.com/stackitcloud/stackit-sdk-go/services/iaas" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/conversion" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" - "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/features" ) -// resourceBetaCheckDone is used to prevent multiple checks for beta resources. -// This is a workaround for the lack of a global state in the provider and -// needs to exist because the Configure method is called twice. -var resourceBetaCheckDone bool - // Ensure the implementation satisfies the expected interfaces. var ( _ resource.Resource = &keyPairResource{} @@ -70,14 +64,6 @@ func (r *keyPairResource) Configure(ctx context.Context, req resource.ConfigureR return } - if !resourceBetaCheckDone { - features.CheckBetaResourcesEnabled(ctx, &providerData, &resp.Diagnostics, "stackit_key_pair", "resource") - if resp.Diagnostics.HasError() { - return - } - resourceBetaCheckDone = true - } - var apiClient *iaas.APIClient var err error if providerData.IaaSCustomEndpoint != "" { @@ -107,7 +93,7 @@ func (r *keyPairResource) Schema(_ context.Context, _ resource.SchemaRequest, re description := "Key pair resource schema. Must have a `region` specified in the provider configuration. Allows uploading an SSH public key to be used for server authentication." resp.Schema = schema.Schema{ - MarkdownDescription: features.AddBetaDescription(description + "\n\n" + exampleUsageWithServer), + MarkdownDescription: description + "\n\n" + exampleUsageWithServer, Description: description, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ diff --git a/stackit/internal/services/iaas/networkarea/datasource.go b/stackit/internal/services/iaas/networkarea/datasource.go index 889660cf..2f413308 100644 --- a/stackit/internal/services/iaas/networkarea/datasource.go +++ b/stackit/internal/services/iaas/networkarea/datasource.go @@ -17,15 +17,9 @@ import ( "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/services/iaas" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" - "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/features" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate" ) -// scheduleDataSourceBetaCheckDone is used to prevent multiple checks for beta resources. -// This is a workaround for the lack of a global state in the provider and -// needs to exist because the Configure method is called twice. -var networkAreaDataSourceBetaCheckDone bool - // Ensure the implementation satisfies the expected interfaces. var ( _ datasource.DataSource = &networkAreaDataSource{} @@ -61,14 +55,6 @@ func (d *networkAreaDataSource) Configure(ctx context.Context, req datasource.Co return } - if !networkAreaDataSourceBetaCheckDone { - features.CheckBetaResourcesEnabled(ctx, &providerData, &resp.Diagnostics, "stackit_network_area", "data source") - if resp.Diagnostics.HasError() { - return - } - networkAreaDataSourceBetaCheckDone = true - } - if providerData.IaaSCustomEndpoint != "" { apiClient, err = iaas.NewAPIClient( config.WithCustomAuth(providerData.RoundTripper), @@ -91,9 +77,10 @@ func (d *networkAreaDataSource) Configure(ctx context.Context, req datasource.Co // Schema defines the schema for the data source. func (d *networkAreaDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) { + description := "Network area datasource schema. Must have a `region` specified in the provider configuration." resp.Schema = schema.Schema{ - Description: "Network area resource schema. Must have a `region` specified in the provider configuration.", - MarkdownDescription: features.AddBetaDescription("Network area datasource schema. Must have a `region` specified in the provider configuration."), + Description: description, + MarkdownDescription: description, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Description: "Terraform's internal resource ID. It is structured as \"`organization_id`,`network_area_id`\".", diff --git a/stackit/internal/services/iaas/networkarea/resource.go b/stackit/internal/services/iaas/networkarea/resource.go index 53bfabe2..e8292422 100644 --- a/stackit/internal/services/iaas/networkarea/resource.go +++ b/stackit/internal/services/iaas/networkarea/resource.go @@ -27,16 +27,10 @@ import ( "github.com/stackitcloud/stackit-sdk-go/services/iaas/wait" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/conversion" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" - "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/features" internalUtils "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate" ) -// resourceBetaCheckDone is used to prevent multiple checks for beta resources. -// This is a workaround for the lack of a global state in the provider and -// needs to exist because the Configure method is called twice. -var resourceBetaCheckDone bool - // Ensure the implementation satisfies the expected interfaces. var ( _ resource.Resource = &networkAreaResource{} @@ -99,14 +93,6 @@ func (r *networkAreaResource) Configure(ctx context.Context, req resource.Config return } - if !resourceBetaCheckDone { - features.CheckBetaResourcesEnabled(ctx, &providerData, &resp.Diagnostics, "stackit_network_area", "resource") - if resp.Diagnostics.HasError() { - return - } - resourceBetaCheckDone = true - } - var apiClient *iaas.APIClient var err error if providerData.IaaSCustomEndpoint != "" { @@ -133,9 +119,10 @@ func (r *networkAreaResource) Configure(ctx context.Context, req resource.Config // Schema defines the schema for the resource. func (r *networkAreaResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { + description := "Network area resource schema. Must have a `region` specified in the provider configuration." resp.Schema = schema.Schema{ - Description: "Network area resource schema. Must have a `region` specified in the provider configuration.", - MarkdownDescription: features.AddBetaDescription("Network area resource schema. Must have a `region` specified in the provider configuration."), + Description: description, + MarkdownDescription: description, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Description: "Terraform's internal resource ID. It is structured as \"`organization_id`,`network_area_id`\".", diff --git a/stackit/internal/services/iaas/networkarea/resource_test.go b/stackit/internal/services/iaas/networkarea/resource_test.go index a1e6d87b..d91044b9 100644 --- a/stackit/internal/services/iaas/networkarea/resource_test.go +++ b/stackit/internal/services/iaas/networkarea/resource_test.go @@ -963,14 +963,14 @@ func TestUpdateNetworkRanges(t *testing.T) { // Setup server and client router := mux.NewRouter() - router.HandleFunc("/v1beta1/organizations/{organizationId}/network-areas/{areaId}/network-ranges", func(w http.ResponseWriter, r *http.Request) { + router.HandleFunc("/v1/organizations/{organizationId}/network-areas/{areaId}/network-ranges", func(w http.ResponseWriter, r *http.Request) { if r.Method == "GET" { getAllNetworkRangesHandler(w, r) } else if r.Method == "POST" { createNetworkRangeHandler(w, r) } }) - router.HandleFunc("/v1beta1/organizations/{organizationId}/network-areas/{areaId}/network-ranges/{networkRangeId}", deleteNetworkRangeHandler) + router.HandleFunc("/v1/organizations/{organizationId}/network-areas/{areaId}/network-ranges/{networkRangeId}", deleteNetworkRangeHandler) mockedServer := httptest.NewServer(router) defer mockedServer.Close() client, err := iaas.NewAPIClient( diff --git a/stackit/internal/services/iaas/networkarearoute/datasource.go b/stackit/internal/services/iaas/networkarearoute/datasource.go index 2a03a845..4f8ffa8b 100644 --- a/stackit/internal/services/iaas/networkarearoute/datasource.go +++ b/stackit/internal/services/iaas/networkarearoute/datasource.go @@ -14,15 +14,9 @@ import ( "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/services/iaas" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" - "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/features" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate" ) -// scheduleDataSourceBetaCheckDone is used to prevent multiple checks for beta resources. -// This is a workaround for the lack of a global state in the provider and -// needs to exist because the Configure method is called twice. -var networkAreaRouteDataSourceBetaCheckDone bool - // Ensure the implementation satisfies the expected interfaces. var ( _ datasource.DataSource = &networkAreaRouteDataSource{} @@ -58,14 +52,6 @@ func (d *networkAreaRouteDataSource) Configure(ctx context.Context, req datasour return } - if !networkAreaRouteDataSourceBetaCheckDone { - features.CheckBetaResourcesEnabled(ctx, &providerData, &resp.Diagnostics, "stackit_network_area_route", "data source") - if resp.Diagnostics.HasError() { - return - } - networkAreaRouteDataSourceBetaCheckDone = true - } - if providerData.IaaSCustomEndpoint != "" { apiClient, err = iaas.NewAPIClient( config.WithCustomAuth(providerData.RoundTripper), @@ -88,9 +74,10 @@ func (d *networkAreaRouteDataSource) Configure(ctx context.Context, req datasour // Schema defines the schema for the data source. func (d *networkAreaRouteDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) { + description := "Network area route data resource schema. Must have a `region` specified in the provider configuration." resp.Schema = schema.Schema{ - Description: "Network area route data resource schema. Must have a `region` specified in the provider configuration.", - MarkdownDescription: features.AddBetaDescription("Network area route data source schema. Must have a `region` specified in the provider configuration."), + Description: description, + MarkdownDescription: description, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Description: "Terraform's internal data source ID. It is structured as \"`organization_id`,`network_area_id`,`network_area_route_id`\".", diff --git a/stackit/internal/services/iaas/networkarearoute/resource.go b/stackit/internal/services/iaas/networkarearoute/resource.go index 2053f45c..8bf47d7d 100644 --- a/stackit/internal/services/iaas/networkarearoute/resource.go +++ b/stackit/internal/services/iaas/networkarearoute/resource.go @@ -20,15 +20,9 @@ import ( "github.com/stackitcloud/stackit-sdk-go/services/iaas" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/conversion" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" - "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/features" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate" ) -// resourceBetaCheckDone is used to prevent multiple checks for beta resources. -// This is a workaround for the lack of a global state in the provider and -// needs to exist because the Configure method is called twice. -var resourceBetaCheckDone bool - // Ensure the implementation satisfies the expected interfaces. var ( _ resource.Resource = &networkAreaRouteResource{} @@ -74,14 +68,6 @@ func (r *networkAreaRouteResource) Configure(ctx context.Context, req resource.C return } - if !resourceBetaCheckDone { - features.CheckBetaResourcesEnabled(ctx, &providerData, &resp.Diagnostics, "stackit_network_area_route", "resource") - if resp.Diagnostics.HasError() { - return - } - resourceBetaCheckDone = true - } - var apiClient *iaas.APIClient var err error if providerData.IaaSCustomEndpoint != "" { @@ -108,9 +94,10 @@ func (r *networkAreaRouteResource) Configure(ctx context.Context, req resource.C // Schema defines the schema for the resource. func (r *networkAreaRouteResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { + description := "Network area route resource schema. Must have a `region` specified in the provider configuration." resp.Schema = schema.Schema{ - Description: "Network area route resource schema. Must have a `region` specified in the provider configuration.", - MarkdownDescription: features.AddBetaDescription("Network area route resource schema. Must have a `region` specified in the provider configuration."), + Description: description, + MarkdownDescription: description, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Description: "Terraform's internal resource ID. It is structured as \"`organization_id`,`network_area_id`,`network_area_route_id`\".", diff --git a/stackit/internal/services/iaas/networkinterface/datasource.go b/stackit/internal/services/iaas/networkinterface/datasource.go index a3f26b63..444057ee 100644 --- a/stackit/internal/services/iaas/networkinterface/datasource.go +++ b/stackit/internal/services/iaas/networkinterface/datasource.go @@ -14,16 +14,10 @@ import ( "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/services/iaas" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" - "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/features" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate" ) -// scheduleDataSourceBetaCheckDone is used to prevent multiple checks for beta resources. -// This is a workaround for the lack of a global state in the provider and -// needs to exist because the Configure method is called twice. -var networkInterfaceDataSourceBetaCheckDone bool - // Ensure the implementation satisfies the expected interfaces. var ( _ datasource.DataSource = &networkInterfaceDataSource{} @@ -59,14 +53,6 @@ func (d *networkInterfaceDataSource) Configure(ctx context.Context, req datasour return } - if !networkInterfaceDataSourceBetaCheckDone { - features.CheckBetaResourcesEnabled(ctx, &providerData, &resp.Diagnostics, "stackit_network_interface", "data source") - if resp.Diagnostics.HasError() { - return - } - networkInterfaceDataSourceBetaCheckDone = true - } - if providerData.IaaSCustomEndpoint != "" { apiClient, err = iaas.NewAPIClient( config.WithCustomAuth(providerData.RoundTripper), @@ -90,10 +76,11 @@ func (d *networkInterfaceDataSource) Configure(ctx context.Context, req datasour // Schema defines the schema for the data source. func (d *networkInterfaceDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) { typeOptions := []string{"server", "metadata", "gateway"} + description := "Network interface datasource schema. Must have a `region` specified in the provider configuration." resp.Schema = schema.Schema{ - MarkdownDescription: features.AddBetaDescription("Network interface datasource schema. Must have a `region` specified in the provider configuration."), - Description: "Network interface datasource schema. Must have a `region` specified in the provider configuration.", + MarkdownDescription: description, + Description: description, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Description: "Terraform's internal data source ID. It is structured as \"`project_id`,`network_id`,`network_interface_id`\".", diff --git a/stackit/internal/services/iaas/networkinterface/resource.go b/stackit/internal/services/iaas/networkinterface/resource.go index 05187299..dbb30568 100644 --- a/stackit/internal/services/iaas/networkinterface/resource.go +++ b/stackit/internal/services/iaas/networkinterface/resource.go @@ -23,16 +23,10 @@ import ( "github.com/stackitcloud/stackit-sdk-go/services/iaas" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/conversion" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" - "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/features" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate" ) -// resourceBetaCheckDone is used to prevent multiple checks for beta resources. -// This is a workaround for the lack of a global state in the provider and -// needs to exist because the Configure method is called twice. -var resourceBetaCheckDone bool - // Ensure the implementation satisfies the expected interfaces. var ( _ resource.Resource = &networkInterfaceResource{} @@ -84,14 +78,6 @@ func (r *networkInterfaceResource) Configure(ctx context.Context, req resource.C return } - if !resourceBetaCheckDone { - features.CheckBetaResourcesEnabled(ctx, &providerData, &resp.Diagnostics, "stackit_network_interface", "resource") - if resp.Diagnostics.HasError() { - return - } - resourceBetaCheckDone = true - } - var apiClient *iaas.APIClient var err error if providerData.IaaSCustomEndpoint != "" { @@ -119,10 +105,11 @@ func (r *networkInterfaceResource) Configure(ctx context.Context, req resource.C // Schema defines the schema for the resource. func (r *networkInterfaceResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { typeOptions := []string{"server", "metadata", "gateway"} + description := "Network interface resource schema. Must have a `region` specified in the provider configuration." resp.Schema = schema.Schema{ - MarkdownDescription: features.AddBetaDescription("Network interface resource schema. Must have a `region` specified in the provider configuration."), - Description: "Network interface resource schema. Must have a `region` specified in the provider configuration.", + MarkdownDescription: description, + Description: description, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Description: "Terraform's internal resource ID. It is structured as \"`project_id`,`network_id`,`network_interface_id`\".", diff --git a/stackit/internal/services/iaas/networkinterfaceattach/resource.go b/stackit/internal/services/iaas/networkinterfaceattach/resource.go index d000076a..ae3002b3 100644 --- a/stackit/internal/services/iaas/networkinterfaceattach/resource.go +++ b/stackit/internal/services/iaas/networkinterfaceattach/resource.go @@ -18,15 +18,9 @@ import ( "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/services/iaas" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" - "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/features" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate" ) -// resourceBetaCheckDone is used to prevent multiple checks for beta resources. -// This is a workaround for the lack of a global state in the provider and -// needs to exist because the Configure method is called twice. -var resourceBetaCheckDone bool - // Ensure the implementation satisfies the expected interfaces. var ( _ resource.Resource = &networkInterfaceAttachResource{} @@ -69,14 +63,6 @@ func (r *networkInterfaceAttachResource) Configure(ctx context.Context, req reso return } - if !resourceBetaCheckDone { - features.CheckBetaResourcesEnabled(ctx, &providerData, &resp.Diagnostics, "stackit_server_network_interface_attach", "resource") - if resp.Diagnostics.HasError() { - return - } - resourceBetaCheckDone = true - } - var apiClient *iaas.APIClient var err error if providerData.IaaSCustomEndpoint != "" { @@ -103,9 +89,10 @@ func (r *networkInterfaceAttachResource) Configure(ctx context.Context, req reso // Schema defines the schema for the resource. func (r *networkInterfaceAttachResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { + description := "Network interface attachment resource schema. Attaches a network interface to a server. Must have a `region` specified in the provider configuration. The attachment only takes full effect after server reboot." resp.Schema = schema.Schema{ - MarkdownDescription: features.AddBetaDescription("Network interface attachment resource schema. Attaches a network interface to a server. Must have a `region` specified in the provider configuration. The attachment only takes full effect after server reboot."), - Description: "Network interface attachment resource schema. Attaches a network interface to a server. Must have a `region` specified in the provider configuration. The attachment only takes full effect after server reboot.", + MarkdownDescription: description, + Description: description, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Description: "Terraform's internal resource ID. It is structured as \"`project_id`,`server_id`,`network_interface_id`\".", diff --git a/stackit/internal/services/iaas/publicip/datasource.go b/stackit/internal/services/iaas/publicip/datasource.go index ec23906f..0123bdfb 100644 --- a/stackit/internal/services/iaas/publicip/datasource.go +++ b/stackit/internal/services/iaas/publicip/datasource.go @@ -14,15 +14,9 @@ import ( "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/services/iaas" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" - "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/features" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate" ) -// publicIpDataSourceBetaCheckDone is used to prevent multiple checks for beta resources. -// This is a workaround for the lack of a global state in the provider and -// needs to exist because the Configure method is called twice. -var publicIpDataSourceBetaCheckDone bool - // Ensure the implementation satisfies the expected interfaces. var ( _ datasource.DataSource = &publicIpDataSource{} @@ -58,14 +52,6 @@ func (d *publicIpDataSource) Configure(ctx context.Context, req datasource.Confi return } - if !publicIpDataSourceBetaCheckDone { - features.CheckBetaResourcesEnabled(ctx, &providerData, &resp.Diagnostics, "stackit_public_ip", "data source") - if resp.Diagnostics.HasError() { - return - } - publicIpDataSourceBetaCheckDone = true - } - if providerData.IaaSCustomEndpoint != "" { apiClient, err = iaas.NewAPIClient( config.WithCustomAuth(providerData.RoundTripper), @@ -88,9 +74,10 @@ func (d *publicIpDataSource) Configure(ctx context.Context, req datasource.Confi // Schema defines the schema for the resource. func (r *publicIpDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) { + description := "Public IP resource schema. Must have a `region` specified in the provider configuration." resp.Schema = schema.Schema{ - MarkdownDescription: features.AddBetaDescription("Public IP resource schema. Must have a `region` specified in the provider configuration."), - Description: "Public IP resource schema. Must have a `region` specified in the provider configuration.", + MarkdownDescription: description, + Description: description, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Description: "Terraform's internal datasource ID. It is structured as \"`project_id`,`public_ip_id`\".", diff --git a/stackit/internal/services/iaas/publicip/resource.go b/stackit/internal/services/iaas/publicip/resource.go index 2cbe425e..4b1c463d 100644 --- a/stackit/internal/services/iaas/publicip/resource.go +++ b/stackit/internal/services/iaas/publicip/resource.go @@ -20,15 +20,9 @@ import ( "github.com/stackitcloud/stackit-sdk-go/services/iaas" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/conversion" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" - "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/features" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate" ) -// resourceBetaCheckDone is used to prevent multiple checks for beta resources. -// This is a workaround for the lack of a global state in the provider and -// needs to exist because the Configure method is called twice. -var resourceBetaCheckDone bool - // Ensure the implementation satisfies the expected interfaces. var ( _ resource.Resource = &publicIpResource{} @@ -73,14 +67,6 @@ func (r *publicIpResource) Configure(ctx context.Context, req resource.Configure return } - if !resourceBetaCheckDone { - features.CheckBetaResourcesEnabled(ctx, &providerData, &resp.Diagnostics, "stackit_public_ip", "resource") - if resp.Diagnostics.HasError() { - return - } - resourceBetaCheckDone = true - } - var apiClient *iaas.APIClient var err error if providerData.IaaSCustomEndpoint != "" { @@ -107,9 +93,10 @@ func (r *publicIpResource) Configure(ctx context.Context, req resource.Configure // Schema defines the schema for the resource. func (r *publicIpResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { + description := "Public IP resource schema. Must have a `region` specified in the provider configuration." resp.Schema = schema.Schema{ - MarkdownDescription: features.AddBetaDescription("Public IP resource schema. Must have a `region` specified in the provider configuration."), - Description: "Public IP resource schema. Must have a `region` specified in the provider configuration.", + MarkdownDescription: description, + Description: description, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Description: "Terraform's internal resource ID. It is structured as \"`project_id`,`public_ip_id`\".", diff --git a/stackit/internal/services/iaas/publicipassociate/resource.go b/stackit/internal/services/iaas/publicipassociate/resource.go index 3c025ffb..f1b81227 100644 --- a/stackit/internal/services/iaas/publicipassociate/resource.go +++ b/stackit/internal/services/iaas/publicipassociate/resource.go @@ -19,15 +19,9 @@ import ( "github.com/stackitcloud/stackit-sdk-go/services/iaas" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/conversion" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" - "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/features" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate" ) -// resourceBetaCheckDone is used to prevent multiple checks for beta resources. -// This is a workaround for the lack of a global state in the provider and -// needs to exist because the Configure method is called twice. -var resourceBetaCheckDone bool - // Ensure the implementation satisfies the expected interfaces. var ( _ resource.Resource = &publicIpAssociateResource{} @@ -71,14 +65,6 @@ func (r *publicIpAssociateResource) Configure(ctx context.Context, req resource. return } - if !resourceBetaCheckDone { - features.CheckBetaResourcesEnabled(ctx, &providerData, &resp.Diagnostics, "stackit_public_ip_associate", "resource") - if resp.Diagnostics.HasError() { - return - } - resourceBetaCheckDone = true - } - var apiClient *iaas.APIClient var err error if providerData.IaaSCustomEndpoint != "" { @@ -116,7 +102,7 @@ func (r *publicIpAssociateResource) Schema(_ context.Context, _ resource.SchemaR "Using both resources together for the same public IP or network interface WILL lead to conflicts, as they both have control of the public IP and network interface association.", } resp.Schema = schema.Schema{ - MarkdownDescription: features.AddBetaDescription(fmt.Sprintf("%s\n\n!> %s", descriptions["main"], descriptions["warning_message"])), + MarkdownDescription: fmt.Sprintf("%s\n\n!> %s", descriptions["main"], descriptions["warning_message"]), Description: fmt.Sprintf("%s\n\n%s", descriptions["main"], descriptions["warning_message"]), Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ diff --git a/stackit/internal/services/iaas/publicipranges/datasource.go b/stackit/internal/services/iaas/publicipranges/datasource.go index 528645e8..5e213ff1 100644 --- a/stackit/internal/services/iaas/publicipranges/datasource.go +++ b/stackit/internal/services/iaas/publicipranges/datasource.go @@ -9,7 +9,6 @@ import ( "github.com/stackitcloud/stackit-sdk-go/services/iaas" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" - "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/features" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate" "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" @@ -23,11 +22,6 @@ import ( "github.com/stackitcloud/stackit-sdk-go/core/oapierror" ) -// publicIpRangesDataSourceBetaCheckDone is used to prevent multiple checks for beta resources. -// This is a workaround for the lack of a global state in the provider and -// needs to exist because the Configure method is called twice. -var publicIpRangesDataSourceBetaCheckDone bool - // Ensure the implementation satisfies the expected interfaces. var ( _ datasource.DataSource = &publicIpRangesDataSource{} @@ -69,14 +63,6 @@ func (d *publicIpRangesDataSource) Configure(ctx context.Context, req datasource return } - if !publicIpRangesDataSourceBetaCheckDone { - features.CheckBetaResourcesEnabled(ctx, &providerData, &resp.Diagnostics, "stackit_public_ip_ranges", "data source") - if resp.Diagnostics.HasError() { - return - } - publicIpRangesDataSourceBetaCheckDone = true - } - var apiClient *iaas.APIClient var err error if providerData.IaaSCustomEndpoint != "" { @@ -104,7 +90,7 @@ func (d *publicIpRangesDataSource) Schema(_ context.Context, _ datasource.Schema description := "A list of all public IP ranges that STACKIT uses." resp.Schema = schema.Schema{ - MarkdownDescription: features.AddBetaDescription(description), + MarkdownDescription: description, Description: description, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ @@ -142,7 +128,7 @@ func (d *publicIpRangesDataSource) Read(ctx context.Context, req datasource.Read if resp.Diagnostics.HasError() { return } - publicIpRangeResp, err := d.client.ListPublicIpRangesExecute(ctx) + publicIpRangeResp, err := d.client.ListPublicIPRangesExecute(ctx) if err != nil { oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped if ok && oapiErr.StatusCode == http.StatusNotFound { diff --git a/stackit/internal/services/iaas/securitygroup/datasource.go b/stackit/internal/services/iaas/securitygroup/datasource.go index 625032a4..8ea4ad99 100644 --- a/stackit/internal/services/iaas/securitygroup/datasource.go +++ b/stackit/internal/services/iaas/securitygroup/datasource.go @@ -14,15 +14,9 @@ import ( "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/services/iaas" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" - "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/features" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate" ) -// securityGroupDataSourceBetaCheckDone is used to prevent multiple checks for beta resources. -// This is a workaround for the lack of a global state in the provider and -// needs to exist because the Configure method is called twice. -var securityGroupDataSourceBetaCheckDone bool - // Ensure the implementation satisfies the expected interfaces. var ( _ datasource.DataSource = &securityGroupDataSource{} @@ -58,14 +52,6 @@ func (d *securityGroupDataSource) Configure(ctx context.Context, req datasource. return } - if !securityGroupDataSourceBetaCheckDone { - features.CheckBetaResourcesEnabled(ctx, &providerData, &resp.Diagnostics, "stackit_security_group", "data source") - if resp.Diagnostics.HasError() { - return - } - securityGroupDataSourceBetaCheckDone = true - } - if providerData.IaaSCustomEndpoint != "" { apiClient, err = iaas.NewAPIClient( config.WithCustomAuth(providerData.RoundTripper), @@ -88,9 +74,10 @@ func (d *securityGroupDataSource) Configure(ctx context.Context, req datasource. // Schema defines the schema for the resource. func (r *securityGroupDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) { + description := "Security group datasource schema. Must have a `region` specified in the provider configuration." resp.Schema = schema.Schema{ - MarkdownDescription: features.AddBetaDescription("Security group datasource schema. Must have a `region` specified in the provider configuration."), - Description: "Security group datasource schema. Must have a `region` specified in the provider configuration.", + MarkdownDescription: description, + Description: description, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Description: "Terraform's internal resource ID. It is structured as \"`project_id`,`security_group_id`\".", diff --git a/stackit/internal/services/iaas/securitygroup/resource.go b/stackit/internal/services/iaas/securitygroup/resource.go index 2c144fd8..03246008 100644 --- a/stackit/internal/services/iaas/securitygroup/resource.go +++ b/stackit/internal/services/iaas/securitygroup/resource.go @@ -23,15 +23,9 @@ import ( "github.com/stackitcloud/stackit-sdk-go/services/iaas" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/conversion" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" - "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/features" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate" ) -// resourceBetaCheckDone is used to prevent multiple checks for beta resources. -// This is a workaround for the lack of a global state in the provider and -// needs to exist because the Configure method is called twice. -var resourceBetaCheckDone bool - // Ensure the implementation satisfies the expected interfaces. var ( _ resource.Resource = &securityGroupResource{} @@ -77,14 +71,6 @@ func (r *securityGroupResource) Configure(ctx context.Context, req resource.Conf return } - if !resourceBetaCheckDone { - features.CheckBetaResourcesEnabled(ctx, &providerData, &resp.Diagnostics, "stackit_security_group", "resource") - if resp.Diagnostics.HasError() { - return - } - resourceBetaCheckDone = true - } - var apiClient *iaas.APIClient var err error if providerData.IaaSCustomEndpoint != "" { @@ -111,9 +97,10 @@ func (r *securityGroupResource) Configure(ctx context.Context, req resource.Conf // Schema defines the schema for the resource. func (r *securityGroupResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { + description := "Security group resource schema. Must have a `region` specified in the provider configuration." resp.Schema = schema.Schema{ - MarkdownDescription: features.AddBetaDescription("Security group resource schema. Must have a `region` specified in the provider configuration."), - Description: "Security group resource schema. Must have a `region` specified in the provider configuration.", + MarkdownDescription: description, + Description: description, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Description: "Terraform's internal resource ID. It is structured as \"`project_id`,`security_group_id`\".", diff --git a/stackit/internal/services/iaas/securitygrouprule/datasource.go b/stackit/internal/services/iaas/securitygrouprule/datasource.go index eb107af7..7568e243 100644 --- a/stackit/internal/services/iaas/securitygrouprule/datasource.go +++ b/stackit/internal/services/iaas/securitygrouprule/datasource.go @@ -13,16 +13,10 @@ import ( "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/services/iaas" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" - "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/features" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate" ) -// securityGroupRuleDataSourceBetaCheckDone is used to prevent multiple checks for beta resources. -// This is a workaround for the lack of a global state in the provider and -// needs to exist because the Configure method is called twice. -var securityGroupRuleDataSourceBetaCheckDone bool - // Ensure the implementation satisfies the expected interfaces. var ( _ datasource.DataSource = &securityGroupRuleDataSource{} @@ -58,14 +52,6 @@ func (d *securityGroupRuleDataSource) Configure(ctx context.Context, req datasou return } - if !securityGroupRuleDataSourceBetaCheckDone { - features.CheckBetaResourcesEnabled(ctx, &providerData, &resp.Diagnostics, "stackit_security_group_rule", "data source") - if resp.Diagnostics.HasError() { - return - } - securityGroupRuleDataSourceBetaCheckDone = true - } - if providerData.IaaSCustomEndpoint != "" { apiClient, err = iaas.NewAPIClient( config.WithCustomAuth(providerData.RoundTripper), @@ -89,10 +75,11 @@ func (d *securityGroupRuleDataSource) Configure(ctx context.Context, req datasou // Schema defines the schema for the resource. func (r *securityGroupRuleDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) { directionOptions := []string{"ingress", "egress"} + description := "Security group datasource schema. Must have a `region` specified in the provider configuration." resp.Schema = schema.Schema{ - MarkdownDescription: features.AddBetaDescription("Security group datasource schema. Must have a `region` specified in the provider configuration."), - Description: "Security group datasource schema. Must have a `region` specified in the provider configuration.", + MarkdownDescription: description, + Description: description, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Description: "Terraform's internal datasource ID. It is structured as \"`project_id`,`security_group_id`,`security_group_rule_id`\".", diff --git a/stackit/internal/services/iaas/securitygrouprule/resource.go b/stackit/internal/services/iaas/securitygrouprule/resource.go index d31bc96c..0ccb6ffc 100644 --- a/stackit/internal/services/iaas/securitygrouprule/resource.go +++ b/stackit/internal/services/iaas/securitygrouprule/resource.go @@ -27,16 +27,10 @@ import ( "github.com/stackitcloud/stackit-sdk-go/services/iaas" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/conversion" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" - "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/features" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate" ) -// resourceBetaCheckDone is used to prevent multiple checks for beta resources. -// This is a workaround for the lack of a global state in the provider and -// needs to exist because the Configure method is called twice. -var resourceBetaCheckDone bool - // Ensure the implementation satisfies the expected interfaces. var ( _ resource.Resource = &securityGroupRuleResource{} @@ -121,14 +115,6 @@ func (r *securityGroupRuleResource) Configure(ctx context.Context, req resource. return } - if !resourceBetaCheckDone { - features.CheckBetaResourcesEnabled(ctx, &providerData, &resp.Diagnostics, "stackit_security_group_rule", "resource") - if resp.Diagnostics.HasError() { - return - } - resourceBetaCheckDone = true - } - var apiClient *iaas.APIClient var err error if providerData.IaaSCustomEndpoint != "" { @@ -202,10 +188,11 @@ func (r securityGroupRuleResource) ValidateConfig(ctx context.Context, req resou // Schema defines the schema for the resource. func (r *securityGroupRuleResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { directionOptions := []string{"ingress", "egress"} + description := "Security group rule resource schema. Must have a `region` specified in the provider configuration." resp.Schema = schema.Schema{ - MarkdownDescription: features.AddBetaDescription("Security group rule resource schema. Must have a `region` specified in the provider configuration."), - Description: "Security group rule resource schema. Must have a `region` specified in the provider configuration.", + MarkdownDescription: description, + Description: description, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Description: "Terraform's internal resource ID. It is structured as \"`project_id`,`security_group_id`,`security_group_rule_id`\".", diff --git a/stackit/internal/services/iaas/server/const.go b/stackit/internal/services/iaas/server/const.go index 0ed54368..e923f6bc 100644 --- a/stackit/internal/services/iaas/server/const.go +++ b/stackit/internal/services/iaas/server/const.go @@ -2,11 +2,9 @@ package server const markdownDescription = ` Server resource schema. Must have a region specified in the provider configuration.` + "\n" + ` -~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources. ## Example Usage` + "\n" + ` ### With key pair` + "\n" + - "```terraform" + ` resource "stackit_key_pair" "keypair" { name = "example-key-pair" @@ -28,7 +26,6 @@ resource "stackit_server" "user-data-from-file" { ` + "\n```" + ` ### Boot from volume` + "\n" + - "```terraform" + ` resource "stackit_server" "boot-from-volume" { project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" @@ -45,7 +42,6 @@ resource "stackit_server" "boot-from-volume" { ` + "\n```" + ` ### Boot from existing volume` + "\n" + - "```terraform" + ` resource "stackit_volume" "example-volume" { project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" @@ -72,7 +68,6 @@ resource "stackit_server" "boot-from-volume" { ` + "\n```" + ` ### Network setup` + "\n" + - "```terraform" + ` resource "stackit_server" "server-with-network" { project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" @@ -125,7 +120,6 @@ resource "stackit_server_network_interface_attach" "nic-attachment" { ` + "\n```" + ` ### Server with attached volume` + "\n" + - "```terraform" + ` resource "stackit_volume" "example-volume" { project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" @@ -156,7 +150,6 @@ resource "stackit_server_volume_attach" "attach_volume" { ` + "\n```" + ` ### Server with user data (cloud-init)` + "\n" + - "```terraform" + ` resource "stackit_server" "user-data" { project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" diff --git a/stackit/internal/services/iaas/server/datasource.go b/stackit/internal/services/iaas/server/datasource.go index f9aadaba..a8190a77 100644 --- a/stackit/internal/services/iaas/server/datasource.go +++ b/stackit/internal/services/iaas/server/datasource.go @@ -18,16 +18,10 @@ import ( "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/services/iaas" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" - "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/features" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate" ) -// serverDataSourceBetaCheckDone is used to prevent multiple checks for beta resources. -// This is a workaround for the lack of a global state in the provider and -// needs to exist because the Configure method is called twice. -var serverDataSourceBetaCheckDone bool - // Ensure the implementation satisfies the expected interfaces. var ( _ datasource.DataSource = &serverDataSource{} @@ -82,14 +76,6 @@ func (d *serverDataSource) Configure(ctx context.Context, req datasource.Configu return } - if !serverDataSourceBetaCheckDone { - features.CheckBetaResourcesEnabled(ctx, &providerData, &resp.Diagnostics, "stackit_server", "data source") - if resp.Diagnostics.HasError() { - return - } - serverDataSourceBetaCheckDone = true - } - if providerData.IaaSCustomEndpoint != "" { apiClient, err = iaas.NewAPIClient( config.WithCustomAuth(providerData.RoundTripper), @@ -112,9 +98,10 @@ func (d *serverDataSource) Configure(ctx context.Context, req datasource.Configu // Schema defines the schema for the datasource. func (r *serverDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) { + description := "Server datasource schema. Must have a `region` specified in the provider configuration." resp.Schema = schema.Schema{ - MarkdownDescription: features.AddBetaDescription("Server datasource schema. Must have a `region` specified in the provider configuration."), - Description: "Server datasource schema. Must have a `region` specified in the provider configuration.", + MarkdownDescription: description, + Description: description, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Description: "Terraform's internal resource ID. It is structured as \"`project_id`,`server_id`\".", diff --git a/stackit/internal/services/iaas/server/resource.go b/stackit/internal/services/iaas/server/resource.go index dcc4d8e0..d3d0c00d 100644 --- a/stackit/internal/services/iaas/server/resource.go +++ b/stackit/internal/services/iaas/server/resource.go @@ -33,16 +33,10 @@ import ( "github.com/stackitcloud/stackit-sdk-go/services/iaas/wait" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/conversion" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" - "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/features" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate" ) -// resourceBetaCheckDone is used to prevent multiple checks for beta resources. -// This is a workaround for the lack of a global state in the provider and -// needs to exist because the Configure method is called twice. -var resourceBetaCheckDone bool - // Ensure the implementation satisfies the expected interfaces. var ( _ resource.Resource = &serverResource{} @@ -162,14 +156,6 @@ func (r *serverResource) Configure(ctx context.Context, req resource.ConfigureRe return } - if !resourceBetaCheckDone { - features.CheckBetaResourcesEnabled(ctx, &providerData, &resp.Diagnostics, "stackit_server", "resource") - if resp.Diagnostics.HasError() { - return - } - resourceBetaCheckDone = true - } - var apiClient *iaas.APIClient var err error if providerData.IaaSCustomEndpoint != "" { @@ -982,9 +968,11 @@ func toCreatePayload(ctx context.Context, model *Model) (*iaas.CreateServerPaylo } } - var userData *string + var userData *[]byte if !model.UserData.IsNull() && !model.UserData.IsUnknown() { - encodedUserData := base64.StdEncoding.EncodeToString([]byte(model.UserData.ValueString())) + src := []byte(model.UserData.ValueString()) + encodedUserData := make([]byte, base64.StdEncoding.EncodedLen(len(src))) + base64.StdEncoding.Encode(encodedUserData, src) userData = &encodedUserData } diff --git a/stackit/internal/services/iaas/server/resource_test.go b/stackit/internal/services/iaas/server/resource_test.go index 67a896cb..49798c1d 100644 --- a/stackit/internal/services/iaas/server/resource_test.go +++ b/stackit/internal/services/iaas/server/resource_test.go @@ -216,7 +216,7 @@ func TestToCreatePayload(t *testing.T) { ImageId: utils.Ptr("image"), KeypairName: utils.Ptr("keypair"), MachineType: utils.Ptr("machine_type"), - UserData: utils.Ptr(base64EncodedUserData), + UserData: utils.Ptr([]byte(base64EncodedUserData)), }, true, }, @@ -258,7 +258,7 @@ func TestToCreatePayload(t *testing.T) { ImageId: utils.Ptr("image"), KeypairName: utils.Ptr("keypair"), MachineType: utils.Ptr("machine_type"), - UserData: utils.Ptr(base64EncodedUserData), + UserData: utils.Ptr([]byte(base64EncodedUserData)), }, true, }, diff --git a/stackit/internal/services/iaas/serviceaccountattach/resource.go b/stackit/internal/services/iaas/serviceaccountattach/resource.go index c0c6ec00..bb636390 100644 --- a/stackit/internal/services/iaas/serviceaccountattach/resource.go +++ b/stackit/internal/services/iaas/serviceaccountattach/resource.go @@ -18,15 +18,9 @@ import ( "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/services/iaas" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" - "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/features" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate" ) -// resourceBetaCheckDone is used to prevent multiple checks for beta resources. -// This is a workaround for the lack of a global state in the provider and -// needs to exist because the Configure method is called twice. -var resourceBetaCheckDone bool - // Ensure the implementation satisfies the expected interfaces. var ( _ resource.Resource = &networkInterfaceAttachResource{} @@ -69,14 +63,6 @@ func (r *networkInterfaceAttachResource) Configure(ctx context.Context, req reso return } - if !resourceBetaCheckDone { - features.CheckBetaResourcesEnabled(ctx, &providerData, &resp.Diagnostics, "stackit_server_service_account_attach", "resource") - if resp.Diagnostics.HasError() { - return - } - resourceBetaCheckDone = true - } - var apiClient *iaas.APIClient var err error if providerData.IaaSCustomEndpoint != "" { @@ -103,9 +89,10 @@ func (r *networkInterfaceAttachResource) Configure(ctx context.Context, req reso // Schema defines the schema for the resource. func (r *networkInterfaceAttachResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { + description := "Service account attachment resource schema. Attaches a service account to a server. Must have a `region` specified in the provider configuration." resp.Schema = schema.Schema{ - MarkdownDescription: features.AddBetaDescription("Service account attachment resource schema. Attaches a service account to a server. Must have a `region` specified in the provider configuration."), - Description: "Service account attachment resource schema. Attaches a service account to a server. Must have a `region` specified in the provider configuration.", + MarkdownDescription: description, + Description: description, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Description: "Terraform's internal resource ID. It is structured as \"`project_id`,`server_id`,`service_account_email`\".", diff --git a/stackit/internal/services/iaas/volume/datasource.go b/stackit/internal/services/iaas/volume/datasource.go index 7d4dcef6..db3a0e1b 100644 --- a/stackit/internal/services/iaas/volume/datasource.go +++ b/stackit/internal/services/iaas/volume/datasource.go @@ -14,16 +14,10 @@ import ( "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/services/iaas" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" - "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/features" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate" ) -// volumeDataSourceBetaCheckDone is used to prevent multiple checks for beta resources. -// This is a workaround for the lack of a global state in the provider and -// needs to exist because the Configure method is called twice. -var volumeDataSourceBetaCheckDone bool - // Ensure the implementation satisfies the expected interfaces. var ( _ datasource.DataSource = &volumeDataSource{} @@ -59,14 +53,6 @@ func (d *volumeDataSource) Configure(ctx context.Context, req datasource.Configu return } - if !volumeDataSourceBetaCheckDone { - features.CheckBetaResourcesEnabled(ctx, &providerData, &resp.Diagnostics, "stackit_volume", "data source") - if resp.Diagnostics.HasError() { - return - } - volumeDataSourceBetaCheckDone = true - } - if providerData.IaaSCustomEndpoint != "" { apiClient, err = iaas.NewAPIClient( config.WithCustomAuth(providerData.RoundTripper), @@ -89,9 +75,10 @@ func (d *volumeDataSource) Configure(ctx context.Context, req datasource.Configu // Schema defines the schema for the resource. func (r *volumeDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) { + description := "Volume resource schema. Must have a `region` specified in the provider configuration." resp.Schema = schema.Schema{ - MarkdownDescription: features.AddBetaDescription("Volume resource schema. Must have a `region` specified in the provider configuration."), - Description: "Volume resource schema. Must have a `region` specified in the provider configuration.", + MarkdownDescription: description, + Description: description, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Description: "Terraform's internal resource ID. It is structured as \"`project_id`,`volume_id`\".", diff --git a/stackit/internal/services/iaas/volume/resource.go b/stackit/internal/services/iaas/volume/resource.go index fe14a253..f666f9c6 100644 --- a/stackit/internal/services/iaas/volume/resource.go +++ b/stackit/internal/services/iaas/volume/resource.go @@ -27,16 +27,10 @@ import ( "github.com/stackitcloud/stackit-sdk-go/services/iaas/wait" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/conversion" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" - "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/features" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate" ) -// resourceBetaCheckDone is used to prevent multiple checks for beta resources. -// This is a workaround for the lack of a global state in the provider and -// needs to exist because the Configure method is called twice. -var resourceBetaCheckDone bool - // Ensure the implementation satisfies the expected interfaces. var ( _ resource.Resource = &volumeResource{} @@ -110,14 +104,6 @@ func (r *volumeResource) Configure(ctx context.Context, req resource.ConfigureRe return } - if !resourceBetaCheckDone { - features.CheckBetaResourcesEnabled(ctx, &providerData, &resp.Diagnostics, "stackit_volume", "resource") - if resp.Diagnostics.HasError() { - return - } - resourceBetaCheckDone = true - } - var apiClient *iaas.APIClient var err error if providerData.IaaSCustomEndpoint != "" { @@ -144,9 +130,10 @@ func (r *volumeResource) Configure(ctx context.Context, req resource.ConfigureRe // Schema defines the schema for the resource. func (r *volumeResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { + description := "Volume resource schema. Must have a `region` specified in the provider configuration." resp.Schema = schema.Schema{ - MarkdownDescription: features.AddBetaDescription("Volume resource schema. Must have a `region` specified in the provider configuration."), - Description: "Volume resource schema. Must have a `region` specified in the provider configuration.", + MarkdownDescription: description, + Description: description, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Description: "Terraform's internal resource ID. It is structured as \"`project_id`,`volume_id`\".", diff --git a/stackit/internal/services/iaas/volumeattach/resource.go b/stackit/internal/services/iaas/volumeattach/resource.go index bb16be47..2c1c958a 100644 --- a/stackit/internal/services/iaas/volumeattach/resource.go +++ b/stackit/internal/services/iaas/volumeattach/resource.go @@ -20,15 +20,9 @@ import ( "github.com/stackitcloud/stackit-sdk-go/services/iaas" "github.com/stackitcloud/stackit-sdk-go/services/iaas/wait" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core" - "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/features" "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate" ) -// resourceBetaCheckDone is used to prevent multiple checks for beta resources. -// This is a workaround for the lack of a global state in the provider and -// needs to exist because the Configure method is called twice. -var resourceBetaCheckDone bool - // Ensure the implementation satisfies the expected interfaces. var ( _ resource.Resource = &volumeAttachResource{} @@ -71,14 +65,6 @@ func (r *volumeAttachResource) Configure(ctx context.Context, req resource.Confi return } - if !resourceBetaCheckDone { - features.CheckBetaResourcesEnabled(ctx, &providerData, &resp.Diagnostics, "stackit_server_volume_attach", "resource") - if resp.Diagnostics.HasError() { - return - } - resourceBetaCheckDone = true - } - var apiClient *iaas.APIClient var err error if providerData.IaaSCustomEndpoint != "" { @@ -105,9 +91,10 @@ func (r *volumeAttachResource) Configure(ctx context.Context, req resource.Confi // Schema defines the schema for the resource. func (r *volumeAttachResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { + description := "Volume attachment resource schema. Attaches a volume to a server. Must have a `region` specified in the provider configuration." resp.Schema = schema.Schema{ - MarkdownDescription: features.AddBetaDescription("Volume attachment resource schema. Attaches a volume to a server. Must have a `region` specified in the provider configuration."), - Description: "Volume attachment resource schema. Attaches a volume to a server. Must have a `region` specified in the provider configuration.", + MarkdownDescription: description, + Description: description, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Description: "Terraform's internal resource ID. It is structured as \"`project_id`,`server_id`,`volume_id`\".", diff --git a/stackit/internal/testutil/testutil.go b/stackit/internal/testutil/testutil.go index 1eb55f12..133aa5be 100644 --- a/stackit/internal/testutil/testutil.go +++ b/stackit/internal/testutil/testutil.go @@ -122,7 +122,6 @@ func IaaSProviderConfig() string { return ` provider "stackit" { region = "eu01" - enable_beta_resources = true }` } return fmt.Sprintf(`