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.
-
Create a file named
main.tf
and add the following:Loading...
-
Create a file named
variables.tf
and add the following:Loading...
-
Create the
terraform.tfvars
file and assign values to the variables for the token and the project names.
To apply your Terraform configuration:
-
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!
... -
To create an execution plan and preview the changes, run:
terraform plan
-
To deploy your changes, run:
terraform apply --auto-approve
Next steps
- Follow an example to set up your own organization with a user group and permissions.
- Try one of the other examples to learn how to create a service or integration using the Aiven Terraform Provider.
- Get details about all the available resources and data sources in the Aiven Provider for Terraform documentation.