Skip to content

Commit 610b65f

Browse files
DiogoFerraoGokceGK
andauthored
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>
1 parent 3a93e6e commit 610b65f

File tree

5 files changed

+119
-0
lines changed

5 files changed

+119
-0
lines changed

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,33 @@ terraform {
145145

146146
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).
147147

148+
## Opting into Beta Resources
149+
150+
To use beta resources in the STACKIT Terraform provider, follow these steps:
151+
152+
1. **Provider Configuration Option**
153+
154+
Set the `enable_beta_resources` option in the provider configuration. This is a boolean attribute that can be either `true` or `false`.
155+
156+
```hcl
157+
provider "stackit" {
158+
region = "eu01"
159+
enable_beta_resources = true
160+
}
161+
```
162+
163+
2. **Environment Variable**
164+
165+
Set the `STACKIT_TF_ENABLE_BETA_RESOURCES` environment variable to `"true"` or `"false"`. Other values will be ignored and will produce a warning.
166+
167+
```sh
168+
export STACKIT_TF_ENABLE_BETA_RESOURCES=true
169+
```
170+
171+
> **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.
172+
173+
For more details, please refer to the [beta resources configuration guide](TODO-LINK).
174+
148175
## Acceptance Tests
149176

150177
Terraform acceptance tests are run using the command `make test-acceptance-tf`. For all services,
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
page_title: "Configuring Beta Resources in the STACKIT Terraform Provider"
3+
---
4+
# Configuring Beta Resources in the STACKIT Terraform Provider
5+
6+
### Overview
7+
8+
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.
9+
10+
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.
11+
12+
### The Process of Opting into the Beta
13+
14+
To use beta resources in the STACKIT Terraform provider, you have two options:
15+
16+
#### Option 1: Provider Configuration
17+
18+
Set the `enable_beta_resources` option in the provider configuration. This is a boolean attribute that can be either `true` or `false`.
19+
20+
```hcl
21+
provider "stackit" {
22+
region = "eu01"
23+
enable_beta_resources = true
24+
}
25+
```
26+
27+
#### Option 2: Environment Variable
28+
29+
Set the `STACKIT_TF_ENABLE_BETA_RESOURCES` environment variable to `"true"` or `"false"`. Other values will be ignored and will produce a warning.
30+
31+
```sh
32+
export STACKIT_TF_ENABLE_BETA_RESOURCES=true
33+
```
34+
35+
> **Note**: **The environment variable takes precedence over the provider configuration option.**
36+
>
37+
> 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.
38+
39+
### Listing Beta Resources
40+
41+
Currently, there are no beta resources available. This section will be updated as new beta services are introduced.
42+
43+
> **Tip**: Check back regularly or refer to the [STACKIT provider documentation](#) for the latest updates on beta resources.

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ Note: AWS specific checks must be skipped as they do not work on STACKIT. For de
143143
- `argus_custom_endpoint` (String) Custom endpoint for the Argus service
144144
- `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`.
145145
- `dns_custom_endpoint` (String) Custom endpoint for the DNS service
146+
- `enable_beta_resources` (Boolean) Enable beta resources. Default is false.
146147
- `iaas_custom_endpoint` (String) Custom endpoint for the IaaS service
147148
- `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
148149
- `loadbalancer_custom_endpoint` (String) Custom endpoint for the Load Balancer service

stackit/internal/features/beta.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,8 @@ func CheckBetaResourcesEnabled(ctx context.Context, data *core.ProviderData, dia
4646
}
4747
core.LogAndAddWarningBeta(ctx, diags, resourceName)
4848
}
49+
50+
func AddBetaDescription(description string) string {
51+
// Callout block: https://developer.hashicorp.com/terraform/registry/providers/docs#callouts
52+
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)
53+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
page_title: "Configuring Beta Resources in the STACKIT Terraform Provider"
3+
---
4+
# Configuring Beta Resources in the STACKIT Terraform Provider
5+
6+
### Overview
7+
8+
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.
9+
10+
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.
11+
12+
### The Process of Opting into the Beta
13+
14+
To use beta resources in the STACKIT Terraform provider, you have two options:
15+
16+
#### Option 1: Provider Configuration
17+
18+
Set the `enable_beta_resources` option in the provider configuration. This is a boolean attribute that can be either `true` or `false`.
19+
20+
```hcl
21+
provider "stackit" {
22+
region = "eu01"
23+
enable_beta_resources = true
24+
}
25+
```
26+
27+
#### Option 2: Environment Variable
28+
29+
Set the `STACKIT_TF_ENABLE_BETA_RESOURCES` environment variable to `"true"` or `"false"`. Other values will be ignored and will produce a warning.
30+
31+
```sh
32+
export STACKIT_TF_ENABLE_BETA_RESOURCES=true
33+
```
34+
35+
> **Note**: **The environment variable takes precedence over the provider configuration option.**
36+
>
37+
> 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.
38+
39+
### Listing Beta Resources
40+
41+
Currently, there are no beta resources available. This section will be updated as new beta services are introduced.
42+
43+
> **Tip**: Check back regularly or refer to the [STACKIT provider documentation](#) for the latest updates on beta resources.

0 commit comments

Comments
 (0)