From 9d02fec46d22cb541eba873c91965770c020de6b Mon Sep 17 00:00:00 2001 From: Stacey Salamon Date: Mon, 27 Jan 2025 14:58:39 +0100 Subject: [PATCH] docs: add EOL notice and migration guide for M3DB --- docs/guides/update-deprecated-resources.md | 33 +++++++++++++++++++ docs/resources/m3db.md | 19 ++++++----- docs/resources/m3db_user.md | 18 +++++----- internal/sdkprovider/service/m3db/m3db.go | 2 +- .../sdkprovider/service/m3db/m3db_user.go | 2 +- .../guides/update-deprecated-resources.md | 33 +++++++++++++++++++ templates/resources/m3db.md.tmpl | 28 ++++++++++++++++ templates/resources/m3db_user.md.tmpl | 27 +++++++++++++++ 8 files changed, 142 insertions(+), 20 deletions(-) create mode 100644 templates/resources/m3db.md.tmpl create mode 100644 templates/resources/m3db_user.md.tmpl diff --git a/docs/guides/update-deprecated-resources.md b/docs/guides/update-deprecated-resources.md index f8f8f4044..04b468854 100644 --- a/docs/guides/update-deprecated-resources.md +++ b/docs/guides/update-deprecated-resources.md @@ -511,3 +511,36 @@ resource "aiven_redis_user" "caching_example_user" { ```bash terraform state list ``` + +## Migrate from M3DB to Thanos Metrics + +Migrate your Aiven for M3 databases to [Aiven for Thanos Metrics](https://aiven.io/docs/products/metrics). + +1. Create an Aiven for Thanos Metrics service to migrate your Aiven for M3 databases to using the `aiven_thanos` resource: + ```hcl + resource "aiven_thanos" "example_thanos" { + project = data.aiven_project.example_project.project + cloud_name = "google-europe-west1" + plan = "business-4" + service_name = "example-thanos-service" + } + ``` + +2. In the Aiven Console, [migrate your M3DB database to this Thanos service](https://aiven.io/docs/products/metrics/howto/migrate-m3db-thanos). + +3. After the migration, remove the `aiven_m3db` and `aiven_m3db_user` resources. + + -> **Note** + Aiven for Metrics does not have service users. You can grant access to the service using [project roles and permissions](https://registry.terraform.io/providers/aiven/aiven/latest/docs/resources/organization_permission). + +4. To preview the changes, run: + + ```bash + terraform plan + ``` + +5. To apply the changes, run: + + ```bash + terraform apply --auto-approve + ``` diff --git a/docs/resources/m3db.md b/docs/resources/m3db.md index e74370fd0..6dad8dfb3 100644 --- a/docs/resources/m3db.md +++ b/docs/resources/m3db.md @@ -1,17 +1,22 @@ --- -# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "aiven_m3db Resource - terraform-provider-aiven" subcategory: "" description: |- - Creates and manages an Aiven for M3DB https://aiven.io/docs/products/m3db service. + Creates and manages an Aiven for M3 https://aiven.io/docs/products/m3db service. --- - # aiven_m3db (Resource) -Creates and manages an [Aiven for M3DB](https://aiven.io/docs/products/m3db) service. +Creates and manages an [Aiven for M3](https://aiven.io/docs/products/m3db) service. -## Example Usage +~> **End of life notice** +**After 30 April 2025** all running Aiven for M3 services will be powered off and deleted, making data from these services inaccessible. +You cannot create M3DB services in Aiven projects that didn't have M3DB services before. +To avoid interruptions to your service, [migrate to Aiven for Thanos Metrics](https://registry.terraform.io/providers/aiven/aiven/latest/docs/guides/update-deprecated-resources#migrate-from-m3db-to-thanos-metrics) +before the end of life date. + + +## Example Usage ```terraform resource "aiven_m3db" "example_m3db" { project = data.aiven_project.example_project.project @@ -31,7 +36,6 @@ resource "aiven_m3db" "example_m3db" { } } ``` - ## Schema @@ -310,11 +314,8 @@ Read-Only: - `route` (String) - `ssl` (Boolean) - `usage` (String) - ## Import - Import is supported using the following syntax: - ```shell terraform import aiven_m3db.example_m3db PROJECT/SERVICE_NAME ``` diff --git a/docs/resources/m3db_user.md b/docs/resources/m3db_user.md index 2fe0cd6ad..7b3507d5f 100644 --- a/docs/resources/m3db_user.md +++ b/docs/resources/m3db_user.md @@ -1,17 +1,21 @@ --- -# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "aiven_m3db_user Resource - terraform-provider-aiven" subcategory: "" description: |- - Creates and manages an Aiven for M3DB service user. + Creates and manages an Aiven for M3 service user. --- - # aiven_m3db_user (Resource) -Creates and manages an Aiven for M3DB service user. +Creates and manages an Aiven for M3 service user. -## Example Usage +~> **End of life notice** +**After 30 April 2025** all running Aiven for M3 services will be powered off and deleted, making data from these services inaccessible. +You cannot create M3DB services in Aiven projects that didn't have M3DB services before. +To avoid interruptions to your service, [migrate to Aiven for Thanos Metrics](https://registry.terraform.io/providers/aiven/aiven/latest/docs/guides/update-deprecated-resources#migrate-from-m3db-to-thanos-metrics) +before the end of life date. + +## Example Usage ```terraform resource "aiven_m3db_user" "example_service_user" { service_name = aiven_m3db.example_m3db.service_name @@ -20,7 +24,6 @@ resource "aiven_m3db_user" "example_service_user" { password = var.service_user_pw } ``` - ## Schema @@ -50,11 +53,8 @@ Optional: - `delete` (String) - `read` (String) - `update` (String) - ## Import - Import is supported using the following syntax: - ```shell terraform import aiven_m3db_user.example_service_user PROJECT/SERVICE_NAME/USERNAME ``` diff --git a/internal/sdkprovider/service/m3db/m3db.go b/internal/sdkprovider/service/m3db/m3db.go index 539cb9498..8e1eba707 100644 --- a/internal/sdkprovider/service/m3db/m3db.go +++ b/internal/sdkprovider/service/m3db/m3db.go @@ -66,7 +66,7 @@ func aivenM3DBSchema() map[string]*schema.Schema { } func ResourceM3DB() *schema.Resource { return &schema.Resource{ - Description: "Creates and manages an [Aiven for M3DB](https://aiven.io/docs/products/m3db) service.", + Description: "Creates and manages an [Aiven for M3](https://aiven.io/docs/products/m3db) service.", CreateContext: schemautil.ResourceServiceCreateWrapper(schemautil.ServiceTypeM3), ReadContext: schemautil.ResourceServiceRead, UpdateContext: schemautil.ResourceServiceUpdate, diff --git a/internal/sdkprovider/service/m3db/m3db_user.go b/internal/sdkprovider/service/m3db/m3db_user.go index 1d37a8ca5..bfdab0593 100644 --- a/internal/sdkprovider/service/m3db/m3db_user.go +++ b/internal/sdkprovider/service/m3db/m3db_user.go @@ -37,7 +37,7 @@ var aivenM3DBUserSchema = map[string]*schema.Schema{ func ResourceM3DBUser() *schema.Resource { return &schema.Resource{ - Description: "Creates and manages an Aiven for M3DB service user.", + Description: "Creates and manages an Aiven for M3 service user.", CreateContext: schemautil.ResourceServiceUserCreate, UpdateContext: schemautil.ResourceServiceUserUpdate, ReadContext: schemautil.ResourceServiceUserRead, diff --git a/templates/guides/update-deprecated-resources.md b/templates/guides/update-deprecated-resources.md index f8f8f4044..04b468854 100644 --- a/templates/guides/update-deprecated-resources.md +++ b/templates/guides/update-deprecated-resources.md @@ -511,3 +511,36 @@ resource "aiven_redis_user" "caching_example_user" { ```bash terraform state list ``` + +## Migrate from M3DB to Thanos Metrics + +Migrate your Aiven for M3 databases to [Aiven for Thanos Metrics](https://aiven.io/docs/products/metrics). + +1. Create an Aiven for Thanos Metrics service to migrate your Aiven for M3 databases to using the `aiven_thanos` resource: + ```hcl + resource "aiven_thanos" "example_thanos" { + project = data.aiven_project.example_project.project + cloud_name = "google-europe-west1" + plan = "business-4" + service_name = "example-thanos-service" + } + ``` + +2. In the Aiven Console, [migrate your M3DB database to this Thanos service](https://aiven.io/docs/products/metrics/howto/migrate-m3db-thanos). + +3. After the migration, remove the `aiven_m3db` and `aiven_m3db_user` resources. + + -> **Note** + Aiven for Metrics does not have service users. You can grant access to the service using [project roles and permissions](https://registry.terraform.io/providers/aiven/aiven/latest/docs/resources/organization_permission). + +4. To preview the changes, run: + + ```bash + terraform plan + ``` + +5. To apply the changes, run: + + ```bash + terraform apply --auto-approve + ``` diff --git a/templates/resources/m3db.md.tmpl b/templates/resources/m3db.md.tmpl new file mode 100644 index 000000000..751be290d --- /dev/null +++ b/templates/resources/m3db.md.tmpl @@ -0,0 +1,28 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +subcategory: "" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- +# {{.Name}} ({{.Type}}) + +{{ .Description | trimspace }} + + +~> **End of life notice** +**After 30 April 2025** all running Aiven for M3 services will be powered off and deleted, making data from these services inaccessible. +You cannot create M3DB services in Aiven projects that didn't have M3DB services before. +To avoid interruptions to your service, [migrate to Aiven for Thanos Metrics](https://registry.terraform.io/providers/aiven/aiven/latest/docs/guides/update-deprecated-resources#migrate-from-m3db-to-thanos-metrics) +before the end of life date. + + +{{ if .HasExample -}} +## Example Usage +{{ tffile .ExampleFile }} +{{- end }} +{{ .SchemaMarkdown | trimspace }} +{{ if .HasImport -}} +## Import +Import is supported using the following syntax: +{{ codefile "shell" .ImportFile }} +{{- end }} diff --git a/templates/resources/m3db_user.md.tmpl b/templates/resources/m3db_user.md.tmpl new file mode 100644 index 000000000..ee5ec08af --- /dev/null +++ b/templates/resources/m3db_user.md.tmpl @@ -0,0 +1,27 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +subcategory: "" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- +# {{.Name}} ({{.Type}}) + +{{ .Description | trimspace }} + +~> **End of life notice** +**After 30 April 2025** all running Aiven for M3 services will be powered off and deleted, making data from these services inaccessible. +You cannot create M3DB services in Aiven projects that didn't have M3DB services before. +To avoid interruptions to your service, [migrate to Aiven for Thanos Metrics](https://registry.terraform.io/providers/aiven/aiven/latest/docs/guides/update-deprecated-resources#migrate-from-m3db-to-thanos-metrics) +before the end of life date. + + +{{ if .HasExample -}} +## Example Usage +{{ tffile .ExampleFile }} +{{- end }} +{{ .SchemaMarkdown | trimspace }} +{{ if .HasImport -}} +## Import +Import is supported using the following syntax: +{{ codefile "shell" .ImportFile }} +{{- end }}