Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(thanos): add example usage #1865

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion docs/data-sources/thanos.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 generated by tfplugindocs -->
## Schema
Expand Down
26 changes: 25 additions & 1 deletion docs/resources/thanos.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 generated by tfplugindocs -->
## Schema
Expand Down Expand Up @@ -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
```
5 changes: 5 additions & 0 deletions examples/data-sources/aiven_thanos/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
data "aiven_thanos" "example_thanos" {
project = data.aiven_project.example_project.project
service_name = "example-thanos-service"
}

1 change: 1 addition & 0 deletions examples/resources/aiven_thanos/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import aiven_thanos.example_thanos PROJECT/SERVICE_NAME
13 changes: 13 additions & 0 deletions examples/resources/aiven_thanos/resource.tf
Original file line number Diff line number Diff line change
@@ -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"
}
}