diff --git a/README.md b/README.md index 87754b8a0..4f087aad7 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,13 @@ Using this flow is less secure since the token is long-lived. You can provide th ## Backend configuration -To keep track of your terraform state, you can configure an [S3 backend](https://developer.hashicorp.com/terraform/language/settings/backends/s3) using [STACKIT Object Storage](https://docs.stackit.cloud/products/storage/object-storage). +### S3 Backend + +> [!WARNING] +> As of now setting `use_lockfile=true` for the S3 Backend will have no effect when using STACKIT Object Storage S3 buckets. +> If you want to make use of Terraforms state locking feature refer to the PostgreSQL backend described below. + +To keep track of your Terraform state, you can configure an [S3 backend](https://developer.hashicorp.com/terraform/language/settings/backends/s3) using [STACKIT Object Storage](https://docs.stackit.cloud/products/storage/object-storage). To do so, you need an Object Storage [S3 bucket](https://docs.stackit.cloud/products/storage/object-storage/basics/concepts/#buckets) and [credentials](https://docs.stackit.cloud/products/storage/object-storage/basics/concepts/#credentials) to access it. If you need to create them, check [Create and delete Object Storage buckets](https://docs.stackit.cloud/products/storage/object-storage/how-tos/create-and-manage-object-storage-buckets/) and [Create and delete Object Storage credentials](https://docs.stackit.cloud/products/storage/object-storage/how-tos/create-and-delete-object-storage-credentials/). @@ -149,6 +155,10 @@ terraform { Note: AWS specific checks must be skipped as they do not work on STACKIT. For details on what those validations do, see [here](https://developer.hashicorp.com/terraform/language/settings/backends/s3#configuration). +### PostgreSQL Backend + +See this [example](https://professional-service.git.onstackit.cloud/professional-service-best-practices/professional-service/src/branch/main/examples/terraform-pg-backend-state-locking) how to use a STACKIT PostgreSQL instance for your Terraform state with state locking. + ## Opting into Beta Resources To use beta resources in the STACKIT Terraform provider, follow these steps: diff --git a/docs/index.md b/docs/index.md index 6c70386bc..45110c0c4 100644 --- a/docs/index.md +++ b/docs/index.md @@ -132,13 +132,17 @@ To configure the key flow, follow these steps: # Backend configuration -To keep track of your terraform state, you can configure an [S3 backend](https://developer.hashicorp.com/terraform/language/settings/backends/s3) using [STACKIT Object Storage](https://docs.stackit.cloud/products/storage/object-storage). +## S3 Backend + +~> As of now setting `use_lockfile=true` for the S3 Backend will have no effect when using STACKIT Object Storage S3 buckets. If you want to make use of Terraforms state locking feature refer to the PostgreSQL backend described below. + +To keep track of your Terraform state, you can configure an [S3 backend](https://developer.hashicorp.com/terraform/language/settings/backends/s3) using [STACKIT Object Storage](https://docs.stackit.cloud/products/storage/object-storage). To do so, you need an Object Storage [S3 bucket](https://docs.stackit.cloud/products/storage/object-storage/basics/concepts/#buckets) and [credentials](https://docs.stackit.cloud/products/storage/object-storage/basics/concepts/#credentials) to access it. If you need to create them, check [Create and delete Object Storage buckets](https://docs.stackit.cloud/products/storage/object-storage/how-tos/create-and-manage-object-storage-buckets/) and [Create and delete Object Storage credentials](https://docs.stackit.cloud/products/storage/object-storage/how-tos/create-and-delete-object-storage-credentials/). -Once you have everything setup, you can configure the backend by adding the following block to your terraform configuration: +Once you have everything setup, you can configure the backend by adding the following block to your Terraform configuration: -``` +```hcl terraform { backend "s3" { bucket = "BUCKET_NAME" @@ -158,6 +162,10 @@ terraform { ``` Note: AWS specific checks must be skipped as they do not work on STACKIT. For details on what those validations do, see [here](https://developer.hashicorp.com/terraform/language/settings/backends/s3#configuration). + +## PostgreSQL Backend + +See this [example](https://professional-service.git.onstackit.cloud/professional-service-best-practices/professional-service/src/branch/main/examples/terraform-pg-backend-state-locking) how to use a STACKIT PostgreSQL instance for your Terraform state with state locking. ## Schema diff --git a/templates/index.md.tmpl b/templates/index.md.tmpl index 09c85782b..49efdacee 100644 --- a/templates/index.md.tmpl +++ b/templates/index.md.tmpl @@ -96,13 +96,17 @@ To configure the key flow, follow these steps: # Backend configuration -To keep track of your terraform state, you can configure an [S3 backend](https://developer.hashicorp.com/terraform/language/settings/backends/s3) using [STACKIT Object Storage](https://docs.stackit.cloud/products/storage/object-storage). +## S3 Backend + +~> As of now setting `use_lockfile=true` for the S3 Backend will have no effect when using STACKIT Object Storage S3 buckets. If you want to make use of Terraforms state locking feature refer to the PostgreSQL backend described below. + +To keep track of your Terraform state, you can configure an [S3 backend](https://developer.hashicorp.com/terraform/language/settings/backends/s3) using [STACKIT Object Storage](https://docs.stackit.cloud/products/storage/object-storage). To do so, you need an Object Storage [S3 bucket](https://docs.stackit.cloud/products/storage/object-storage/basics/concepts/#buckets) and [credentials](https://docs.stackit.cloud/products/storage/object-storage/basics/concepts/#credentials) to access it. If you need to create them, check [Create and delete Object Storage buckets](https://docs.stackit.cloud/products/storage/object-storage/how-tos/create-and-manage-object-storage-buckets/) and [Create and delete Object Storage credentials](https://docs.stackit.cloud/products/storage/object-storage/how-tos/create-and-delete-object-storage-credentials/). -Once you have everything setup, you can configure the backend by adding the following block to your terraform configuration: +Once you have everything setup, you can configure the backend by adding the following block to your Terraform configuration: -``` +```hcl terraform { backend "s3" { bucket = "BUCKET_NAME" @@ -122,4 +126,8 @@ terraform { ``` Note: AWS specific checks must be skipped as they do not work on STACKIT. For details on what those validations do, see [here](https://developer.hashicorp.com/terraform/language/settings/backends/s3#configuration). + +## PostgreSQL Backend + +See this [example](https://professional-service.git.onstackit.cloud/professional-service-best-practices/professional-service/src/branch/main/examples/terraform-pg-backend-state-locking) how to use a STACKIT PostgreSQL instance for your Terraform state with state locking. {{ .SchemaMarkdown | trimspace }}