Add deprecation message for postgresql resources and data sources (#247)

* Update dependency

* Add deprecation messages

* Modify markdown description

* Add year

* Typo fix

---------

Co-authored-by: Henrique Santos <henrique.santos@freiheit.com>
This commit is contained in:
Henrique Santos 2024-02-06 15:05:19 +00:00 committed by GitHub
parent b171e8a745
commit a29c954c84
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 122 additions and 9 deletions

View file

@ -34,7 +34,7 @@ data "stackit_argus_scrapeconfig" "example" {
- `basic_auth` (Attributes) A basic authentication block. (see [below for nested schema](#nestedatt--basic_auth))
- `id` (String) Terraform's internal data source. ID. It is structured as "`project_id`,`instance_id`,`name`".
- `metrics_path` (String) Specifies the job scraping url path.
- `saml2` (Attributes) A SAML2 configuration block (see [below for nested schema](#nestedatt--saml2))
- `saml2` (Attributes) A SAML2 configuration block. (see [below for nested schema](#nestedatt--saml2))
- `sample_limit` (Number) Specifies the scrape sample limit.
- `scheme` (String) Specifies the http scheme.
- `scrape_interval` (String) Specifies the scrape interval as duration string.
@ -55,7 +55,7 @@ Read-Only:
Read-Only:
- `enable_url_parameters` (Boolean) Are URL parameters be enabled?
- `enable_url_parameters` (Boolean) Specifies if URL parameters are enabled
<a id="nestedatt--targets"></a>

View file

@ -69,6 +69,10 @@ Read-Only:
<a id="nestedatt--target_pools"></a>
### Nested Schema for `target_pools`
Optional:
- `session_persistence` (Attributes) Here you can setup various session persistence options, so far only "`use_source_ip_address`" is supported. (see [below for nested schema](#nestedatt--target_pools--session_persistence))
Read-Only:
- `active_health_check` (Attributes) (see [below for nested schema](#nestedatt--target_pools--active_health_check))
@ -76,6 +80,14 @@ Read-Only:
- `target_port` (Number) Identical port number where each target listens for traffic.
- `targets` (Attributes List) List of all targets which will be used in the pool. Limited to 250. (see [below for nested schema](#nestedatt--target_pools--targets))
<a id="nestedatt--target_pools--session_persistence"></a>
### Nested Schema for `target_pools.session_persistence`
Optional:
- `use_source_ip_address` (Boolean) If true then all connections from one source IP address are redirected to the same target. This setting changes the load balancing algorithm to Maglev.
<a id="nestedatt--target_pools--active_health_check"></a>
### Nested Schema for `target_pools.active_health_check`

View file

@ -4,12 +4,15 @@ page_title: "stackit_postgresql_credential Data Source - stackit"
subcategory: ""
description: |-
PostgreSQL credential data source schema. Must have a region specified in the provider configuration.
!> The STACKIT PostgreSQL service will reach its end of support on June 30th 2024. Data sources of this type will stop working after that. Use stackitpostgresflexuser instead. For more details, check https://docs.stackit.cloud/stackit/en/bring-your-data-to-stackit-postgresql-flex-138347648.html
---
# stackit_postgresql_credential (Data Source)
PostgreSQL credential data source schema. Must have a `region` specified in the provider configuration.
!> The STACKIT PostgreSQL service will reach its end of support on June 30th 2024. Data sources of this type will stop working after that. Use stackit_postgresflex_user instead. For more details, check https://docs.stackit.cloud/stackit/en/bring-your-data-to-stackit-postgresql-flex-138347648.html
## Example Usage
```terraform

View file

@ -4,12 +4,15 @@ page_title: "stackit_postgresql_instance Data Source - stackit"
subcategory: ""
description: |-
PostgreSQL instance data source schema. Must have a region specified in the provider configuration.
!> The STACKIT PostgreSQL service will reach its end of support on June 30th 2024. Data sources of this type will stop working after that. Use stackitpostgresflexinstance instead. For more details, check https://docs.stackit.cloud/stackit/en/bring-your-data-to-stackit-postgresql-flex-138347648.html
---
# stackit_postgresql_instance (Data Source)
PostgreSQL instance data source schema. Must have a `region` specified in the provider configuration.
!> The STACKIT PostgreSQL service will reach its end of support on June 30th 2024. Data sources of this type will stop working after that. Use stackit_postgresflex_instance instead. For more details, check https://docs.stackit.cloud/stackit/en/bring-your-data-to-stackit-postgresql-flex-138347648.html
## Example Usage
```terraform

View file

@ -107,6 +107,34 @@ Using this flow is less secure since the token is long-lived. You can provide th
2. Setting the environment variable `STACKIT_SERVICE_ACCOUNT_TOKEN`
3. Setting it in the credentials file (see above)
# Backend configuration
To keep track of your terraform state, you can configure an [S3 backend](https://developer.hashicorp.com/terraform/language/settings/backends/s3) using [STACKIT Object Storage](https://docs.stackit.cloud/stackit/en/object-storage-s3-compatible-71009778.html).
To do so, you need an Object Storage [S3 bucket](https://docs.stackit.cloud/stackit/en/basic-concept-objectstorage-71009785.html#BasicConceptObjectStorage-Buckets) and [credentials](https://docs.stackit.cloud/stackit/en/basic-concept-objectstorage-71009785.html#BasicConceptObjectStorage-Credentials) to access it. If you need to create them, check [Getting Started - Object Storage](https://docs.stackit.cloud/stackit/en/getting-started-objectstorage-71009792.html).
Once you have everything setup, you can configure the backend by adding the following block to your terraform configuration:
```
terraform {
backend "s3" {
bucket = "BUCKET_NAME"
key = "path/to/key"
endpoints = {
s3 = "https://object.storage.eu01.onstackit.cloud"
}
region = "eu01"
skip_credentials_validation = true
skip_region_validation = true
skip_s3_checksum = true
skip_requesting_account_id = true
secret_key = "SECRET_KEY"
access_key = "ACCESS_KEY"
}
}
```
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).
<!-- schema generated by tfplugindocs -->
## Schema

View file

@ -82,4 +82,4 @@ Required:
Optional:
- `enable_url_parameters` (Boolean) Are URL parameters be enabled?
- `enable_url_parameters` (Boolean) Specifies if URL parameters are enabled.

View file

@ -59,7 +59,7 @@ provider "openstack" {
}
```
### Configuring the supporting infrastructure
The example below uses OpenStack to create the network, router, a public IP address and a compute instance.
@ -229,6 +229,7 @@ Required:
Optional:
- `active_health_check` (Attributes) (see [below for nested schema](#nestedatt--target_pools--active_health_check))
- `session_persistence` (Attributes) Here you can setup various session persistence options, so far only "`use_source_ip_address`" is supported. (see [below for nested schema](#nestedatt--target_pools--session_persistence))
<a id="nestedatt--target_pools--targets"></a>
### Nested Schema for `target_pools.targets`
@ -251,6 +252,14 @@ Optional:
- `unhealthy_threshold` (Number) Unhealthy threshold of the health checking.
<a id="nestedatt--target_pools--session_persistence"></a>
### Nested Schema for `target_pools.session_persistence`
Optional:
- `use_source_ip_address` (Boolean) If true then all connections from one source IP address are redirected to the same target. This setting changes the load balancing algorithm to Maglev.
<a id="nestedatt--options"></a>
### Nested Schema for `options`

View file

@ -4,12 +4,15 @@ page_title: "stackit_postgresql_credential Resource - stackit"
subcategory: ""
description: |-
PostgreSQL credential resource schema. Must have a region specified in the provider configuration.
!> The STACKIT PostgreSQL service will reach its end of support on June 30th 2024. Resources of this type will stop working after that. Use stackitpostgresflexuser instead. For more details, check https://docs.stackit.cloud/stackit/en/bring-your-data-to-stackit-postgresql-flex-138347648.html
---
# stackit_postgresql_credential (Resource)
PostgreSQL credential resource schema. Must have a `region` specified in the provider configuration.
!> The STACKIT PostgreSQL service will reach its end of support on June 30th 2024. Resources of this type will stop working after that. Use stackit_postgresflex_user instead. For more details, check https://docs.stackit.cloud/stackit/en/bring-your-data-to-stackit-postgresql-flex-138347648.html
## Example Usage
```terraform

View file

@ -4,12 +4,15 @@ page_title: "stackit_postgresql_instance Resource - stackit"
subcategory: ""
description: |-
PostgreSQL instance resource schema. Must have a region specified in the provider configuration.
!> The STACKIT PostgreSQL service will reach its end of support on June 30th 2024. Resources of this type will stop working after that. Use stackitpostgresflexinstance instead. Check https://docs.stackit.cloud/stackit/en/bring-your-data-to-stackit-postgresql-flex-138347648.html on how to backup and restore an instance from PostgreSQL to PostgreSQL Flex, then import the resource to Terraform using an "import" block (https://developer.hashicorp.com/terraform/language/import)
---
# stackit_postgresql_instance (Resource)
PostgreSQL instance resource schema. Must have a `region` specified in the provider configuration.
!> The STACKIT PostgreSQL service will reach its end of support on June 30th 2024. Resources of this type will stop working after that. Use stackit_postgresflex_instance instead. Check https://docs.stackit.cloud/stackit/en/bring-your-data-to-stackit-postgresql-flex-138347648.html on how to backup and restore an instance from PostgreSQL to PostgreSQL Flex, then import the resource to Terraform using an "import" block (https://developer.hashicorp.com/terraform/language/import)
## Example Usage
```terraform

2
go.mod
View file

@ -21,7 +21,7 @@ require (
github.com/stackitcloud/stackit-sdk-go/services/objectstorage v0.8.5
github.com/stackitcloud/stackit-sdk-go/services/opensearch v0.10.0
github.com/stackitcloud/stackit-sdk-go/services/postgresflex v0.9.0
github.com/stackitcloud/stackit-sdk-go/services/postgresql v0.11.0
github.com/stackitcloud/stackit-sdk-go/services/postgresql v0.12.0
github.com/stackitcloud/stackit-sdk-go/services/rabbitmq v0.10.0
github.com/stackitcloud/stackit-sdk-go/services/redis v0.10.0
github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.7.6

2
go.sum
View file

@ -174,6 +174,8 @@ github.com/stackitcloud/stackit-sdk-go/services/postgresflex v0.9.0 h1:b4RFEDSMa
github.com/stackitcloud/stackit-sdk-go/services/postgresflex v0.9.0/go.mod h1:bVXMSjQH1eGUF5IoPAD8BjAzhRMunDlnrwLsaCPgRQ4=
github.com/stackitcloud/stackit-sdk-go/services/postgresql v0.11.0 h1:c9VUZ/hqeNWCbuuzUTwAjijGwd1q7oF2ACdLdo4hZ0A=
github.com/stackitcloud/stackit-sdk-go/services/postgresql v0.11.0/go.mod h1:jAWmjZv4/e97B5DHgqfq2toRuClIl93h4T5+opyUqtM=
github.com/stackitcloud/stackit-sdk-go/services/postgresql v0.12.0 h1:Ud9IT71e8oJcs7hSiJF2k8wysz3+zzTyYQJwMuM8J6Q=
github.com/stackitcloud/stackit-sdk-go/services/postgresql v0.12.0/go.mod h1:8tWbOEdgd8GanzMj3Z/cdMW6uhvNrBEJ8ZLtRYNsY4Y=
github.com/stackitcloud/stackit-sdk-go/services/rabbitmq v0.10.0 h1:Fle394socpyf662g3jMrtZpZaWVgBMBIEFnh4fnGock=
github.com/stackitcloud/stackit-sdk-go/services/rabbitmq v0.10.0/go.mod h1:JvqOSrTCiynS0x6Y9OsK54yvdB6AtIWLwXDEjoCkAIg=
github.com/stackitcloud/stackit-sdk-go/services/redis v0.10.0 h1:4u+OiVDAI6Hpej81e+YrbzN5FT4l7ZrTw+eSRcQnCYg=

View file

@ -3,6 +3,7 @@ package postgresql
import (
"context"
"fmt"
"strings"
"github.com/hashicorp/terraform-plugin-framework/datasource"
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
@ -75,7 +76,16 @@ func (r *credentialDataSource) Configure(ctx context.Context, req datasource.Con
// Schema defines the schema for the data source.
func (r *credentialDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
descriptions := map[string]string{
"main": "PostgreSQL credential data source schema. Must have a `region` specified in the provider configuration.",
"main": "PostgreSQL credential data source schema. Must have a `region` specified in the provider configuration.",
"deprecation_message": strings.Join(
[]string{
"The STACKIT PostgreSQL service will reach its end of support on June 30th 2024.",
"Data sources of this type will stop working after that.",
"Use stackit_postgresflex_user instead.",
"For more details, check https://docs.stackit.cloud/stackit/en/bring-your-data-to-stackit-postgresql-flex-138347648.html",
},
" ",
),
"id": "Terraform's internal data source. identifier. It is structured as \"`project_id`,`instance_id`,`credential_id`\".",
"credential_id": "The credential's ID.",
"instance_id": "ID of the PostgreSQL instance.",
@ -84,6 +94,9 @@ func (r *credentialDataSource) Schema(_ context.Context, _ datasource.SchemaRequ
resp.Schema = schema.Schema{
Description: descriptions["main"],
// Callout block: https://developer.hashicorp.com/terraform/registry/providers/docs#callouts
MarkdownDescription: fmt.Sprintf("%s\n\n!> %s", descriptions["main"], descriptions["deprecation_message"]),
DeprecationMessage: descriptions["deprecation_message"],
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
Description: descriptions["id"],

View file

@ -98,7 +98,16 @@ func (r *credentialResource) Configure(ctx context.Context, req resource.Configu
// Schema defines the schema for the resource.
func (r *credentialResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
descriptions := map[string]string{
"main": "PostgreSQL credential resource schema. Must have a `region` specified in the provider configuration.",
"main": "PostgreSQL credential resource schema. Must have a `region` specified in the provider configuration.",
"deprecation_message": strings.Join(
[]string{
"The STACKIT PostgreSQL service will reach its end of support on June 30th 2024.",
"Resources of this type will stop working after that.",
"Use stackit_postgresflex_user instead.",
"For more details, check https://docs.stackit.cloud/stackit/en/bring-your-data-to-stackit-postgresql-flex-138347648.html",
},
" ",
),
"id": "Terraform's internal resource identifier. It is structured as \"`project_id`,`instance_id`,`credential_id`\".",
"credential_id": "The credential's ID.",
"instance_id": "ID of the PostgreSQL instance.",
@ -107,6 +116,9 @@ func (r *credentialResource) Schema(_ context.Context, _ resource.SchemaRequest,
resp.Schema = schema.Schema{
Description: descriptions["main"],
// Callout block: https://developer.hashicorp.com/terraform/registry/providers/docs#callouts
MarkdownDescription: fmt.Sprintf("%s\n\n!> %s", descriptions["main"], descriptions["deprecation_message"]),
DeprecationMessage: descriptions["deprecation_message"],
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
Description: descriptions["id"],

View file

@ -3,6 +3,7 @@ package postgresql
import (
"context"
"fmt"
"strings"
"github.com/hashicorp/terraform-plugin-framework/datasource"
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
@ -75,7 +76,16 @@ func (r *instanceDataSource) Configure(ctx context.Context, req datasource.Confi
// Schema defines the schema for the data source.
func (r *instanceDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
descriptions := map[string]string{
"main": "PostgreSQL instance data source schema. Must have a `region` specified in the provider configuration.",
"main": "PostgreSQL instance data source schema. Must have a `region` specified in the provider configuration.",
"deprecation_message": strings.Join(
[]string{
"The STACKIT PostgreSQL service will reach its end of support on June 30th 2024.",
"Data sources of this type will stop working after that.",
"Use stackit_postgresflex_instance instead.",
"For more details, check https://docs.stackit.cloud/stackit/en/bring-your-data-to-stackit-postgresql-flex-138347648.html",
},
" ",
),
"id": "Terraform's internal data source. identifier. It is structured as \"`project_id`,`instance_id`\".",
"instance_id": "ID of the PostgreSQL instance.",
"project_id": "STACKIT Project ID to which the instance is associated.",
@ -87,6 +97,9 @@ func (r *instanceDataSource) Schema(_ context.Context, _ datasource.SchemaReques
resp.Schema = schema.Schema{
Description: descriptions["main"],
// Callout block: https://developer.hashicorp.com/terraform/registry/providers/docs#callouts
MarkdownDescription: fmt.Sprintf("%s\n\n!> %s", descriptions["main"], descriptions["deprecation_message"]),
DeprecationMessage: descriptions["deprecation_message"],
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
Description: descriptions["id"],

View file

@ -122,7 +122,16 @@ func (r *instanceResource) Configure(ctx context.Context, req resource.Configure
// Schema defines the schema for the resource.
func (r *instanceResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
descriptions := map[string]string{
"main": "PostgreSQL instance resource schema. Must have a `region` specified in the provider configuration.",
"main": "PostgreSQL instance resource schema. Must have a `region` specified in the provider configuration.",
"deprecation_message": strings.Join(
[]string{
"The STACKIT PostgreSQL service will reach its end of support on June 30th 2024.",
"Resources of this type will stop working after that.",
"Use stackit_postgresflex_instance instead.",
"Check https://docs.stackit.cloud/stackit/en/bring-your-data-to-stackit-postgresql-flex-138347648.html on how to backup and restore an instance from PostgreSQL to PostgreSQL Flex, then import the resource to Terraform using an \"import\" block (https://developer.hashicorp.com/terraform/language/import)",
},
" ",
),
"id": "Terraform's internal resource ID. It is structured as \"`project_id`,`instance_id`\".",
"instance_id": "ID of the PostgreSQL instance.",
"project_id": "STACKIT project ID to which the instance is associated.",
@ -134,6 +143,9 @@ func (r *instanceResource) Schema(_ context.Context, _ resource.SchemaRequest, r
resp.Schema = schema.Schema{
Description: descriptions["main"],
// Callout block: https://developer.hashicorp.com/terraform/registry/providers/docs#callouts
MarkdownDescription: fmt.Sprintf("%s\n\n!> %s", descriptions["main"], descriptions["deprecation_message"]),
DeprecationMessage: descriptions["deprecation_message"],
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
Description: descriptions["id"],