Add documentation to support beta resources (#417)

* add README, guide and description method

* undo unwanted changes to docs

* Update docs/guides/opting_into_beta_resources.md

Co-authored-by: GokceGK <161626272+GokceGK@users.noreply.github.com>

* address PR comments

* address PR comments

---------

Co-authored-by: GokceGK <161626272+GokceGK@users.noreply.github.com>
This commit is contained in:
Diogo Ferrão 2024-06-24 15:07:31 +01:00 committed by GitHub
parent 3a93e6e54c
commit 610b65f1cc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 119 additions and 0 deletions

View file

@ -145,6 +145,33 @@ terraform {
Note: AWS specific checks must be skipped as they do not work on STACKIT. For details on what those validations do, see [here](https://developer.hashicorp.com/terraform/language/settings/backends/s3#configuration).
## Opting into Beta Resources
To use beta resources in the STACKIT Terraform provider, follow these steps:
1. **Provider Configuration Option**
Set the `enable_beta_resources` option in the provider configuration. This is a boolean attribute that can be either `true` or `false`.
```hcl
provider "stackit" {
region = "eu01"
enable_beta_resources = true
}
```
2. **Environment Variable**
Set the `STACKIT_TF_ENABLE_BETA_RESOURCES` environment variable to `"true"` or `"false"`. Other values will be ignored and will produce a warning.
```sh
export STACKIT_TF_ENABLE_BETA_RESOURCES=true
```
> **Note**: The environment variable takes precedence over the provider configuration option. This means that if the `STACKIT_TF_ENABLE_BETA_RESOURCES` environment variable is set to a valid value (`"true"` or `"false"`), it will override the `enable_beta_resources` option specified in the provider configuration.
For more details, please refer to the [beta resources configuration guide](TODO-LINK).
## Acceptance Tests
Terraform acceptance tests are run using the command `make test-acceptance-tf`. For all services,

View file

@ -0,0 +1,43 @@
---
page_title: "Configuring Beta Resources in the STACKIT Terraform Provider"
---
# Configuring Beta Resources in the STACKIT Terraform Provider
### Overview
This guide explains how to opt into beta resources within the STACKIT Terraform provider. Beta resources are new services and features from STACKIT that are still in development and might not yet have a stable API.
Opting into beta functionality allows users to experiment with new features and services before their official release, without compromising the stability of other resources and the provider itself. However, it's important to remember that beta resources may not be as stable as fully released counterparts, so use them with caution and provide feedback to help improve these services.
### The Process of Opting into the Beta
To use beta resources in the STACKIT Terraform provider, you have two options:
#### Option 1: Provider Configuration
Set the `enable_beta_resources` option in the provider configuration. This is a boolean attribute that can be either `true` or `false`.
```hcl
provider "stackit" {
region = "eu01"
enable_beta_resources = true
}
```
#### Option 2: Environment Variable
Set the `STACKIT_TF_ENABLE_BETA_RESOURCES` environment variable to `"true"` or `"false"`. Other values will be ignored and will produce a warning.
```sh
export STACKIT_TF_ENABLE_BETA_RESOURCES=true
```
> **Note**: **The environment variable takes precedence over the provider configuration option.**
>
> This means that if the `STACKIT_TF_ENABLE_BETA_RESOURCES` environment variable is set to a valid value (`"true"` or `"false"`), it will override the `enable_beta_resources` option specified in the provider configuration.
### Listing Beta Resources
Currently, there are no beta resources available. This section will be updated as new beta services are introduced.
> **Tip**: Check back regularly or refer to the [STACKIT provider documentation](#) for the latest updates on beta resources.

View file

@ -143,6 +143,7 @@ Note: AWS specific checks must be skipped as they do not work on STACKIT. For de
- `argus_custom_endpoint` (String) Custom endpoint for the Argus service
- `credentials_path` (String) Path of JSON from where the credentials are read. Takes precedence over the env var `STACKIT_CREDENTIALS_PATH`. Default value is `~/.stackit/credentials.json`.
- `dns_custom_endpoint` (String) Custom endpoint for the DNS service
- `enable_beta_resources` (Boolean) Enable beta resources. Default is false.
- `iaas_custom_endpoint` (String) Custom endpoint for the IaaS service
- `jwks_custom_endpoint` (String, Deprecated) Custom endpoint for the jwks API, which is used to get the json web key sets (jwks) to validate tokens when using the key flow
- `loadbalancer_custom_endpoint` (String) Custom endpoint for the Load Balancer service

View file

@ -46,3 +46,8 @@ func CheckBetaResourcesEnabled(ctx context.Context, data *core.ProviderData, dia
}
core.LogAndAddWarningBeta(ctx, diags, resourceName)
}
func AddBetaDescription(description string) string {
// Callout block: https://developer.hashicorp.com/terraform/registry/providers/docs#callouts
return fmt.Sprintf("%s\n\n!> This resource is in beta and may be subject to breaking changes in the future. Use with caution.", description)
}

View file

@ -0,0 +1,43 @@
---
page_title: "Configuring Beta Resources in the STACKIT Terraform Provider"
---
# Configuring Beta Resources in the STACKIT Terraform Provider
### Overview
This guide explains how to opt into beta resources within the STACKIT Terraform provider. Beta resources are new services and features from STACKIT that are still in development and might not yet have a stable API.
Opting into beta functionality allows users to experiment with new features and services before their official release, without compromising the stability of other resources and the provider itself. However, it's important to remember that beta resources may not be as stable as fully released counterparts, so use them with caution and provide feedback to help improve these services.
### The Process of Opting into the Beta
To use beta resources in the STACKIT Terraform provider, you have two options:
#### Option 1: Provider Configuration
Set the `enable_beta_resources` option in the provider configuration. This is a boolean attribute that can be either `true` or `false`.
```hcl
provider "stackit" {
region = "eu01"
enable_beta_resources = true
}
```
#### Option 2: Environment Variable
Set the `STACKIT_TF_ENABLE_BETA_RESOURCES` environment variable to `"true"` or `"false"`. Other values will be ignored and will produce a warning.
```sh
export STACKIT_TF_ENABLE_BETA_RESOURCES=true
```
> **Note**: **The environment variable takes precedence over the provider configuration option.**
>
> This means that if the `STACKIT_TF_ENABLE_BETA_RESOURCES` environment variable is set to a valid value (`"true"` or `"false"`), it will override the `enable_beta_resources` option specified in the provider configuration.
### Listing Beta Resources
Currently, there are no beta resources available. This section will be updated as new beta services are introduced.
> **Tip**: Check back regularly or refer to the [STACKIT provider documentation](#) for the latest updates on beta resources.