diff --git a/docs/data-sources/thanos.md b/docs/data-sources/thanos.md index 6ae152cd7..aeed0105b 100644 --- a/docs/data-sources/thanos.md +++ b/docs/data-sources/thanos.md @@ -10,7 +10,14 @@ description: |- Gets information about an Aiven for ThanosĀ® service. - +## Example Usage + +```terraform +data "aiven_thanos" "example_thanos" { + project = data.aiven_project.example_project.project + service_name = "example-thanos-service" +} +``` ## Schema diff --git a/docs/resources/thanos.md b/docs/resources/thanos.md index 59063d90c..1efa79fe9 100644 --- a/docs/resources/thanos.md +++ b/docs/resources/thanos.md @@ -10,7 +10,23 @@ description: |- Creates and manages an [Aiven for MetricsĀ®](https://aiven.io/docs/products/metrics/concepts/metrics-overview) service. - +## Example Usage + +```terraform +resource "aiven_thanos" "example_thanos" { + project = data.aiven_project.example_project.project + plan = "startup-4" + cloud_name = "google-europe-west1" + service_name = "example-thanos-service" + + thanos_user_config { + compactor { + retention_days = "30" + } + object_storage_usage_alert_threshold_gb = "10" + } +} +``` ## Schema @@ -192,3 +208,11 @@ Read-Only: - `route` (String) - `ssl` (Boolean) - `usage` (String) + +## Import + +Import is supported using the following syntax: + +```shell +terraform import aiven_thanos.example_thanos PROJECT/SERVICE_NAME +``` diff --git a/examples/data-sources/aiven_thanos/data-source.tf b/examples/data-sources/aiven_thanos/data-source.tf new file mode 100644 index 000000000..e85e60b3a --- /dev/null +++ b/examples/data-sources/aiven_thanos/data-source.tf @@ -0,0 +1,5 @@ +data "aiven_thanos" "example_thanos" { + project = data.aiven_project.example_project.project + service_name = "example-thanos-service" +} + diff --git a/examples/resources/aiven_thanos/import.sh b/examples/resources/aiven_thanos/import.sh new file mode 100644 index 000000000..0ab651dbd --- /dev/null +++ b/examples/resources/aiven_thanos/import.sh @@ -0,0 +1 @@ +terraform import aiven_thanos.example_thanos PROJECT/SERVICE_NAME diff --git a/examples/resources/aiven_thanos/resource.tf b/examples/resources/aiven_thanos/resource.tf new file mode 100644 index 000000000..3e9706aaa --- /dev/null +++ b/examples/resources/aiven_thanos/resource.tf @@ -0,0 +1,13 @@ +resource "aiven_thanos" "example_thanos" { + project = data.aiven_project.example_project.project + plan = "startup-4" + cloud_name = "google-europe-west1" + service_name = "example-thanos-service" + + thanos_user_config { + compactor { + retention_days = "30" + } + object_storage_usage_alert_threshold_gb = "10" + } +} \ No newline at end of file