Code Monkey home page Code Monkey logo

terraform-provider-ccloud's Introduction

Terraform Provider

This is an unofficial (therefore, unsupported) implementation of Confluent Cloud Terraform provider. It is intended to aid developers in the creation of immutable software architectures relying on Confluent Cloud for everything related to Apache Kafka.

Important: this project has no relationship with Confluent and will not be supported but any means. Use this code at your own risk and treat it as if it was your own code. Eventually, Confluent will release a official Terraform provider for Confluent Cloud, which will be registered within Terraform Registry.

Requirements

  • Terraform 0.12+
  • Go 1.13 (to build the provider plugin)

Building the Provider

In order to use the provider you first have to build it. Then you must install the native executable generated either in the same folder where your .tf files reside or installing it as a plugin as explained here.

make install

Once you have done this, you can run terraform init to initialize your project.

Examples

Creating a Kafka cluster in an existing environment:

provider "ccloud" {
  username = "<YOUR_CCLOUD_USERNAME>"
  password = "<YOUR_CCLOUD_PASSWORD>"
}

data "ccloud_environment" "existing_env" {
  name = "your-env-name"
}

resource "ccloud_cluster" "new_cluster" {
  environment_id = data.ccloud_environment.existing_env.id
  name = "new-cluster"
  cloud_provider = "azure"
  cloud_region = "westus2"
}

output "bootstrap_server" {
  value = ccloud_cluster.new_cluster.cluster_endpoint
}

Creating an environment and then creating two Kafka clusters on it:

provider "ccloud" {
  username = "<YOUR_CCLOUD_USERNAME>"
  password = "<YOUR_CCLOUD_PASSWORD>"
}

resource "ccloud_environment" "new_env" {
  name = "new-env-name"
}

resource "ccloud_cluster" "cluster_1" {
  environment_id = data.ccloud_environment.new_env.id
  name = "cluster-1"
  cloud_provider = "azure"
  cloud_region = "westus2"
}

resource "ccloud_cluster" "cluster_2" {
  environment_id = data.ccloud_environment.new_env.id
  name = "cluster-2"
  cloud_provider = "azure"
  cloud_region = "westus2"
}

Creating an environment, a Kafka cluster, and an API Key for usage:

provider "ccloud" {
  username = "<YOUR_CCLOUD_USERNAME>"
  password = "<YOUR_CCLOUD_PASSWORD>"
}

resource "ccloud_environment" "new_env" {
  name = "new-env-name"
}

resource "ccloud_cluster" "new_cluster" {
  environment_id = data.ccloud_environment.new_env.id
  name = "new-cluster"
  cloud_provider = "azure"
  cloud_region = "westus2"
}

resource "ccloud_apikey" "new_apikey" {
  environment_id = ccloud_environment.new_env.id
  cluster_id = ccloud_cluster.new_cluster.id
}

output "bootstrap_server" {
  value = ccloud_cluster.new_cluster.cluster_endpoint
}

output "api_key" {
  value = ccloud_apikey.new_apikey.key
}

output "api_secret" {
  value = ccloud_apikey.new_apikey.secret
}

terraform-provider-ccloud's People

Contributors

riferrei avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.