From 1f88422005a3c2d8bbcc67ed675462afd80c380c Mon Sep 17 00:00:00 2001 From: Stacey Salamon <111294980+staceysalamon-aiven@users.noreply.github.com> Date: Thu, 15 Feb 2024 09:55:36 +0100 Subject: [PATCH] docs: fix examples (#1594) --- examples/aws_privatelink/provider.tf | 3 ++- examples/aws_privatelink/services.tf | 10 +++------- examples/cassandra_fork/project.tf | 3 +-- examples/cassandra_fork/provider.tf | 3 ++- examples/cassandra_fork/variables.tf | 3 +-- examples/clickhouse/main.tf | 7 +++---- examples/clickhouse/services.tf | 20 +++++++++---------- .../kafka_source/access.tf | 18 +++++++++-------- .../kafka_source/clickhouse.tf | 12 +++++------ .../kafka_source/kafka.tf | 10 +++++----- .../kafka_source/project.tf | 2 +- .../kafka_source/provider.tf | 4 ++-- .../kafka_source/variables.tf | 2 +- .../postgres_source/Readme.rst | 2 +- .../postgres_source/clickhouse.tf | 6 +++--- .../postgres_source/postgres.tf | 4 ++-- .../postgres_source/provider.tf | 1 + .../postgres_source/variables.tf | 2 +- examples/datadog/provider.tf | 3 ++- examples/flink/main.tf | 1 + examples/gcp_marketplace/main.tf | 7 ++++--- examples/gcp_marketplace/variables.tf | 4 ---- examples/gcp_vpc_peering/project.tf | 10 +++++----- examples/gcp_vpc_peering/provider.tf | 3 ++- examples/get-started/README.md | 5 ++--- examples/get-started/get-started.tf | 1 + examples/kafka_connect/provider.tf | 5 +++-- examples/kafka_connect/variables.tf | 2 +- .../kafka_connectors/mongo_sink/connector.tf | 2 +- .../kafka_connectors/mongo_sink/project.tf | 1 - .../kafka_connectors/mongo_sink/provider.tf | 1 + examples/kafka_connectors/os_sink/provider.tf | 3 ++- .../kafka_connectors/os_sink/variables.tf | 2 +- examples/kafka_mirrormaker/mirrormaker.tf | 4 +--- examples/kafka_mirrormaker/project.tf | 1 - examples/kafka_mirrormaker/provider.tf | 1 + .../kafka_mirrormaker_bidirectional/main.tf | 1 + .../mirrormaker.tf | 4 +--- examples/kafka_mirrormaker_global/main.tf | 3 ++- .../kafka_mirrormaker_global/mirrormaker.tf | 4 +--- examples/kafka_prometheus/provider.tf | 3 ++- examples/kafka_prometheus/variables.tf | 2 +- examples/kafka_schemas/project.tf | 1 - examples/kafka_schemas/provider.tf | 1 + examples/m3/provider.tf | 1 + examples/mysql/provider.tf | 3 ++- examples/mysql/variables.tf | 2 +- examples/opensearch/opensearch_acl.tf | 4 ++-- examples/opensearch/project.tf | 1 - examples/opensearch/provider.tf | 1 + examples/opensearch/variables.tf | 3 +-- examples/organization/org_units_projects.tf | 1 + examples/postgres/provider.tf | 3 ++- examples/postgres/variables.tf | 2 +- examples/service/project.tf | 1 - examples/service/provider.tf | 1 + examples/static_ips/main.tf | 2 +- examples/timescale/main.tf | 1 + examples_tests/kafka_connect_test.go | 2 +- examples_tests/kafka_connector_test.go | 2 +- examples_tests/kafka_prometheus_test.go | 2 +- examples_tests/mysql_test.go | 2 +- examples_tests/postgres_test.go | 2 +- 63 files changed, 112 insertions(+), 111 deletions(-) diff --git a/examples/aws_privatelink/provider.tf b/examples/aws_privatelink/provider.tf index 9a44df320..f63ec7c18 100644 --- a/examples/aws_privatelink/provider.tf +++ b/examples/aws_privatelink/provider.tf @@ -1,4 +1,5 @@ terraform { + required_version = ">=0.13" required_providers { aiven = { source = "aiven/aiven" @@ -7,7 +8,7 @@ terraform { } } -# Initialize provider. No other config options than api_token +# Initialize provider provider "aiven" { api_token = var.aiven_api_token } diff --git a/examples/aws_privatelink/services.tf b/examples/aws_privatelink/services.tf index fb005c2f1..4a4566788 100644 --- a/examples/aws_privatelink/services.tf +++ b/examples/aws_privatelink/services.tf @@ -6,7 +6,7 @@ resource "aiven_kafka" "kafka-service" { service_name = "privatelink-kafka1" maintenance_window_dow = "monday" maintenance_window_time = "10:00:00" - project_vpc_id = "YOUR-AWS-PROJECT-VPC-ID" + project_vpc_id = "AWS_PROJECT_VPC_ID" kafka_user_config { privatelink_access { @@ -32,16 +32,12 @@ resource "aiven_aws_privatelink" "aws_pl" { ] } -data "aiven_aws_privatelink" "pl" { - project = aiven_aws_privatelink.aws_pl.project - service_name = aiven_aws_privatelink.aws_pl.service_name -} - output "aws_privatelink" { value = aiven_aws_privatelink.aws_pl } -// After connecting to a VPC Endpoint from your an AWS account new service component is available +# After connecting to a VPC endpoint from your AWS account +# a new service component is available data "aiven_service_component" "kafka_privatelink" { project = aiven_aws_privatelink.aws_pl.project service_name = aiven_aws_privatelink.aws_pl.service_name diff --git a/examples/cassandra_fork/project.tf b/examples/cassandra_fork/project.tf index 4cf0b3c99..1b9b9d083 100644 --- a/examples/cassandra_fork/project.tf +++ b/examples/cassandra_fork/project.tf @@ -1,5 +1,4 @@ # Project resource "aiven_project" "project1" { - project = "project1" - card_id = var.aiven_card_id + project = "YOUR_ORG_NAME-project1" } \ No newline at end of file diff --git a/examples/cassandra_fork/provider.tf b/examples/cassandra_fork/provider.tf index 95da02882..d8efff110 100644 --- a/examples/cassandra_fork/provider.tf +++ b/examples/cassandra_fork/provider.tf @@ -1,4 +1,5 @@ terraform { + required_version = ">=0.13" required_providers { aiven = { source = "aiven/aiven" @@ -7,7 +8,7 @@ terraform { } } -# Initialize provider. No other config options than api_token +# Initialize provider provider "aiven" { api_token = var.aiven_api_token } diff --git a/examples/cassandra_fork/variables.tf b/examples/cassandra_fork/variables.tf index 4451e9657..8959bde96 100644 --- a/examples/cassandra_fork/variables.tf +++ b/examples/cassandra_fork/variables.tf @@ -1,2 +1 @@ -variable "aiven_api_token" {} -variable "aiven_card_id" {} \ No newline at end of file +variable "aiven_api_token" {} \ No newline at end of file diff --git a/examples/clickhouse/main.tf b/examples/clickhouse/main.tf index ac9b0827c..ee8b0ced2 100644 --- a/examples/clickhouse/main.tf +++ b/examples/clickhouse/main.tf @@ -1,7 +1,6 @@ -// Initialize the provider -// The only configuration option needed is the API token - +# Initialize the provider terraform { + required_version = ">=0.13" required_providers { aiven = { source = "aiven/aiven" @@ -15,6 +14,6 @@ provider "aiven" { } variable "aiven_api_token" { - description = "Aiven console API token" + description = "Aiven API token" type = string } diff --git a/examples/clickhouse/services.tf b/examples/clickhouse/services.tf index eda7ce81e..ec7a83325 100644 --- a/examples/clickhouse/services.tf +++ b/examples/clickhouse/services.tf @@ -2,7 +2,7 @@ resource "aiven_project" "clickhouse_dev" { project = "clickhouse-dev" } -// ClickHouse service in the same region +# ClickHouse service in the same region resource "aiven_clickhouse" "dev" { project = aiven_project.clickhouse_dev.project cloud_name = "google-europe-west1" @@ -12,28 +12,28 @@ resource "aiven_clickhouse" "dev" { maintenance_window_time = "10:00:00" } -// Sample ClickHouse database that can be used to write the raw data +# Sample ClickHouse database that can be used to write the raw data resource "aiven_clickhouse_database" "iot_analytics" { project = aiven_project.clickhouse_dev.project service_name = aiven_clickhouse.dev.service_name name = "iot_analytics" } -// ETL user with write permissions to the IoT measurements DB +# ETL user with write permissions to the IoT measurements DB resource "aiven_clickhouse_user" "etl" { project = aiven_project.clickhouse_dev.project service_name = aiven_clickhouse.dev.service_name username = "etl" } -// Writer role that will be granted insert privilege to the measurements DB +# Writer role that will be granted insert privilege to the measurements DB resource "aiven_clickhouse_role" "writer" { project = aiven_project.clickhouse_dev.project service_name = aiven_clickhouse.dev.service_name role = "writer" } -// Writer role's privileges +# Writer role's privileges resource "aiven_clickhouse_grant" "writer_role" { project = aiven_clickhouse.dev.project service_name = aiven_clickhouse.dev.service_name @@ -52,7 +52,7 @@ resource "aiven_clickhouse_grant" "writer_role" { } } -// Grant the writer role to the ETL user +# Grant the writer role to the ETL user resource "aiven_clickhouse_grant" "etl_user" { project = aiven_clickhouse.dev.project service_name = aiven_clickhouse.dev.service_name @@ -63,21 +63,21 @@ resource "aiven_clickhouse_grant" "etl_user" { } } -// Analyst user with read-only access to the IoT measurements DB +# Analyst user with read-only access to the IoT measurements DB resource "aiven_clickhouse_user" "analyst" { project = aiven_project.clickhouse_dev.project service_name = aiven_clickhouse.dev.service_name username = "analyst" } -// Reader role that will be granted insert privilege to the measurements DB +# Reader role that will be granted insert privilege to the measurements DB resource "aiven_clickhouse_role" "reader" { project = aiven_project.clickhouse_dev.project service_name = aiven_clickhouse.dev.service_name role = "reader" } -// Reader role's privileges +# Reader role's privileges resource "aiven_clickhouse_grant" "reader_role" { project = aiven_clickhouse.dev.project service_name = aiven_clickhouse.dev.service_name @@ -90,7 +90,7 @@ resource "aiven_clickhouse_grant" "reader_role" { } } -// Grant the reader role to the Analyst user +# Grant the reader role to the Analyst user resource "aiven_clickhouse_grant" "analyst_user" { project = aiven_clickhouse.dev.project service_name = aiven_clickhouse.dev.service_name diff --git a/examples/clickhouse_integrations/kafka_source/access.tf b/examples/clickhouse_integrations/kafka_source/access.tf index 494c98dd4..212335392 100644 --- a/examples/clickhouse_integrations/kafka_source/access.tf +++ b/examples/clickhouse_integrations/kafka_source/access.tf @@ -1,18 +1,18 @@ -// ETL user with write permissions to the IoT measurements DB +# Create an ETL user resource "aiven_clickhouse_user" "etl" { project = aiven_project.clickhouse_kafka_source.project service_name = aiven_clickhouse.clickhouse.service_name username = "etl" } -// Writer role that will be granted insert privilege to the measurements DB +# Create a role named writer resource "aiven_clickhouse_role" "writer" { project = aiven_project.clickhouse_kafka_source.project service_name = aiven_clickhouse.clickhouse.service_name role = "writer" } -// Writer role's privileges +# Set the privileges for the writer role resource "aiven_clickhouse_grant" "writer_role" { project = aiven_clickhouse.clickhouse.project service_name = aiven_clickhouse.clickhouse.service_name @@ -31,7 +31,8 @@ resource "aiven_clickhouse_grant" "writer_role" { } } -// Grant the writer role to the ETL user +# Grant the writer role to the ETL user +# to give them write permissions to the IoT measurements database resource "aiven_clickhouse_grant" "etl_user" { project = aiven_clickhouse.clickhouse.project service_name = aiven_clickhouse.clickhouse.service_name @@ -42,21 +43,21 @@ resource "aiven_clickhouse_grant" "etl_user" { } } -// Analyst user with read-only access to the IoT measurements DB +# Create an analyst resource "aiven_clickhouse_user" "analyst" { project = aiven_project.clickhouse_kafka_source.project service_name = aiven_clickhouse.clickhouse.service_name username = "analyst" } -// Reader role that will be granted insert privilege to the measurements DB +# Create a role named reader role resource "aiven_clickhouse_role" "reader" { project = aiven_project.clickhouse_kafka_source.project service_name = aiven_clickhouse.clickhouse.service_name role = "reader" } -// Reader role's privileges +# Set the privileges for the reader role resource "aiven_clickhouse_grant" "reader_role" { project = aiven_clickhouse.clickhouse.project service_name = aiven_clickhouse.clickhouse.service_name @@ -69,7 +70,8 @@ resource "aiven_clickhouse_grant" "reader_role" { } } -// Grant the reader role to the Analyst user +# Grant the reader role to the analyst user +# to give them insert privileges to the measurements database resource "aiven_clickhouse_grant" "analyst_user" { project = aiven_clickhouse.clickhouse.project service_name = aiven_clickhouse.clickhouse.service_name diff --git a/examples/clickhouse_integrations/kafka_source/clickhouse.tf b/examples/clickhouse_integrations/kafka_source/clickhouse.tf index cbefdbb74..b74b5f962 100644 --- a/examples/clickhouse_integrations/kafka_source/clickhouse.tf +++ b/examples/clickhouse_integrations/kafka_source/clickhouse.tf @@ -1,4 +1,4 @@ -// ClickHouse service in the same region +# ClickHouse service in the same region resource "aiven_clickhouse" "clickhouse" { project = aiven_project.clickhouse_kafka_source.project cloud_name = "google-europe-west1" @@ -8,10 +8,10 @@ resource "aiven_clickhouse" "clickhouse" { maintenance_window_time = "10:00:00" } -// ClickHouse service integration with a Kafka source topic containing -// edge measurements in JSON format. -// This will create a `service_kafka-gcp-eu` database with a -// `edge_measurements_raw` using the Kafka ClickHouse Engine. +# ClickHouse service integration with a Kafka source topic containing +# edge measurements in JSON format. +# This will create a `service_kafka-gcp-eu` database with a +# `edge_measurements_raw` using the Kafka ClickHouse Engine. resource "aiven_service_integration" "clickhouse_kafka_source" { project = aiven_project.clickhouse_kafka_source.project integration_type = "clickhouse_kafka" @@ -45,7 +45,7 @@ resource "aiven_service_integration" "clickhouse_kafka_source" { } } -// ClickHouse database that can be used to run analytics over the ingested data +# ClickHouse database that can be used to run analytics over the ingested data resource "aiven_clickhouse_database" "iot_analytics" { project = aiven_project.clickhouse_kafka_source.project service_name = aiven_clickhouse.clickhouse.service_name diff --git a/examples/clickhouse_integrations/kafka_source/kafka.tf b/examples/clickhouse_integrations/kafka_source/kafka.tf index 825c0bcec..0c2021155 100644 --- a/examples/clickhouse_integrations/kafka_source/kafka.tf +++ b/examples/clickhouse_integrations/kafka_source/kafka.tf @@ -1,4 +1,4 @@ -// Kafka service on GCP eu-west +# Kafka service on GCP eu-west resource "aiven_kafka" "kafka" { project = aiven_project.clickhouse_kafka_source.project cloud_name = "google-europe-west1" @@ -7,7 +7,7 @@ resource "aiven_kafka" "kafka" { maintenance_window_dow = "monday" maintenance_window_time = "10:00:00" - // Enable kafka REST to view and send messages from the Console + # Enable kafka REST to view and send messages from the Console kafka_user_config { kafka_rest = true @@ -17,7 +17,7 @@ resource "aiven_kafka" "kafka" { } } -// Kafka topic used to ingest edge measurements from the IoT devices fleet +# Kafka topic used to ingest edge measurements from the IoT devices fleet resource "aiven_kafka_topic" "edge_measurements" { project = aiven_project.clickhouse_kafka_source.project service_name = aiven_kafka.kafka.service_name @@ -29,7 +29,7 @@ resource "aiven_kafka_topic" "edge_measurements" { config { flush_ms = 10 cleanup_policy = "delete" - retention_bytes = "134217728" // 10 GiB - retention_ms = "604800000" // 1 week + retention_bytes = "134217728" # 10 GiB + retention_ms = "604800000" # 1 week } } diff --git a/examples/clickhouse_integrations/kafka_source/project.tf b/examples/clickhouse_integrations/kafka_source/project.tf index 731fdd8f3..a54a1ca76 100644 --- a/examples/clickhouse_integrations/kafka_source/project.tf +++ b/examples/clickhouse_integrations/kafka_source/project.tf @@ -1,4 +1,4 @@ -// Sample project name +# Project resource "aiven_project" "clickhouse_kafka_source" { project = "clickhouse-kafka-source" } diff --git a/examples/clickhouse_integrations/kafka_source/provider.tf b/examples/clickhouse_integrations/kafka_source/provider.tf index d26fe5f2e..f864e2b09 100644 --- a/examples/clickhouse_integrations/kafka_source/provider.tf +++ b/examples/clickhouse_integrations/kafka_source/provider.tf @@ -1,7 +1,7 @@ -// Initialize the provider -// The only configuration option needed is the API token +# Initialize the provider terraform { + required_version = ">=0.13" required_providers { aiven = { source = "aiven/aiven" diff --git a/examples/clickhouse_integrations/kafka_source/variables.tf b/examples/clickhouse_integrations/kafka_source/variables.tf index fc66cce8c..bf9f3fa9d 100644 --- a/examples/clickhouse_integrations/kafka_source/variables.tf +++ b/examples/clickhouse_integrations/kafka_source/variables.tf @@ -1,4 +1,4 @@ variable "aiven_api_token" { - description = "Aiven console API token" + description = "Aiven API token" type = string } diff --git a/examples/clickhouse_integrations/postgres_source/Readme.rst b/examples/clickhouse_integrations/postgres_source/Readme.rst index 903c76fad..05c5988cd 100644 --- a/examples/clickhouse_integrations/postgres_source/Readme.rst +++ b/examples/clickhouse_integrations/postgres_source/Readme.rst @@ -1,7 +1,7 @@ ClickHouse integration with a PostgreSQL source =============================================== -The goal of the example is to show how to exposed PostgreSQL databases in ClickHouse. +The goal of the example is to show how to expose PostgreSQL databases in ClickHouse. Imagine you're tackling an inventory analytics use case and your PostgreSQL service has three databases you'd like to access in ClickHouse: diff --git a/examples/clickhouse_integrations/postgres_source/clickhouse.tf b/examples/clickhouse_integrations/postgres_source/clickhouse.tf index 30bbf8517..40b05303f 100644 --- a/examples/clickhouse_integrations/postgres_source/clickhouse.tf +++ b/examples/clickhouse_integrations/postgres_source/clickhouse.tf @@ -1,4 +1,4 @@ -// ClickHouse service based in the same region +# ClickHouse service based in the same region resource "aiven_clickhouse" "clickhouse" { project = aiven_project.clickhouse_postgres_source.project service_name = "clickhouse-gcp-us" @@ -9,8 +9,8 @@ resource "aiven_clickhouse" "clickhouse" { } -// ClickHouse service integration for the PostgreSQL service as source -// exposing three databases in the public schema +# ClickHouse service integration for the PostgreSQL service as source +# exposing three databases in the public schema resource "aiven_service_integration" "clickhouse_postgres_source" { project = aiven_project.clickhouse_postgres_source.project integration_type = "clickhouse_postgresql" diff --git a/examples/clickhouse_integrations/postgres_source/postgres.tf b/examples/clickhouse_integrations/postgres_source/postgres.tf index 6f641c0a9..591fdc873 100644 --- a/examples/clickhouse_integrations/postgres_source/postgres.tf +++ b/examples/clickhouse_integrations/postgres_source/postgres.tf @@ -1,9 +1,9 @@ -// Postgres service based in GCP US East +# Postgres service based in GCP US East resource "aiven_pg" "postgres" { project = aiven_project.clickhouse_postgres_source.project service_name = "postgres-gcp-us" cloud_name = "google-us-east4" - plan = "business-8" // Primary + read replica + plan = "business-8" # Primary and read replica maintenance_window_dow = "monday" maintenance_window_time = "10:00:00" } diff --git a/examples/clickhouse_integrations/postgres_source/provider.tf b/examples/clickhouse_integrations/postgres_source/provider.tf index 1205ae521..5e991da00 100644 --- a/examples/clickhouse_integrations/postgres_source/provider.tf +++ b/examples/clickhouse_integrations/postgres_source/provider.tf @@ -2,6 +2,7 @@ // The only configuration option needed is the API token terraform { + required_version = ">=0.13" required_providers { aiven = { source = "aiven/aiven" diff --git a/examples/clickhouse_integrations/postgres_source/variables.tf b/examples/clickhouse_integrations/postgres_source/variables.tf index fc66cce8c..bf9f3fa9d 100644 --- a/examples/clickhouse_integrations/postgres_source/variables.tf +++ b/examples/clickhouse_integrations/postgres_source/variables.tf @@ -1,4 +1,4 @@ variable "aiven_api_token" { - description = "Aiven console API token" + description = "Aiven API token" type = string } diff --git a/examples/datadog/provider.tf b/examples/datadog/provider.tf index 95da02882..d8efff110 100644 --- a/examples/datadog/provider.tf +++ b/examples/datadog/provider.tf @@ -1,4 +1,5 @@ terraform { + required_version = ">=0.13" required_providers { aiven = { source = "aiven/aiven" @@ -7,7 +8,7 @@ terraform { } } -# Initialize provider. No other config options than api_token +# Initialize provider provider "aiven" { api_token = var.aiven_api_token } diff --git a/examples/flink/main.tf b/examples/flink/main.tf index 1f510326b..a7729fc51 100644 --- a/examples/flink/main.tf +++ b/examples/flink/main.tf @@ -1,4 +1,5 @@ terraform { + required_version = ">=0.13" required_providers { aiven = { source = "aiven/aiven" diff --git a/examples/gcp_marketplace/main.tf b/examples/gcp_marketplace/main.tf index a30161510..e239bb0f8 100644 --- a/examples/gcp_marketplace/main.tf +++ b/examples/gcp_marketplace/main.tf @@ -1,4 +1,5 @@ terraform { + required_version = ">=0.13" required_providers { aiven = { source = "aiven/aiven" @@ -26,13 +27,13 @@ resource "aiven_kafka" "kafka" { # Creating a service in a new project -data "aiven_account" "test_account" { - name = var.aiven_account_name +data "aiven_organization" "org" { + name = "YOUR_ORGANIZATION_NAME" } resource "aiven_project" "new_project" { project = "new-project" - account_id = data.aiven_account.test_account.id # This is required for new marketplace projects + parent_id = data.aiven_organization.org.id # This is required for new marketplace projects } resource "aiven_opensearch" "opensearch" { diff --git a/examples/gcp_marketplace/variables.tf b/examples/gcp_marketplace/variables.tf index 5f672dc40..1e2ded42b 100644 --- a/examples/gcp_marketplace/variables.tf +++ b/examples/gcp_marketplace/variables.tf @@ -1,8 +1,4 @@ # Find your account name from the Aiven GCP Cloud console https://console.gcp.aiven.io -variable "aiven_account_name" { - type = string -} - # Create a token at https://console.gcp.aiven.io/profile/auth # Note that this will be different from any tokens you have for https://console.aiven.io variable "aiven_api_token" { diff --git a/examples/gcp_vpc_peering/project.tf b/examples/gcp_vpc_peering/project.tf index 2343baf9d..de8d77867 100644 --- a/examples/gcp_vpc_peering/project.tf +++ b/examples/gcp_vpc_peering/project.tf @@ -1,15 +1,15 @@ -//Get Aiven project details +# Get Aiven project details data "aiven_project" "my_project" { project = "test" } -//Create a VPC in GCP +# Create a VPC in GCP resource "google_compute_network" "vpc" { name = "my-vpc" auto_create_subnetworks = "false" } -//Create a subnet in the GCP VPC +# Create a subnet in the GCP VPC resource "google_compute_subnetwork" "subnet" { name = "my-subnet" region = "us-central1" @@ -17,14 +17,14 @@ resource "google_compute_subnetwork" "subnet" { network = google_compute_network.vpc.self_link } -//Create a VPC in Aiven +# Create a VPC in Aiven resource "aiven_project_vpc" "my_vpc" { project = data.aiven_project.my_project.project cloud_name = "google-us-central1" network_cidr = "192.168.0.0/24" } -//Create a peering connection between Aiven and GCP +# Create a peering connection between Aiven and GCP resource "aiven_gcp_vpc_peering_connection" "my_peering" { vpc_id = aiven_project_vpc.my_vpc.id gcp_project_id = var.gcp_project_id diff --git a/examples/gcp_vpc_peering/provider.tf b/examples/gcp_vpc_peering/provider.tf index c5f5c2457..ed5b82014 100644 --- a/examples/gcp_vpc_peering/provider.tf +++ b/examples/gcp_vpc_peering/provider.tf @@ -1,4 +1,5 @@ terraform { + required_version = ">=0.13" required_providers { google = { source = "hashicorp/google" @@ -11,7 +12,7 @@ terraform { } } -# Initialize provider +# Initialize providers provider "aiven" { api_token = var.aiven_api_token } diff --git a/examples/get-started/README.md b/examples/get-started/README.md index cd4e3cab7..4ccbc05fe 100644 --- a/examples/get-started/README.md +++ b/examples/get-started/README.md @@ -1,9 +1,8 @@ # Get started with Aiven Provider for Terraform -Introduction +Set up your organization on Aiven and create your first Aiven project and user group. - - +This example creates a project and user group in your organization, and gives the user group access to the project. You can add users who have already accepted the invite to your organization to the group. When you add groups to projects, you can give them the `admin` `developer`, `operator`, or `read_only` [project role](https://aiven.io/docs/platform/reference/project-member-privileges). ## Prerequisites diff --git a/examples/get-started/get-started.tf b/examples/get-started/get-started.tf index 5b59353e0..efd5f7ef0 100644 --- a/examples/get-started/get-started.tf +++ b/examples/get-started/get-started.tf @@ -1,4 +1,5 @@ terraform { + required_version = ">=0.13" required_providers { aiven = { source = "aiven/aiven" diff --git a/examples/kafka_connect/provider.tf b/examples/kafka_connect/provider.tf index 95d627cad..01b93a97b 100644 --- a/examples/kafka_connect/provider.tf +++ b/examples/kafka_connect/provider.tf @@ -1,4 +1,5 @@ terraform { + required_version = ">=0.13" required_providers { aiven = { source = "aiven/aiven" @@ -7,7 +8,7 @@ terraform { } } -# Initialize provider. No other config options than api_token +# Initialize provider provider "aiven" { - api_token = var.avn_token + api_token = var.aiven_token } diff --git a/examples/kafka_connect/variables.tf b/examples/kafka_connect/variables.tf index 43140d4cb..2118eae1d 100644 --- a/examples/kafka_connect/variables.tf +++ b/examples/kafka_connect/variables.tf @@ -1,4 +1,4 @@ -variable "avn_token" {} +variable "aiven_token" {} variable "avn_project" {} variable "kafka_name" {} variable "kafka_connect_name" {} diff --git a/examples/kafka_connectors/mongo_sink/connector.tf b/examples/kafka_connectors/mongo_sink/connector.tf index 8e2e698f3..2f0482af1 100644 --- a/examples/kafka_connectors/mongo_sink/connector.tf +++ b/examples/kafka_connectors/mongo_sink/connector.tf @@ -10,7 +10,7 @@ data "aiven_service_component" "schema_registry" { } locals { - schema_registry_uri = "https://${data.aiven_service_user.kafka_admin.username}:${data.aiven_service_user.kafka_admin.password}@${data.aiven_service_component.schema_registry.host}:${data.aiven_service_component.schema_registry.port}" + schema_registry_uri = "https://${data.aiven_kafka_user.username}:${data.aiven_kafka_user.password}@${data.aiven_service_component.schema_registry.host}:${data.aiven_service_component.schema_registry.port}" } # Kafka Mongo Sink connector diff --git a/examples/kafka_connectors/mongo_sink/project.tf b/examples/kafka_connectors/mongo_sink/project.tf index d3bb93540..1e970082b 100644 --- a/examples/kafka_connectors/mongo_sink/project.tf +++ b/examples/kafka_connectors/mongo_sink/project.tf @@ -1,5 +1,4 @@ # Project resource "aiven_project" "kafka-con-project1" { project = "kafka-con-project1" - card_id = var.aiven_card_id } \ No newline at end of file diff --git a/examples/kafka_connectors/mongo_sink/provider.tf b/examples/kafka_connectors/mongo_sink/provider.tf index 95da02882..9f78c0aaa 100644 --- a/examples/kafka_connectors/mongo_sink/provider.tf +++ b/examples/kafka_connectors/mongo_sink/provider.tf @@ -1,4 +1,5 @@ terraform { + required_version = ">=0.13" required_providers { aiven = { source = "aiven/aiven" diff --git a/examples/kafka_connectors/os_sink/provider.tf b/examples/kafka_connectors/os_sink/provider.tf index 95d627cad..dd92da780 100644 --- a/examples/kafka_connectors/os_sink/provider.tf +++ b/examples/kafka_connectors/os_sink/provider.tf @@ -1,4 +1,5 @@ terraform { + required_version = ">=0.13" required_providers { aiven = { source = "aiven/aiven" @@ -9,5 +10,5 @@ terraform { # Initialize provider. No other config options than api_token provider "aiven" { - api_token = var.avn_token + api_token = var.aiven_token } diff --git a/examples/kafka_connectors/os_sink/variables.tf b/examples/kafka_connectors/os_sink/variables.tf index 88d4d6ebd..fce275a8c 100644 --- a/examples/kafka_connectors/os_sink/variables.tf +++ b/examples/kafka_connectors/os_sink/variables.tf @@ -1,4 +1,4 @@ -variable "avn_token" {} +variable "aiven_token" {} variable "avn_project" {} variable "kafka_name" {} variable "kafka_connector_name" {} diff --git a/examples/kafka_mirrormaker/mirrormaker.tf b/examples/kafka_mirrormaker/mirrormaker.tf index 783c19988..00a695421 100644 --- a/examples/kafka_mirrormaker/mirrormaker.tf +++ b/examples/kafka_mirrormaker/mirrormaker.tf @@ -5,9 +5,7 @@ resource "aiven_kafka_mirrormaker" "mm" { service_name = "mm" kafka_mirrormaker_user_config { - ip_filter = [ - "0.0.0.0/0" - ] + ip_filter_string = ["0.0.0.0/0"] kafka_mirrormaker { refresh_groups_interval_seconds = 600 diff --git a/examples/kafka_mirrormaker/project.tf b/examples/kafka_mirrormaker/project.tf index c1c83b932..d813ba11d 100644 --- a/examples/kafka_mirrormaker/project.tf +++ b/examples/kafka_mirrormaker/project.tf @@ -1,5 +1,4 @@ # Project resource "aiven_project" "kafka-mm-project1" { project = "kafka-mm-project" - card_id = var.aiven_card_id } \ No newline at end of file diff --git a/examples/kafka_mirrormaker/provider.tf b/examples/kafka_mirrormaker/provider.tf index 95da02882..9f78c0aaa 100644 --- a/examples/kafka_mirrormaker/provider.tf +++ b/examples/kafka_mirrormaker/provider.tf @@ -1,4 +1,5 @@ terraform { + required_version = ">=0.13" required_providers { aiven = { source = "aiven/aiven" diff --git a/examples/kafka_mirrormaker_bidirectional/main.tf b/examples/kafka_mirrormaker_bidirectional/main.tf index 966dbc8de..1bde5a485 100644 --- a/examples/kafka_mirrormaker_bidirectional/main.tf +++ b/examples/kafka_mirrormaker_bidirectional/main.tf @@ -1,4 +1,5 @@ terraform { + required_version = ">=0.13" required_providers { aiven = { source = "aiven/aiven" diff --git a/examples/kafka_mirrormaker_bidirectional/mirrormaker.tf b/examples/kafka_mirrormaker_bidirectional/mirrormaker.tf index e1d18485d..4136bb926 100644 --- a/examples/kafka_mirrormaker_bidirectional/mirrormaker.tf +++ b/examples/kafka_mirrormaker_bidirectional/mirrormaker.tf @@ -8,9 +8,7 @@ resource "aiven_kafka_mirrormaker" "mm" { service_name = "mm" kafka_mirrormaker_user_config { - ip_filter = [ - "0.0.0.0/0" - ] + ip_filter_string = ["0.0.0.0/0"] kafka_mirrormaker { refresh_groups_interval_seconds = 600 diff --git a/examples/kafka_mirrormaker_global/main.tf b/examples/kafka_mirrormaker_global/main.tf index b7fa7c943..1bde5a485 100644 --- a/examples/kafka_mirrormaker_global/main.tf +++ b/examples/kafka_mirrormaker_global/main.tf @@ -1,8 +1,9 @@ terraform { + required_version = ">=0.13" required_providers { aiven = { source = "aiven/aiven" - version = "2.1.0" + version = ">=4.0.0, <5.0.0" } } } diff --git a/examples/kafka_mirrormaker_global/mirrormaker.tf b/examples/kafka_mirrormaker_global/mirrormaker.tf index a888c09db..c02613675 100644 --- a/examples/kafka_mirrormaker_global/mirrormaker.tf +++ b/examples/kafka_mirrormaker_global/mirrormaker.tf @@ -8,9 +8,7 @@ resource "aiven_kafka_mirrormaker" "mm" { service_name = "mm" kafka_mirrormaker_user_config { - ip_filter = [ - "0.0.0.0/0" - ] + ip_filter_string = ["0.0.0.0/0"] kafka_mirrormaker { refresh_groups_interval_seconds = 600 diff --git a/examples/kafka_prometheus/provider.tf b/examples/kafka_prometheus/provider.tf index 95d627cad..dd92da780 100644 --- a/examples/kafka_prometheus/provider.tf +++ b/examples/kafka_prometheus/provider.tf @@ -1,4 +1,5 @@ terraform { + required_version = ">=0.13" required_providers { aiven = { source = "aiven/aiven" @@ -9,5 +10,5 @@ terraform { # Initialize provider. No other config options than api_token provider "aiven" { - api_token = var.avn_token + api_token = var.aiven_token } diff --git a/examples/kafka_prometheus/variables.tf b/examples/kafka_prometheus/variables.tf index e76a853a9..cf39b4fc0 100644 --- a/examples/kafka_prometheus/variables.tf +++ b/examples/kafka_prometheus/variables.tf @@ -1,4 +1,4 @@ -variable "avn_token" {} +variable "aiven_token" {} variable "avn_project" {} variable "kafka_name" {} variable "prometheus_endpoint_name" {} diff --git a/examples/kafka_schemas/project.tf b/examples/kafka_schemas/project.tf index 12c763c91..1ac0f5a76 100644 --- a/examples/kafka_schemas/project.tf +++ b/examples/kafka_schemas/project.tf @@ -1,5 +1,4 @@ # Project resource "aiven_project" "kafka-schemas-project1" { project = "kafka-schemas-project1" - card_id = var.aiven_card_id } \ No newline at end of file diff --git a/examples/kafka_schemas/provider.tf b/examples/kafka_schemas/provider.tf index 95da02882..9f78c0aaa 100644 --- a/examples/kafka_schemas/provider.tf +++ b/examples/kafka_schemas/provider.tf @@ -1,4 +1,5 @@ terraform { + required_version = ">=0.13" required_providers { aiven = { source = "aiven/aiven" diff --git a/examples/m3/provider.tf b/examples/m3/provider.tf index 7a56ef0c5..6bc351a26 100644 --- a/examples/m3/provider.tf +++ b/examples/m3/provider.tf @@ -1,4 +1,5 @@ terraform { + required_version = ">=0.13" required_providers { aiven = { source = "aiven/aiven" diff --git a/examples/mysql/provider.tf b/examples/mysql/provider.tf index 95d627cad..dd92da780 100644 --- a/examples/mysql/provider.tf +++ b/examples/mysql/provider.tf @@ -1,4 +1,5 @@ terraform { + required_version = ">=0.13" required_providers { aiven = { source = "aiven/aiven" @@ -9,5 +10,5 @@ terraform { # Initialize provider. No other config options than api_token provider "aiven" { - api_token = var.avn_token + api_token = var.aiven_token } diff --git a/examples/mysql/variables.tf b/examples/mysql/variables.tf index 058b2751d..6f1cab75a 100644 --- a/examples/mysql/variables.tf +++ b/examples/mysql/variables.tf @@ -1,4 +1,4 @@ -variable "avn_token" {} +variable "aiven_token" {} variable "avn_project" {} variable "mysql_name" {} variable "mysql_username" {} diff --git a/examples/opensearch/opensearch_acl.tf b/examples/opensearch/opensearch_acl.tf index 23cf30231..1c3786e5f 100644 --- a/examples/opensearch/opensearch_acl.tf +++ b/examples/opensearch/opensearch_acl.tf @@ -1,12 +1,12 @@ locals { acl_rules = [ { - username = aiven_service_user.os-user.username + username = aiven_opensearch_user.os-user.username index = "_*" permission = "admin" }, { - username = aiven_service_user.os-user.username + username = aiven_opensearch_user.os-user.username index = "*" permission = "admin" }, diff --git a/examples/opensearch/project.tf b/examples/opensearch/project.tf index 571c46fc9..8f0473341 100644 --- a/examples/opensearch/project.tf +++ b/examples/opensearch/project.tf @@ -1,5 +1,4 @@ # Project resource "aiven_project" "os-project" { project = "os-project" - card_id = var.aiven_card_id } \ No newline at end of file diff --git a/examples/opensearch/provider.tf b/examples/opensearch/provider.tf index 95da02882..9f78c0aaa 100644 --- a/examples/opensearch/provider.tf +++ b/examples/opensearch/provider.tf @@ -1,4 +1,5 @@ terraform { + required_version = ">=0.13" required_providers { aiven = { source = "aiven/aiven" diff --git a/examples/opensearch/variables.tf b/examples/opensearch/variables.tf index 4451e9657..8959bde96 100644 --- a/examples/opensearch/variables.tf +++ b/examples/opensearch/variables.tf @@ -1,2 +1 @@ -variable "aiven_api_token" {} -variable "aiven_card_id" {} \ No newline at end of file +variable "aiven_api_token" {} \ No newline at end of file diff --git a/examples/organization/org_units_projects.tf b/examples/organization/org_units_projects.tf index bf9f31bd6..fe922440a 100644 --- a/examples/organization/org_units_projects.tf +++ b/examples/organization/org_units_projects.tf @@ -4,6 +4,7 @@ variable "qa_project_name" {} variable "dev_project_name" {} terraform { + required_version = ">=0.13" required_providers { aiven = { source = "aiven/aiven" diff --git a/examples/postgres/provider.tf b/examples/postgres/provider.tf index 95d627cad..dd92da780 100644 --- a/examples/postgres/provider.tf +++ b/examples/postgres/provider.tf @@ -1,4 +1,5 @@ terraform { + required_version = ">=0.13" required_providers { aiven = { source = "aiven/aiven" @@ -9,5 +10,5 @@ terraform { # Initialize provider. No other config options than api_token provider "aiven" { - api_token = var.avn_token + api_token = var.aiven_token } diff --git a/examples/postgres/variables.tf b/examples/postgres/variables.tf index 549a3904b..2d74fa711 100644 --- a/examples/postgres/variables.tf +++ b/examples/postgres/variables.tf @@ -1,4 +1,4 @@ -variable "avn_token" {} +variable "aiven_token" {} variable "avn_project" {} variable "postgres_eu_name" {} variable "postgres_us_name" {} diff --git a/examples/service/project.tf b/examples/service/project.tf index 4cf0b3c99..2ed8d5390 100644 --- a/examples/service/project.tf +++ b/examples/service/project.tf @@ -1,5 +1,4 @@ # Project resource "aiven_project" "project1" { project = "project1" - card_id = var.aiven_card_id } \ No newline at end of file diff --git a/examples/service/provider.tf b/examples/service/provider.tf index 4f311acbb..9524950ae 100644 --- a/examples/service/provider.tf +++ b/examples/service/provider.tf @@ -1,4 +1,5 @@ terraform { + required_version = ">=0.13" required_providers { aiven = { source = "aiven/aiven" diff --git a/examples/static_ips/main.tf b/examples/static_ips/main.tf index 99eb4b1aa..8b0b7380f 100644 --- a/examples/static_ips/main.tf +++ b/examples/static_ips/main.tf @@ -1,4 +1,5 @@ terraform { + required_version = ">=0.13" required_providers { aiven = { source = "aiven/aiven" @@ -21,7 +22,6 @@ provider "aiven" { resource "aiven_project" "project" { project = "static-ips-project" - card_id = var.aiven_card_id } resource "aiven_static_ip" "ips" { diff --git a/examples/timescale/main.tf b/examples/timescale/main.tf index b390ce1ec..dc9e04343 100644 --- a/examples/timescale/main.tf +++ b/examples/timescale/main.tf @@ -1,4 +1,5 @@ terraform { + required_version = ">=0.13" required_providers { aiven = { source = "aiven/aiven" diff --git a/examples_tests/kafka_connect_test.go b/examples_tests/kafka_connect_test.go index 30da5a725..eb398e2c2 100644 --- a/examples_tests/kafka_connect_test.go +++ b/examples_tests/kafka_connect_test.go @@ -28,7 +28,7 @@ func (s *KafkaConnectTestSuite) TestKafkaConnect() { opts := s.withDefaults(&terraform.Options{ TerraformDir: "../examples/kafka_connect", Vars: map[string]interface{}{ - "avn_token": s.config.Token, + "aiven_token": s.config.Token, "avn_project": s.config.Project, "kafka_name": kafkaServiceName, "kafka_connect_name": kafkaConnectName, diff --git a/examples_tests/kafka_connector_test.go b/examples_tests/kafka_connector_test.go index 2049b4981..aa7a4cbd6 100644 --- a/examples_tests/kafka_connector_test.go +++ b/examples_tests/kafka_connector_test.go @@ -30,7 +30,7 @@ func (s *KafkaConnectorTestSuite) TestKafkaConnectorOS() { opts := s.withDefaults(&terraform.Options{ TerraformDir: "../examples/kafka_connectors/os_sink", Vars: map[string]interface{}{ - "avn_token": s.config.Token, + "aiven_token": s.config.Token, "avn_project": s.config.Project, "kafka_name": kafkaServiceName, "kafka_connector_name": kafkaConnectorName, diff --git a/examples_tests/kafka_prometheus_test.go b/examples_tests/kafka_prometheus_test.go index 3638de290..702ae2dee 100644 --- a/examples_tests/kafka_prometheus_test.go +++ b/examples_tests/kafka_prometheus_test.go @@ -29,7 +29,7 @@ func (s *KafkaPrometheusTestSuite) TestKafkaPrometheus() { opts := s.withDefaults(&terraform.Options{ TerraformDir: "../examples/kafka_prometheus", Vars: map[string]interface{}{ - "avn_token": s.config.Token, + "aiven_token": s.config.Token, "avn_project": s.config.Project, "kafka_name": kafkaServiceName, "prometheus_endpoint_name": prometheusEndpointName, diff --git a/examples_tests/mysql_test.go b/examples_tests/mysql_test.go index 5ff307e57..45e58d3cc 100644 --- a/examples_tests/mysql_test.go +++ b/examples_tests/mysql_test.go @@ -27,7 +27,7 @@ func (s *MysqlTestSuite) TestMysql() { opts := s.withDefaults(&terraform.Options{ TerraformDir: "../examples/mysql", Vars: map[string]interface{}{ - "avn_token": s.config.Token, + "aiven_token": s.config.Token, "avn_project": s.config.Project, "mysql_name": mysqlName, "mysql_username": "username" + uniqueID(), diff --git a/examples_tests/postgres_test.go b/examples_tests/postgres_test.go index 18c537d6c..195657a5c 100644 --- a/examples_tests/postgres_test.go +++ b/examples_tests/postgres_test.go @@ -29,7 +29,7 @@ func (s *PostgresTestSuite) TestPostgres() { opts := s.withDefaults(&terraform.Options{ TerraformDir: "../examples/postgres", Vars: map[string]interface{}{ - "avn_token": s.config.Token, + "aiven_token": s.config.Token, "avn_project": s.config.Project, "postgres_eu_name": pgNameEU, "postgres_us_name": pgNameUS,