{"id":26474306,"url":"https://github.com/conduktor/terraform-provider-conduktor","last_synced_at":"2025-03-19T22:52:12.482Z","repository":{"id":257737822,"uuid":"859177137","full_name":"conduktor/terraform-provider-conduktor","owner":"conduktor","description":"Terraform Provider for Conduktor products","archived":false,"fork":false,"pushed_at":"2024-10-21T15:33:45.000Z","size":231,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-24T19:06:14.705Z","etag":null,"topics":["conduktor","kafka","terraform-provider"],"latest_commit_sha":null,"homepage":"https://registry.terraform.io/providers/conduktor/conduktor/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/conduktor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-18T08:12:29.000Z","updated_at":"2024-10-16T12:33:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"15eeecbf-4ee9-4f7f-ac83-601b5181fafb","html_url":"https://github.com/conduktor/terraform-provider-conduktor","commit_stats":null,"previous_names":["conduktor/terraform-provider-conduktor"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conduktor%2Fterraform-provider-conduktor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conduktor%2Fterraform-provider-conduktor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conduktor%2Fterraform-provider-conduktor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conduktor%2Fterraform-provider-conduktor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/conduktor","download_url":"https://codeload.github.com/conduktor/terraform-provider-conduktor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244520144,"owners_count":20465627,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["conduktor","kafka","terraform-provider"],"created_at":"2025-03-19T22:52:11.819Z","updated_at":"2025-03-19T22:52:12.475Z","avatar_url":"https://github.com/conduktor.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca name=\"readme-top\" id=\"readme-top\"\u003e\u003c/a\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/conduktor/conduktor.io-public/main/logo/transparent.png\" width=\"256px\" /\u003e\n\u003c/p\u003e\n\u003ch1 align=\"center\"\u003e\n    \u003cstrong\u003eConduktor Terraform Provider\u003c/strong\u003e\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://docs.conduktor.io/\"\u003e\u003cstrong\u003eExplore the docs »\u003c/strong\u003e\u003c/a\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/conduktor/terraform-provider-conduktor/issues\"\u003eReport Bug\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/conduktor/terraform-provider-conduktor/issues\"\u003eRequest Feature\u003c/a\u003e\n    ·\n    \u003ca href=\"https://support.conduktor.io/\"\u003eContact support\u003c/a\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/conduktor/terraform-provider-conduktor/releases/latest\"\u003e\u003cimg alt=\"GitHub Release\" src=\"https://img.shields.io/github/v/release/conduktor/terraform-provider-conduktor?color=BCFE68\"\u003e\u003c/a\u003e\n    ·\n    \u003cimg alt=\"License\" src=\"https://img.shields.io/github/license/conduktor/terraform-provider-conduktor?color=BCFE68\"\u003e\n    ·\n    \u003ca href=\"https://registry.terraform.io/providers/conduktor/conduktor\"\u003e\u003cimg alt=\"Terraform registry\" src=\"https://img.shields.io/badge/Registry-Terraform-BCFE68\"\u003e\u003c/a\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://conduktor.io/\"\u003e\u003cimg src=\"https://img.shields.io/badge/Website-conduktor.io-192A4E?color=BCFE68\" alt=\"Scale Data Streaming With Security and Control\"\u003e\u003c/a\u003e\n    ·\n    \u003ca href=\"https://twitter.com/getconduktor\"\u003e\u003cimg alt=\"X (formerly Twitter) Follow\" src=\"https://img.shields.io/twitter/follow/getconduktor?color=BCFE68\"\u003e\u003c/a\u003e\n    ·\n    \u003ca href=\"https://conduktor.io/slack\"\u003e\u003cimg src=\"https://img.shields.io/badge/Slack-Join%20Community-BCFE68?logo=slack\" alt=\"Slack\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nThis repository contains the Conduktor Terraform provider, which defines Conduktor resources so that they can be deployed using Infrastructure as Code (IaC).\n\n\u003e [!WARNING]\n\u003e - The Conduktor Terraform provider is currently in **Alpha**.\n\u003e - It does not support all Console and Gateway resources yet. See our [resources roadmap](#resources-roadmap).\n\u003e - Let us know if you have [feedback](https://support.conduktor.io/hc/en-gb/requests/new?ticket_form_id=17438365654417) or wish to be a design partner.\n\n**Table of Contents**\n- [Supported resources](#supported-resources)\n- [Install](#install)\n- [Usage/Examples](#usageexamples)\n  - [Provider authentication](#provider-authentication)\n    - [Conduktor Console](#conduktor-console)\n        - [API key](#api-key)\n        - [Admin credentials](#admin-credentials)\n    - [Conduktor Gateway](#conduktor-gateway)\n        - [Admin credentials](#admin-credentials-2)\n  - [Multi client configuration](#multi-client-configuration)\n- [Development](#development)\n  - [Requirements](#requirements)\n  - [Install git hooks](#install-git-hooks)\n  - [Building The Provider](#building-the-provider)\n    - [Build and install provider in local Terraform registry](#build-and-install-provider-in-local-terraform-registry)\n  - [Adding Dependencies](#adding-dependencies)\n  - [Codegen](#codegen)\n  - [Run acceptance tests](#run-acceptance-tests)\n  - [Misc](#misc)\n- [Resources Roadmap](#resources-roadmap)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Supported resources\n\n### Console resources\n\n- [Console user](./docs/resources/console_user_v2.md)\n- [Console group](./docs/resources/console_group_v2.md)\n- [Kafka clusters with schema registry](./docs/resources/console_kafka_cluster_v2.md)\n- [Kafka connect server](./docs/resources/console_kafka_connect_v2.md)\n\n### Gateway resources\n\n- [Gateway service account](./docs/resources/gateway_service_account_v2.md)\n- [Gateway interceptor](./docs/resources/gateway_interceptor_v2.md)\n\n### Self-service resources\n\n- [Console application](./docs/resources/console_application_v1.md)\n- [Console application instance](./docs/resources/console_application_instance_v1.md)\n- [Topic policy](./docs/resources/console_topic_policy_v1.md)\n\n### Kafka resources\n- [Topic](./docs/resources/console_topic_v2.md)\n\n### Generic resource\n\n- [Generic](./docs/resources/generic.md) :warning: This resource is experimental and should be used with care.\n\n## Install\n\nProvider should be installed automatically with `terraform init`, but it's recommended to pin a specific version or range of versions using the following [`required_providers` configuration](https://developer.hashicorp.com/terraform/language/providers/requirements) :\n\n```hcl\nterraform {\n  required_providers {\n    conduktor = {\n        source = \"conduktor/conduktor\"\n        version = \"~\u003e X.Y\" # where X.Y is the current major version and minor version\n    }\n  }\n}\n```\n\n## Usage/Examples\n\n\n```hcl\n# configure provider\nprovider \"conduktor\" {\n  mode        = \"console\"\n  base_url    = \"http://localhost:8080\"\n  api_token   = \"your-api-key\" # can also use admin email/password to authenticate.\n}\n\n# register an external user bob with PLATFORM.userView permission\nresource \"conduktor_console_user_v2\" \"bob\" {\n  name = \"bob@mycompany.io\"\n  spec = {\n    firstname = \"Bob\"\n    lastname  = \"Smith\"\n    permissions = [\n      {\n        permissions = [ \"userView\" ]\n        resource_type = \"PLATFORM\"\n      },\n    ]\n  }\n}\n\n# create a group with Bob as a member\nresource \"conduktor_console_group_v2\" \"qa\" {\n  name = \"qa\"\n  spec = {\n    display_name                 = \"QA team\"\n    description                  = \"Quality Assurance team\"\n    members                      = [ conduktor_user_v2.bob.name ]\n    permissions = [\n      {\n        resource_type = \"PLATFORM\"\n        permissions   = [\"userView\", \"clusterConnectionsManage\"]\n      }\n    ]\n  }\n}\n```\n\nYou can find more examples in this repository inside [`example`](./examples/) directory.\n\nExamples can also be found in provider reference documentation available either in [`docs`](./docs/) directory or at [registry.terraform.io/conduktor/conduktor](https://registry.terraform.io/conduktor/conduktor/latest/docs)\n\nYou can also check out our [documentation](https://docs.conduktor.io/) for resources reference and provider usage.\n\n### Provider authentication\n\n\u003e [!IMPORTANT]\n\u003e It is required to specify the provider `mode` to use, as it will determine the authentication method.\n\nThe provider can be used in two modes: `console` and `gateway`.\n\nExample using console mode:\n```hcl\nprovider \"conduktor\" {\n  mode = \"console\"\n  # ...\n}\n```\n\n#### Conduktor Console\n\nTo use Conduktor Console API, the Terraform provider needs to authenticate against it.\n\nFor that we offer two possibilities:\n\n##### API key\n\nUse an already manually forged API key. See [documentation](https://docs.conduktor.io/platform/reference/api-reference/#generate-an-api-key) to create one.\n\nUsing HCL `api_token` attribute\n```hcl\nprovider \"conduktor\" {\n  mode      = \"console\"\n  api_token = \"your-api-key\"\n}\n```\nUsing environment variables `CDK_API_TOKEN` or `CDK_API_KEY`.\n\n##### Admin credentials\nUse local user (usually admin) credentials pair. This will login against the API and use an ephemeral access token to make API calls.\n\n\nUsing HCL `admin_user`/`admin_password` attributes\n```hcl\nprovider \"conduktor\" {\n  mode           = \"console\"\n  admin_user     = \"admin@my-org.com\"\n  admin_password = \"admin-password\"\n}\n```\nUsing environment variables `CDK_ADMIN_EMAIL` or `CDK_ADMIN_PASSWORD`.\n\nEither way be aware that API Key and admin credentials are sensitive data and should be stored and provided to Terraform [properly](https://developer.hashicorp.com/terraform/tutorials/configuration-language/sensitive-variables).\n\n#### Conduktor Gateway\n\nTo use Conduktor Gateway API, the Terraform provider needs to authenticate against it.\n\n##### Admin credentials\nUse local user (usually admin) credentials pair. Those will be used in the authentication header for the HTTP requests against the API.\n\nUsing HCL `admin_user`/`admin_password` attributes\n```hcl\nprovider \"conduktor\" {\n  mode           = \"gateway\"\n  admin_user     = \"admin@my-org.com\"\n  admin_password = \"admin-password\"\n}\n```\nUsing environment variables `CDK_ADMIN_EMAIL` or `CDK_ADMIN_PASSWORD`.\n\n### Multi client configuration\n\nConduktor provider can also be configured to use multiple clients, each with its own authentication method.\n\nFor this we will make use of the `alias` attribute in the provider definition. Further information can be found on the official [Terraform Documentation](https://developer.hashicorp.com/terraform/language/providers/configuration#alias-multiple-provider-configurations).\n\n```hcl\nprovider \"conduktor\" {\n  alias    = \"console\"\n  mode     = \"console\"\n  # ...\n}\n\nprovider \"conduktor\" {\n  alias    = \"gateway\"\n  mode     = \"gateway\"\n  # ...\n}\n```\n\nYou will also need to specify the provider alias when defining resources.\n``` hcl\nresource \"conduktor_console_user_v2\" \"user\" {\n  provider = conduktor.console\n  # ...\n}\n\nresource \"conduktor_gateway_service_account_v2\" \"gateway_sa\" {\n  provider = conduktor.gateway\n  # ...\n}\n```\n\n## Development\n### Requirements\n\n- [Terraform](https://developer.hashicorp.com/terraform/downloads) \u003e= 1.0\n- [Go](https://golang.org/doc/install) \u003e= 1.23\n- [Docker](https://docs.docker.com/get-docker/) with compose to run acceptance tests locally\n- [Git hooks](#install-git-hooks) to format/lint code before committing\n\n\n### Install git hooks\nPlease install the git hooks to ensure that the code is formatted correctly and pass linter check before committing.\n\nRun `make install-githooks` to install the git hooks.\n\n### Building The Provider\n\n1. Clone the repository\n1. Enter the repository directory\n1. Build the provider using the Go `install` command:\n\n```shell\ngo install\n```\n\n#### Build and install provider in local Terraform registry\n\nWill build and install terraform provider locally in `~/.terraform.d/plugins` directory.\nLocal provider version is set on `VERSION` variable of [GNUmakefile](./GNUmakefile)\n\n```shell\nVERSION=0.0.1 make deploy-locally\n```\nIt can then be used on terraform recipe like\n```hcl\nterraform {\n  required_providers {\n    conduktor = {\n      source  = \"terraform.local/conduktor/conduktor\" # local provider\n      version = \"\u003e= 0.0.1\"                            # latest version found locally in the plugin cache.\n    }\n  }\n}\n```\n\n### Adding Dependencies\n\nThis provider uses [Go modules](https://github.com/golang/go/wiki/Modules).\nPlease see the Go documentation for the most up to date information about using Go modules.\n\nTo add a new dependency `github.com/author/dependency` to your Terraform provider:\n\n```shell\ngo get github.com/author/dependency\ngo mod tidy\n```\n\nThen commit the changes to `go.mod` and `go.sum`.\n\n### Codegen\n\nThe project uses different codegen tool to generate source files.\n\n**Documentation** in [`docs`](./docs/) folder is generated using [tfplugindocs](https://github.com/hashicorp/terraform-plugin-docs).\n\n**Terraform schema definition** in [`schema`](./internal/schema/) module are generated using [tfplugingen-framework](https://github.com/hashicorp/terraform-plugin-codegen-framework) from currently manually maintained code spec [json file](./provider_code_spec.json).\n\n### Run acceptance tests\n\n```shell\n# Optional\nexport CDK_LICENSE=\"your_license_here\"\nmake testacc\n```\nThis action will start a testing environment using [Docker Compose](./docker-compose.yaml) and run all acceptance tests against it. Test environment is destroyed at the end.\n\nYou can also start/stop environment and run tests in separate actions using `make start_test_env` / `make test` / `make clean`.\n\n### Misc\n\n```shell\nmake generate   # run go generate\nmake build      # run build\nmake go-fmt     # run go fmt on the project\nmake go-lint    # run golangci-lint linter\n```\n\n## Resources Roadmap\n\nFuture versions of the Conduktor Terraform provider will evolve to support more resources.\n\nNeed a resource to unblock a use case? [Feedback](https://support.conduktor.io/hc/en-gb/requests/new?ticket_form_id=17438365654417) to the Product team directly.\n\nWe are currently reviewing the following resources:\n\n1. Console resources:\n  - [KsqlDBCluster](https://docs.conduktor.io/platform/reference/resource-reference/console/#ksqldbcluster)\n  - [Alert](https://docs.conduktor.io/platform/reference/resource-reference/console/#alert)\n2. Kafka resources:\n  - [Subject](https://docs.conduktor.io/platform/reference/resource-reference/kafka/#subject)\n  - [Connector](https://docs.conduktor.io/platform/reference/resource-reference/kafka/#connector)\n3. Self-service resources:\n  - [ApplicationInstancePermission](https://docs.conduktor.io/platform/reference/resource-reference/self-service/#application-instance-permissions)\n  - [ApplicationGroup](https://docs.conduktor.io/platform/reference/resource-reference/self-service/#application-group)\n4. Gateway resources:\n  - [GatewayGroup](https://docs.conduktor.io/gateway/reference/resources-reference/#gatewaygroup)\n  - [ConcentrationRule](https://docs.conduktor.io/gateway/reference/resources-reference/#concentrationrule)\n  - [VirtualCluster](https://docs.conduktor.io/gateway/reference/resources-reference/#virtualcluster)\n  - [AliasTopic](https://docs.conduktor.io/gateway/reference/resources-reference/#aliastopic)\n\n\u003e [!NOTE]\n\u003e\n\u003e This list is not exhaustive and can change depending on requests and needs.\n\n## Contributing\n\nPlease read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## License\n\nThis project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconduktor%2Fterraform-provider-conduktor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconduktor%2Fterraform-provider-conduktor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconduktor%2Fterraform-provider-conduktor/lists"}