From fd3288167f4644c42e0cd8e283842e512439a4b4 Mon Sep 17 00:00:00 2001 From: Stacey Salamon Date: Thu, 28 Mar 2024 16:24:10 +0100 Subject: [PATCH] docs: update service integrations docs --- docs/data-sources/service_integration.md | 33 +++++++++--------- docs/resources/service_integration.md | 34 +++++++++---------- .../aiven_service_integration/data-source.tf | 10 +++--- .../aiven_service_integration/import.sh | 2 +- .../aiven_service_integration/resource.tf | 10 +++--- .../serviceintegration/service_integration.go | 14 ++++---- .../service_integration_data_source.go | 2 +- .../data-sources/service_integration.md.tmpl | 24 ------------- .../resources/service_integration.md.tmpl | 10 +++--- 9 files changed, 57 insertions(+), 82 deletions(-) delete mode 100644 templates/data-sources/service_integration.md.tmpl diff --git a/docs/data-sources/service_integration.md b/docs/data-sources/service_integration.md index 0589a2638..95f82ca40 100644 --- a/docs/data-sources/service_integration.md +++ b/docs/data-sources/service_integration.md @@ -1,34 +1,34 @@ --- +# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "aiven_service_integration Data Source - terraform-provider-aiven" subcategory: "" description: |- - The Service Integration data source provides information about the existing Aiven Service Integration. + Gets information about an Aiven service integration. --- + # aiven_service_integration (Data Source) -The Service Integration data source provides information about the existing Aiven Service Integration. -Service Integration defines an integration between two Aiven services or between Aiven service and an external -integration endpoint. Integration could be for example sending metrics from Kafka service to an M3DB service, -getting metrics from an M3Db service to a Grafana service to show dashboards, sending logs from any service to -OpenSearch, etc. +Gets information about an Aiven service integration. ## Example Usage + ```terraform -data "aiven_service_integration" "myintegration" { - project = aiven_project.myproject.project - destination_service_name = "" - integration_type = "datadog" - source_service_name = "" +data "aiven_service_integration" "example_integration" { + project = data.aiven_project.example_project.project + destination_service_name = aiven_m3db.example_m3db.service_name + integration_type = "metrics" + source_service_name = aiven_kafka.example_kafka.service_name } ``` + ## Schema ### Required -- `destination_service_name` (String) Destination service for the integration (if any) +- `destination_service_name` (String) Destination service for the integration. - `integration_type` (String) Type of the service integration. Possible values: `alertmanager`, `autoscaler`, `caching`, `cassandra_cross_service_cluster`, `clickhouse_credentials`, `clickhouse_kafka`, `clickhouse_postgresql`, `dashboard`, `datadog`, `datasource`, `external_aws_cloudwatch_logs`, `external_aws_cloudwatch_metrics`, `external_elasticsearch_logs`, `external_google_cloud_logging`, `external_opensearch_logs`, `flink`, `flink_external_bigquery`, `flink_external_kafka`, `internal_connectivity`, `jolokia`, `kafka_connect`, `kafka_connect_postgresql`, `kafka_logs`, `kafka_mirrormaker`, `logs`, `m3aggregator`, `m3coordinator`, `metrics`, `opensearch_cross_cluster_replication`, `opensearch_cross_cluster_search`, `prometheus`, `read_replica`, `rsyslog`, `schema_registry_proxy`, `stresstester`, `thanoscompactor`, `thanosquery`, `thanosstore`, `vector`, `vmalert` -- `project` (String) Project the integration belongs to +- `project` (String) Project the integration belongs to. - `source_service_name` (String) Source service for the integration (if any) ### Read-Only @@ -36,20 +36,20 @@ data "aiven_service_integration" "myintegration" { - `clickhouse_kafka_user_config` (List of Object) ClickhouseKafka user configurable settings (see [below for nested schema](#nestedatt--clickhouse_kafka_user_config)) - `clickhouse_postgresql_user_config` (List of Object) ClickhousePostgresql user configurable settings (see [below for nested schema](#nestedatt--clickhouse_postgresql_user_config)) - `datadog_user_config` (List of Object) Datadog user configurable settings (see [below for nested schema](#nestedatt--datadog_user_config)) -- `destination_endpoint_id` (String) Destination endpoint for the integration (if any) +- `destination_endpoint_id` (String) Destination endpoint for the integration. - `external_aws_cloudwatch_logs_user_config` (List of Object) ExternalAwsCloudwatchLogs user configurable settings (see [below for nested schema](#nestedatt--external_aws_cloudwatch_logs_user_config)) - `external_aws_cloudwatch_metrics_user_config` (List of Object) ExternalAwsCloudwatchMetrics user configurable settings (see [below for nested schema](#nestedatt--external_aws_cloudwatch_metrics_user_config)) - `external_elasticsearch_logs_user_config` (List of Object) ExternalElasticsearchLogs user configurable settings (see [below for nested schema](#nestedatt--external_elasticsearch_logs_user_config)) - `external_opensearch_logs_user_config` (List of Object) ExternalOpensearchLogs user configurable settings (see [below for nested schema](#nestedatt--external_opensearch_logs_user_config)) - `id` (String) The ID of this resource. -- `integration_id` (String) Service Integration Id at aiven +- `integration_id` (String) The ID of the Aiven service integration. - `kafka_connect_user_config` (List of Object) KafkaConnect user configurable settings (see [below for nested schema](#nestedatt--kafka_connect_user_config)) - `kafka_logs_user_config` (List of Object) KafkaLogs user configurable settings (see [below for nested schema](#nestedatt--kafka_logs_user_config)) - `kafka_mirrormaker_user_config` (List of Object) KafkaMirrormaker user configurable settings (see [below for nested schema](#nestedatt--kafka_mirrormaker_user_config)) - `logs_user_config` (List of Object) Logs user configurable settings (see [below for nested schema](#nestedatt--logs_user_config)) - `metrics_user_config` (List of Object) Metrics user configurable settings (see [below for nested schema](#nestedatt--metrics_user_config)) - `prometheus_user_config` (List of Object) Prometheus user configurable settings (see [below for nested schema](#nestedatt--prometheus_user_config)) -- `source_endpoint_id` (String) Source endpoint for the integration (if any) +- `source_endpoint_id` (String) Source endpoint for the integration. ### Nested Schema for `clickhouse_kafka_user_config` @@ -343,4 +343,3 @@ Read-Only: - `perf_events_statements_digest_text_limit` (Number) - `perf_events_statements_limit` (Number) - `perf_events_statements_time_limit` (Number) - diff --git a/docs/resources/service_integration.md b/docs/resources/service_integration.md index 7e6d89913..3f3e41b01 100644 --- a/docs/resources/service_integration.md +++ b/docs/resources/service_integration.md @@ -2,25 +2,25 @@ page_title: "aiven_service_integration Resource - terraform-provider-aiven" subcategory: "" description: |- - The Service Integration resource allows the creation and management of Aiven Service Integrations. + Creates and manages an Aiven service integration https://aiven.io/docs/platform/concepts/service-integration. --- # aiven_service_integration (Resource) -The Service Integration resource allows the creation and management of Aiven Service Integrations. +Creates and manages an Aiven [service integration](https://aiven.io/docs/platform/concepts/service-integration). -**Note** For services running on `hobbyist` plan service integrations are not supported. +You can set up an integration between two Aiven services or an Aiven service and an external +service. For example, you can send metrics from a Kafka service to an M3DB service, +send metrics from an M3DB service to a Grafana service to show dashboards, and send logs from +any service to OpenSearch. -Service Integration defines an integration between two Aiven services or between Aiven service and an external -integration endpoint. Integration could be for example sending metrics from Kafka service to an M3DB service, -getting metrics from an M3DB service to a Grafana service to show dashboards, sending logs from any service to -OpenSearch, etc. +**Services integrations are not supported for services running on hobbyist plans.** ## Example Usage ```terraform -resource "aiven_service_integration" "my_integration_metrics" { - project = aiven_project.myproject.project +resource "aiven_service_integration" "example_integration" { + project = data.aiven_project.example_project.project integration_type = "metrics" - source_service_name = aiven_kafka.kfk1.service_name - destination_service_name = aiven_m3db.m3db.service_name + source_service_name = aiven_kafka.example_kafka.service_name + destination_service_name = aiven_m3db.example_m3db.service_name } ``` @@ -29,15 +29,15 @@ resource "aiven_service_integration" "my_integration_metrics" { ### Required - `integration_type` (String) Type of the service integration. Possible values: `alertmanager`, `autoscaler`, `caching`, `cassandra_cross_service_cluster`, `clickhouse_credentials`, `clickhouse_kafka`, `clickhouse_postgresql`, `dashboard`, `datadog`, `datasource`, `external_aws_cloudwatch_logs`, `external_aws_cloudwatch_metrics`, `external_elasticsearch_logs`, `external_google_cloud_logging`, `external_opensearch_logs`, `flink`, `flink_external_bigquery`, `flink_external_kafka`, `internal_connectivity`, `jolokia`, `kafka_connect`, `kafka_connect_postgresql`, `kafka_logs`, `kafka_mirrormaker`, `logs`, `m3aggregator`, `m3coordinator`, `metrics`, `opensearch_cross_cluster_replication`, `opensearch_cross_cluster_search`, `prometheus`, `read_replica`, `rsyslog`, `schema_registry_proxy`, `stresstester`, `thanoscompactor`, `thanosquery`, `thanosstore`, `vector`, `vmalert` -- `project` (String) Project the integration belongs to +- `project` (String) Project the integration belongs to. ### Optional - `clickhouse_kafka_user_config` (Block List, Max: 1) ClickhouseKafka user configurable settings (see [below for nested schema](#nestedblock--clickhouse_kafka_user_config)) - `clickhouse_postgresql_user_config` (Block List, Max: 1) ClickhousePostgresql user configurable settings (see [below for nested schema](#nestedblock--clickhouse_postgresql_user_config)) - `datadog_user_config` (Block List, Max: 1) Datadog user configurable settings (see [below for nested schema](#nestedblock--datadog_user_config)) -- `destination_endpoint_id` (String) Destination endpoint for the integration (if any) -- `destination_service_name` (String) Destination service for the integration (if any) +- `destination_endpoint_id` (String) Destination endpoint for the integration. +- `destination_service_name` (String) Destination service for the integration. - `external_aws_cloudwatch_logs_user_config` (Block List, Max: 1) ExternalAwsCloudwatchLogs user configurable settings (see [below for nested schema](#nestedblock--external_aws_cloudwatch_logs_user_config)) - `external_aws_cloudwatch_metrics_user_config` (Block List, Max: 1) ExternalAwsCloudwatchMetrics user configurable settings (see [below for nested schema](#nestedblock--external_aws_cloudwatch_metrics_user_config)) - `external_elasticsearch_logs_user_config` (Block List, Max: 1) ExternalElasticsearchLogs user configurable settings (see [below for nested schema](#nestedblock--external_elasticsearch_logs_user_config)) @@ -48,14 +48,14 @@ resource "aiven_service_integration" "my_integration_metrics" { - `logs_user_config` (Block List, Max: 1) Logs user configurable settings (see [below for nested schema](#nestedblock--logs_user_config)) - `metrics_user_config` (Block List, Max: 1) Metrics user configurable settings (see [below for nested schema](#nestedblock--metrics_user_config)) - `prometheus_user_config` (Block List, Max: 1) Prometheus user configurable settings (see [below for nested schema](#nestedblock--prometheus_user_config)) -- `source_endpoint_id` (String) Source endpoint for the integration (if any) +- `source_endpoint_id` (String) Source endpoint for the integration. - `source_service_name` (String) Source service for the integration (if any) - `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) ### Read-Only - `id` (String) The ID of this resource. -- `integration_id` (String) Service Integration Id at aiven +- `integration_id` (String) The ID of the Aiven service integration. ### Nested Schema for `clickhouse_kafka_user_config` @@ -375,5 +375,5 @@ Optional: ## Import Import is supported using the following syntax: ```shell -terraform import aiven_service_integration.myintegration PROJECT/INTEGRATION_ID +terraform import aiven_service_integration.example_integration PROJECT/INTEGRATION_ID ``` diff --git a/examples/data-sources/aiven_service_integration/data-source.tf b/examples/data-sources/aiven_service_integration/data-source.tf index 9224c8e11..358061b50 100644 --- a/examples/data-sources/aiven_service_integration/data-source.tf +++ b/examples/data-sources/aiven_service_integration/data-source.tf @@ -1,7 +1,7 @@ -data "aiven_service_integration" "myintegration" { - project = aiven_project.myproject.project - destination_service_name = "" - integration_type = "datadog" - source_service_name = "" +data "aiven_service_integration" "example_integration" { + project = data.aiven_project.example_project.project + destination_service_name = aiven_m3db.example_m3db.service_name + integration_type = "metrics" + source_service_name = aiven_kafka.example_kafka.service_name } diff --git a/examples/resources/aiven_service_integration/import.sh b/examples/resources/aiven_service_integration/import.sh index edac7f688..d9b76d7d7 100644 --- a/examples/resources/aiven_service_integration/import.sh +++ b/examples/resources/aiven_service_integration/import.sh @@ -1 +1 @@ -terraform import aiven_service_integration.myintegration PROJECT/INTEGRATION_ID +terraform import aiven_service_integration.example_integration PROJECT/INTEGRATION_ID diff --git a/examples/resources/aiven_service_integration/resource.tf b/examples/resources/aiven_service_integration/resource.tf index 1ceb33076..8181a6b19 100644 --- a/examples/resources/aiven_service_integration/resource.tf +++ b/examples/resources/aiven_service_integration/resource.tf @@ -1,6 +1,6 @@ -resource "aiven_service_integration" "my_integration_metrics" { - project = aiven_project.myproject.project +resource "aiven_service_integration" "example_integration" { + project = data.aiven_project.example_project.project integration_type = "metrics" - source_service_name = aiven_kafka.kfk1.service_name - destination_service_name = aiven_m3db.m3db.service_name -} + source_service_name = aiven_kafka.example_kafka.service_name + destination_service_name = aiven_m3db.example_m3db.service_name +} \ No newline at end of file diff --git a/internal/sdkprovider/service/serviceintegration/service_integration.go b/internal/sdkprovider/service/serviceintegration/service_integration.go index cc6d754c0..180ab2076 100644 --- a/internal/sdkprovider/service/serviceintegration/service_integration.go +++ b/internal/sdkprovider/service/serviceintegration/service_integration.go @@ -26,20 +26,20 @@ const serviceIntegrationEndpointRegExp = "^[a-zA-Z0-9_-]*\\/{1}[a-zA-Z0-9_-]*$" func aivenServiceIntegrationSchema() map[string]*schema.Schema { s := map[string]*schema.Schema{ "integration_id": { - Description: "Service Integration Id at aiven", + Description: "The ID of the Aiven service integration.", Computed: true, Type: schema.TypeString, }, "destination_endpoint_id": { - Description: "Destination endpoint for the integration (if any)", + Description: "Destination endpoint for the integration.", ForceNew: true, Optional: true, Type: schema.TypeString, ValidateFunc: validation.StringMatch(regexp.MustCompile(serviceIntegrationEndpointRegExp), - "endpoint id should have the following format: project_name/endpoint_id"), + "endpoint ID should have the following format: project_name/endpoint_id"), }, "destination_service_name": { - Description: "Destination service for the integration (if any)", + Description: "Destination service for the integration.", ForceNew: true, Optional: true, Type: schema.TypeString, @@ -52,13 +52,13 @@ func aivenServiceIntegrationSchema() map[string]*schema.Schema { ValidateFunc: validation.StringInSlice(codegenintegrations.IntegrationTypeChoices(), false), }, "project": { - Description: "Project the integration belongs to", + Description: "Project the integration belongs to.", ForceNew: true, Required: true, Type: schema.TypeString, }, "source_endpoint_id": { - Description: "Source endpoint for the integration (if any)", + Description: "Source endpoint for the integration.", ForceNew: true, Optional: true, Type: schema.TypeString, @@ -82,7 +82,7 @@ func aivenServiceIntegrationSchema() map[string]*schema.Schema { func ResourceServiceIntegration() *schema.Resource { return &schema.Resource{ - Description: "The Service Integration resource allows the creation and management of Aiven Service Integrations.", + Description: "Creates and manages an Aiven [service integration](https://aiven.io/docs/platform/concepts/service-integration).", CreateContext: resourceServiceIntegrationCreate, ReadContext: resourceServiceIntegrationRead, UpdateContext: resourceServiceIntegrationUpdate, diff --git a/internal/sdkprovider/service/serviceintegration/service_integration_data_source.go b/internal/sdkprovider/service/serviceintegration/service_integration_data_source.go index b219071df..f8e9e901d 100644 --- a/internal/sdkprovider/service/serviceintegration/service_integration_data_source.go +++ b/internal/sdkprovider/service/serviceintegration/service_integration_data_source.go @@ -13,7 +13,7 @@ import ( func DatasourceServiceIntegration() *schema.Resource { return &schema.Resource{ ReadContext: datasourceServiceIntegrationRead, - Description: "The Service Integration data source provides information about the existing Aiven Service Integration.", + Description: "Gets information about an Aiven service integration.", Schema: schemautil.ResourceSchemaAsDatasourceSchema(aivenServiceIntegrationSchema(), "project", "integration_type", "source_service_name", "destination_service_name"), } diff --git a/templates/data-sources/service_integration.md.tmpl b/templates/data-sources/service_integration.md.tmpl deleted file mode 100644 index 2927f4e5d..000000000 --- a/templates/data-sources/service_integration.md.tmpl +++ /dev/null @@ -1,24 +0,0 @@ ---- -page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" -subcategory: "" -description: |- -{{ .Description | plainmarkdown | trimspace | prefixlines " " }} ---- -# {{.Name}} ({{.Type}}) -{{ .Description | trimspace }} - -Service Integration defines an integration between two Aiven services or between Aiven service and an external -integration endpoint. Integration could be for example sending metrics from Kafka service to an M3DB service, -getting metrics from an M3Db service to a Grafana service to show dashboards, sending logs from any service to -OpenSearch, etc. - -{{ if .HasExample -}} -## Example Usage -{{ tffile .ExampleFile }} -{{- end }} -{{ .SchemaMarkdown | trimspace }} -{{ if .HasImport -}} -## Import -Import is supported using the following syntax: -{{ printf "{{codefile \"shell\" %q}}" .ImportFile }} -{{- end }} diff --git a/templates/resources/service_integration.md.tmpl b/templates/resources/service_integration.md.tmpl index 7192b1bae..07e190dc2 100644 --- a/templates/resources/service_integration.md.tmpl +++ b/templates/resources/service_integration.md.tmpl @@ -7,12 +7,12 @@ description: |- # {{.Name}} ({{.Type}}) {{ .Description | trimspace }} -**Note** For services running on `hobbyist` plan service integrations are not supported. +You can set up an integration between two Aiven services or an Aiven service and an external +service. For example, you can send metrics from a Kafka service to an M3DB service, +send metrics from an M3DB service to a Grafana service to show dashboards, and send logs from +any service to OpenSearch. -Service Integration defines an integration between two Aiven services or between Aiven service and an external -integration endpoint. Integration could be for example sending metrics from Kafka service to an M3DB service, -getting metrics from an M3DB service to a Grafana service to show dashboards, sending logs from any service to -OpenSearch, etc. +**Services integrations are not supported for services running on hobbyist plans.** {{ if .HasExample -}} ## Example Usage