Skip to content

Commit c30f6a0

Browse files
committed
review changes 5 (improve note docs)
Signed-off-by: Mauritz Uphoff <mauritz.uphoff@stackit.cloud>
1 parent fcb84a8 commit c30f6a0

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

docs/ephemeral-resources/access_token.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@
33
page_title: "stackit_access_token Ephemeral Resource - stackit"
44
subcategory: ""
55
description: |-
6-
Ephemeral resource that generates a short-lived STACKIT access token (JWT) using a service account key. A new token is generated each time the resource is evaluated, and it remains consistent for the duration of a Terraform operation. If a private key is not explicitly provided, the provider attempts to extract it from the service account key instead. Token generation logic prioritizes environment variables first, followed by provider configuration. Access tokens generated from service account keys expire after 60 minutes.
6+
Ephemeral resource that generates a short-lived STACKIT access token (JWT) using a service account key. A new token is generated each time the resource is evaluated, and it remains consistent for the duration of a Terraform operation. If a private key is not explicitly provided, the provider attempts to extract it from the service account key instead. Access tokens generated from service account keys expire after 60 minutes.
7+
~> Service account key credentials must be configured either in the STACKIT provider configuration or via environment variables (see example below). If any other authentication method is configured, this ephemeral resource generation will fail with an error.
78
~> This ephemeral-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.
89
---
910

1011
# stackit_access_token (Ephemeral Resource)
1112

12-
Ephemeral resource that generates a short-lived STACKIT access token (JWT) using a service account key. A new token is generated each time the resource is evaluated, and it remains consistent for the duration of a Terraform operation. If a private key is not explicitly provided, the provider attempts to extract it from the service account key instead. Token generation logic prioritizes environment variables first, followed by provider configuration. Access tokens generated from service account keys expire after 60 minutes.
13+
Ephemeral resource that generates a short-lived STACKIT access token (JWT) using a service account key. A new token is generated each time the resource is evaluated, and it remains consistent for the duration of a Terraform operation. If a private key is not explicitly provided, the provider attempts to extract it from the service account key instead. Access tokens generated from service account keys expire after 60 minutes.
14+
15+
~> Service account key credentials must be configured either in the STACKIT provider configuration or via environment variables (see example below). If any other authentication method is configured, this ephemeral resource generation will fail with an error.
1316

1417
~> This ephemeral-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.
1518

stackit/internal/services/access_token/ephemeral_resource.go

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func (e *accessTokenEphemeralResource) Configure(ctx context.Context, req epheme
3636

3737
features.CheckBetaResourcesEnabled(
3838
ctx,
39-
&core.ProviderData{EnableBetaResources: ephemeralProviderData.EnableBetaResources},
39+
&ephemeralProviderData.ProviderData,
4040
&resp.Diagnostics,
4141
"stackit_access_token", "ephemeral_resource",
4242
)
@@ -62,12 +62,21 @@ func (e *accessTokenEphemeralResource) Metadata(_ context.Context, req ephemeral
6262
}
6363

6464
func (e *accessTokenEphemeralResource) Schema(_ context.Context, _ ephemeral.SchemaRequest, resp *ephemeral.SchemaResponse) {
65+
description := features.AddBetaDescription(
66+
fmt.Sprintf(
67+
"%s\n\n%s",
68+
"Ephemeral resource that generates a short-lived STACKIT access token (JWT) using a service account key. "+
69+
"A new token is generated each time the resource is evaluated, and it remains consistent for the duration of a Terraform operation. "+
70+
"If a private key is not explicitly provided, the provider attempts to extract it from the service account key instead. "+
71+
"Access tokens generated from service account keys expire after 60 minutes.",
72+
"~> Service account key credentials must be configured either in the STACKIT provider configuration or via environment variables (see example below). "+
73+
"If any other authentication method is configured, this ephemeral resource generation will fail with an error.",
74+
),
75+
core.EphemeralResource,
76+
)
77+
6578
resp.Schema = schema.Schema{
66-
Description: features.AddBetaDescription("Ephemeral resource that generates a short-lived STACKIT access token (JWT) using a service account key. "+
67-
"A new token is generated each time the resource is evaluated, and it remains consistent for the duration of a Terraform operation. "+
68-
"If a private key is not explicitly provided, the provider attempts to extract it from the service account key instead. "+
69-
"Token generation logic prioritizes environment variables first, followed by provider configuration. "+
70-
"Access tokens generated from service account keys expire after 60 minutes.", core.EphemeralResource),
79+
Description: description,
7180
Attributes: map[string]schema.Attribute{
7281
"access_token": schema.StringAttribute{
7382
Description: "JWT access token for STACKIT API authentication.",

0 commit comments

Comments
 (0)