feat: Allow move state on new Observability resources (#593)

* feat: Allow move state on new Observability resources

* Extend description to explain how to move a argus resource to observability

* Update argus docs with examples how to move a resource to observability

---------

Co-authored-by: Marcel Jacek <Marcel.Jacek@stackit.cloud>
This commit is contained in:
João Palet 2025-01-20 08:54:30 +00:00 committed by GitHub
parent fc805d8e1d
commit 1a66887c01
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 438 additions and 15 deletions

View file

@ -5,6 +5,25 @@ subcategory: ""
description: |-
Argus credential resource schema. Must have a region specified in the provider configuration.
!> The stackit_argus_credential resource has been deprecated and will be removed after February 26th 2025. Please use stackit_observability_credential instead, which offers the exact same functionality.
Example move
Example to move the deprecated stackit_argus_credential resource to the new stackit_observability_credential resource:
1. Add a new stackit_observability_credential resource with the same values like your previous stackit_argus_credential resource.
1. Add a moved block which reference the stackit_argus_credential and stackit_observability_credential resource.
1. Remove your old stackit_argus_credential resource and run $ terraform apply.
```terraform
resource "stackitarguscredential" "example" {
projectid = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instanceid = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
moved {
from = stackitarguscredential.example
to = stackitobservabilitycredential.example
}
resource "stackitobservabilitycredential" "example" {
projectid = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instanceid = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
```
---
# stackit_argus_credential (Resource)
@ -13,6 +32,28 @@ Argus credential resource schema. Must have a `region` specified in the provider
!> The `stackit_argus_credential` resource has been deprecated and will be removed after February 26th 2025. Please use `stackit_observability_credential` instead, which offers the exact same functionality.
## Example move
Example to move the deprecated `stackit_argus_credential` resource to the new `stackit_observability_credential` resource:
1. Add a new `stackit_observability_credential` resource with the same values like your previous `stackit_argus_credential` resource.
1. Add a moved block which reference the `stackit_argus_credential` and `stackit_observability_credential` resource.
1. Remove your old `stackit_argus_credential` resource and run `$ terraform apply`.
```terraform
resource "stackit_argus_credential" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
moved {
from = stackit_argus_credential.example
to = stackit_observability_credential.example
}
resource "stackit_observability_credential" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
```
## Example Usage
```terraform

View file

@ -5,6 +5,35 @@ subcategory: ""
description: |-
Argus instance resource schema. Must have a region specified in the provider configuration.
!> The stackit_argus_instance resource has been deprecated and will be removed after February 26th 2025. Please use stackit_observability_instance instead, which offers the exact same functionality.
Example move
Example to move the deprecated stackit_argus_instance resource to the newstackit_observability_instance resource:
1. Add a new stackit_observability_instance resource with the same values like your previous stackit_argus_instance resource.
1. Add a moved block which reference the stackit_argus_instance and stackit_observability_instance resource.
1. Remove your old stackit_argus_instance resource and run $ terraform apply.
```terraform
resource "stackitargusinstance" "example" {
projectid = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
name = "example-instance"
planname = "Monitoring-Medium-EU01"
acl = ["1.1.1.1/32", "2.2.2.2/32"]
metricsretentiondays = 7
metricsretentiondays5mdownsampling = 30
metricsretentiondays1hdownsampling = 365
}
moved {
from = stackitargusinstance.example
to = stackitobservabilityinstance.example
}
resource "stackitobservabilityinstance" "example" {
projectid = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
name = "example-instance"
planname = "Monitoring-Medium-EU01"
acl = ["1.1.1.1/32", "2.2.2.2/32"]
metricsretentiondays = 7
metricsretentiondays5mdownsampling = 30
metricsretentiondays1hdownsampling = 365
}
```
---
# stackit_argus_instance (Resource)
@ -13,6 +42,38 @@ Argus instance resource schema. Must have a `region` specified in the provider c
!> The `stackit_argus_instance` resource has been deprecated and will be removed after February 26th 2025. Please use `stackit_observability_instance` instead, which offers the exact same functionality.
## Example move
Example to move the deprecated `stackit_argus_instance` resource to the new`stackit_observability_instance` resource:
1. Add a new `stackit_observability_instance` resource with the same values like your previous `stackit_argus_instance` resource.
1. Add a moved block which reference the `stackit_argus_instance` and `stackit_observability_instance` resource.
1. Remove your old `stackit_argus_instance` resource and run `$ terraform apply`.
```terraform
resource "stackit_argus_instance" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
name = "example-instance"
plan_name = "Monitoring-Medium-EU01"
acl = ["1.1.1.1/32", "2.2.2.2/32"]
metrics_retention_days = 7
metrics_retention_days_5m_downsampling = 30
metrics_retention_days_1h_downsampling = 365
}
moved {
from = stackit_argus_instance.example
to = stackit_observability_instance.example
}
resource "stackit_observability_instance" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
name = "example-instance"
plan_name = "Monitoring-Medium-EU01"
acl = ["1.1.1.1/32", "2.2.2.2/32"]
metrics_retention_days = 7
metrics_retention_days_5m_downsampling = 30
metrics_retention_days_1h_downsampling = 365
}
```
## Example Usage
```terraform

View file

@ -5,6 +5,35 @@ subcategory: ""
description: |-
Argus scrape config resource schema. Must have a region specified in the provider configuration.
!> The stackit_argus_scrapeconfig resource has been deprecated and will be removed after February 26th 2025. Please use stackit_observability_scrapeconfig instead, which offers the exact same functionality.
Example move
Example to move the deprecated stackit_argus_scrapeconfig resource to the new stackit_observability_scrapeconfig resource:
1. Add a new stackit_observability_scrapeconfig resource with the same values like your previous stackit_argus_scrapeconfig resource.
1. Add a moved block which reference the stackit_argus_scrapeconfig and stackit_observability_scrapeconfig resource.
1. Remove your old stackit_argus_scrapeconfig resource and run $ terraform apply.
```terraform
resource "stackitargusscrapeconfig" "example" {
projectid = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
name = "example-instance"
planname = "Monitoring-Medium-EU01"
acl = ["1.1.1.1/32", "2.2.2.2/32"]
metricsretentiondays = 7
metricsretentiondays5mdownsampling = 30
metricsretentiondays1hdownsampling = 365
}
moved {
from = stackitargusscrapeconfig.example
to = stackitobservabilityscrapeconfig.example
}
resource "stackitobservabilityscrapeconfig" "example" {
projectid = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
name = "example-instance"
planname = "Monitoring-Medium-EU01"
acl = ["1.1.1.1/32", "2.2.2.2/32"]
metricsretentiondays = 7
metricsretentiondays5mdownsampling = 30
metricsretentiondays1hdownsampling = 365
}
```
---
# stackit_argus_scrapeconfig (Resource)
@ -13,6 +42,38 @@ Argus scrape config resource schema. Must have a `region` specified in the provi
!> The `stackit_argus_scrapeconfig` resource has been deprecated and will be removed after February 26th 2025. Please use `stackit_observability_scrapeconfig` instead, which offers the exact same functionality.
## Example move
Example to move the deprecated `stackit_argus_scrapeconfig` resource to the new `stackit_observability_scrapeconfig` resource:
1. Add a new `stackit_observability_scrapeconfig` resource with the same values like your previous `stackit_argus_scrapeconfig` resource.
1. Add a moved block which reference the `stackit_argus_scrapeconfig` and `stackit_observability_scrapeconfig` resource.
1. Remove your old `stackit_argus_scrapeconfig` resource and run `$ terraform apply`.
```terraform
resource "stackit_argus_scrapeconfig" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
name = "example-instance"
plan_name = "Monitoring-Medium-EU01"
acl = ["1.1.1.1/32", "2.2.2.2/32"]
metrics_retention_days = 7
metrics_retention_days_5m_downsampling = 30
metrics_retention_days_1h_downsampling = 365
}
moved {
from = stackit_argus_scrapeconfig.example
to = stackit_observability_scrapeconfig.example
}
resource "stackit_observability_scrapeconfig" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
name = "example-instance"
plan_name = "Monitoring-Medium-EU01"
acl = ["1.1.1.1/32", "2.2.2.2/32"]
metrics_retention_days = 7
metrics_retention_days_5m_downsampling = 30
metrics_retention_days_1h_downsampling = 365
}
```
## Example Usage
```terraform