Skip to content

Commit

Permalink
docs: add environment variables to main page
Browse files Browse the repository at this point in the history
  • Loading branch information
staceysalamon-aiven committed Mar 15, 2024
1 parent 8eca478 commit dbb336e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 34 deletions.
32 changes: 15 additions & 17 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Aiven Provider for Terraform
The Terraform provider for [Aiven](https://aiven.io/), an open source data platform as a service.
The Terraform provider for [Aiven](https://aiven.io/), the trusted open source data platform for everyone.

## Authentication token
[Sign up for Aiven](https://console.aiven.io/signup?utm_source=terraformregistry&utm_medium=organic&utm_campaign=terraform&utm_content=signup) and [create an authentication token](https://aiven.io/docs/platform/howto/create_authentication_token).
## Authentication
[Sign up for Aiven](https://console.aiven.io/signup?utm_source=terraformregistry&utm_medium=organic&utm_campaign=terraform&utm_content=signup) and [create a personal token](https://aiven.io/docs/platform/howto/create_authentication_token).

You can also create an [application user](https://aiven.io/docs/platform/howto/manage-application-users) and use its token for accessing the Aiven Provider.

## Example usage
_Only available for Terraform v0.13 and above. For older versions, see [here](guides/install-terraform-v012.md)._
For Terraform v0.13 and later:

```hcl
terraform {
Expand All @@ -21,23 +23,19 @@ provider "aiven" {
api_token = var.aiven_api_token
}
```
## Environment variables

Then, initialize your Terraform workspace by running `terraform init`.

The `api_token` is the only parameter for the provider configuration. Make sure the owner of the API Authentication Token has admin permissions in Aiven.

You can also set the environment variable `AIVEN_TOKEN` for the `api_token` property.

## More examples
Look at the [Sample Project Guide](guides/sample-project.md) and the [Examples Guide](guides/examples.md) for more examples on how to use the various Aiven resources.
* For authentication, you can set the `AIVEN_TOKEN` to your token value.
* To use beta resources, set `PROVIDER_AIVEN_ENABLE_BETA` to any value.
* To allow IP filters to be purged, set `AIVEN_ALLOW_IP_FILTER_PURGE` to any value. This feature prevents accidental purging of IP filters, which can cause you to lose access to services.

## Resource options
The list of options in this document is not comprehensive. However, most map directly to the [Aiven REST API](https://api.aiven.io/doc/) properties.

## A word of caution
Recreating stateful services with Terraform will possibly **delete** the service and all its data before creating it again. Whenever the Terraform plan indicates that a service will be **deleted** or **replaced**, a catastrophic action is possibly about to happen.
## Examples
Try the [sample project](guides/sample-project.md) or the [other examples](guides/examples.md) to learn how to use the Aiven resources.

Some properties, like **project** and the **resource name**, cannot be changed and it will trigger a resource replacement.
## Warning
Recreating a stateful service with Terraform may cause it to be recreated, meaning the service and all its data is **deleted** before being created again. Changing some properties, like project and resource name, triggers a replacement.

To avoid any issues, **please set the `termination_protection` property to `true` on all production services**, it will prevent Terraform to remove the service until the flag is set back to `false` again. While it prevents a service to be deleted, any logical databases, topics or other configurations may be removed **even when this section is enabled**. Be very careful!

To avoid losing data, **set the `termination_protection` property to `true` on all production services**. This prevents Terraform from deleting a service. However, logical databases, topics, and other configurations may still be removed even with this enabled. Always use `terraform plan` to check for actions that cause a service to be deleted or replaced.
32 changes: 15 additions & 17 deletions templates/index.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Aiven Provider for Terraform
The Terraform provider for [Aiven](https://aiven.io/), an open source data platform as a service.
The Terraform provider for [Aiven](https://aiven.io/), the trusted open source data platform for everyone.

## Authentication token
[Sign up for Aiven](https://console.aiven.io/signup?utm_source=terraformregistry&utm_medium=organic&utm_campaign=terraform&utm_content=signup) and [create an authentication token](https://aiven.io/docs/platform/howto/create_authentication_token).
## Authentication
[Sign up for Aiven](https://console.aiven.io/signup?utm_source=terraformregistry&utm_medium=organic&utm_campaign=terraform&utm_content=signup) and [create a personal token](https://aiven.io/docs/platform/howto/create_authentication_token).

You can also create an [application user](https://aiven.io/docs/platform/howto/manage-application-users) and use its token for accessing the Aiven Provider.

## Example usage
_Only available for Terraform v0.13 and above. For older versions, see [here](guides/install-terraform-v012.md)._
For Terraform v0.13 and later:

```hcl
terraform {
Expand All @@ -21,23 +23,19 @@ provider "aiven" {
api_token = var.aiven_api_token
}
```
## Environment variables

Then, initialize your Terraform workspace by running `terraform init`.

The `api_token` is the only parameter for the provider configuration. Make sure the owner of the API Authentication Token has admin permissions in Aiven.

You can also set the environment variable `AIVEN_TOKEN` for the `api_token` property.

## More examples
Look at the [Sample Project Guide](guides/sample-project.md) and the [Examples Guide](guides/examples.md) for more examples on how to use the various Aiven resources.
* For authentication, you can set the `AIVEN_TOKEN` to your token value.
* To use beta resources, set `PROVIDER_AIVEN_ENABLE_BETA` to any value.
* To allow IP filters to be purged, set `AIVEN_ALLOW_IP_FILTER_PURGE` to any value. This feature prevents accidental purging of IP filters, which can cause you to lose access to services.

## Resource options
The list of options in this document is not comprehensive. However, most map directly to the [Aiven REST API](https://api.aiven.io/doc/) properties.

## A word of caution
Recreating stateful services with Terraform will possibly **delete** the service and all its data before creating it again. Whenever the Terraform plan indicates that a service will be **deleted** or **replaced**, a catastrophic action is possibly about to happen.
## Examples
Try the [sample project](guides/sample-project.md) or the [other examples](guides/examples.md) to learn how to use the Aiven resources.

Some properties, like **project** and the **resource name**, cannot be changed and it will trigger a resource replacement.
## Warning
Recreating a stateful service with Terraform may cause it to be recreated, meaning the service and all its data is **deleted** before being created again. Changing some properties, like project and resource name, triggers a replacement.

To avoid any issues, **please set the `termination_protection` property to `true` on all production services**, it will prevent Terraform to remove the service until the flag is set back to `false` again. While it prevents a service to be deleted, any logical databases, topics or other configurations may be removed **even when this section is enabled**. Be very careful!

To avoid losing data, **set the `termination_protection` property to `true` on all production services**. This prevents Terraform from deleting a service. However, logical databases, topics, and other configurations may still be removed even with this enabled. Always use `terraform plan` to check for actions that cause a service to be deleted or replaced.

0 comments on commit dbb336e

Please sign in to comment.