Skip to main content

Aiven Provider for Terraform

Use the Aiven Provider for Terraform to provision and manage your Aiven infrastructure.

Get started

The Aiven Platform uses organizations, organizational units, and projects to organize services. This example shows you how to use the Aiven Provider for Terraform to create an organization with two organizational units, and add projects to those units. The following example file is also available in the Aiven Terraform Provider repository on GitHub.

  1. Sign up for Aiven.

  2. Download and install Terraform.

  3. Create a token.

  4. Create a file named main.tf and add the following:

    Loading...
  5. Create a file named variables.tf and add the following:

    Loading...
  6. Create the terraform.tfvars file and assign values to the variables for the token and the project names.

To apply your Terraform configuration:

  1. Initialize Terraform by running:

    terraform init

    The output is similar to the following:


    Initializing the backend...

    Initializing provider plugins...
    - Finding aiven/aiven versions matching ">= 4.0.0, < 5.0.0"...
    - Installing aiven/aiven v4.9.2...
    - Installed aiven/aiven v4.9.2
    ...
    Terraform has been successfully initialized!
    ...
  2. To create an execution plan and preview the changes, run:

    terraform plan
  3. To deploy your changes, run:

    terraform apply --auto-approve

Next steps