You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guides/applications/configuration-management/terraform/how-to-build-your-infrastructure-using-terraform-and-linode/index.md
+28-2Lines changed: 28 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: 'This article gives you step-by-step instructions on how to use Ter
@@ -676,4 +676,30 @@ Create a deployment for an imaginary client:
676
676
terraform init
677
677
terraform plan
678
678
terraform apply
679
-
```
679
+
```
680
+
681
+
### Use Linode Object Storage to Store State
682
+
683
+
[State](https://developer.hashicorp.com/terraform/language/state) data files are stored on a [backend](https://developer.hashicorp.com/terraform/language/settings/backends/configuration) by Terraform to log and track metadata, map resources to a configuration, and improve performance. By default, state is stored locally in the `terraform.tfstate` file.
684
+
685
+
Using the configuration below with the `backend` block, you can set up Terraform to use Linode Object Storage to store state remotely. The `backend` block should be nested within the `terraform` block as noted in [Hashicorp's official backend documentation](https://developer.hashicorp.com/terraform/language/settings/backends/s3). In this guide, the `terraform` block is located in the `main.tf` configuration file.
686
+
687
+
Note that this module assumes an object storage bucket already exists on your account. Replace values with your bucket and key information:
688
+
689
+
```file {title="obj-backend.tf"}
690
+
# Backend Configuration
691
+
backend "s3" {
692
+
bucket = "{{< placeholder "YOUR-BUCKET-NAME" >}}" # The bucket name created on your account to which your access_key and secret_key can read and write
693
+
key = "{{< placeholder "tf/tfstate" >}}" # The folder ({{< placeholder "tf" >}}) and object ({{< placeholder "tfstate" >}}) in your bucket where you want to write state to
694
+
region = "{{< placeholder "us-southeast-1" >}}" # The region where your object storage bucket is at which is the same as the ClusterID Here https://techdocs.akamai.com/cloud-computing/docs/access-buckets-and-files-through-urls#cluster-url-s3-endpoint
695
+
access_key = "{{< placeholder "OBJ-ACCESS-KEY" >}}" # You can put your value here inline or add it as an environment variable AWS_ACCESS_KEY_ID see more here https://developer.hashicorp.com/terraform/language/settings/backends/s3#credentials-and-shared-configuration
696
+
secret_key = "{{< placeholder "OBJ-SECRET-KEY" >}}" # You can put your value here inline or add it as an environment variable AWS_SECRET_ACCESS_KEY see more here https://developer.hashicorp.com/terraform/language/settings/backends/s3#credentials-and-shared-configuration
697
+
skip_region_validation = true # All of these skip_* arguements are used since our object storage doesn't implement these additional endpoints
698
+
skip_credentials_validation =true
699
+
skip_requesting_account_id =true
700
+
skip_s3_checksum =true
701
+
endpoints = {
702
+
s3 = "{{< placeholder "https://us-southeast-1.linodeobjects.com" >}}"# The endpoint for the s3 API based on the region your bucket is located https://techdocs.akamai.com/cloud-computing/docs/access-buckets-and-files-through-urls#cluster-url-s3-endpoint
Copy file name to clipboardExpand all lines: docs/guides/applications/configuration-management/terraform/how-to-use-terraform-with-linode-object-storage/index.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ description: 'This guide provides a brief introduction to Terraform, and explain
## Configure Terraform to Store State on Linode Object Storage
469
+
470
+
Terraform uses [state](https://developer.hashicorp.com/terraform/language/state) on a [backend](https://developer.hashicorp.com/terraform/language/settings/backends/configuration) to log and track resource information. By default, state is stored locally in a file named `terraform.tfstate`.
471
+
472
+
For steps on how to use Linode Object Storage as a remote backend to store state, see our guide [Use Terraform to Provision Infrastructure on Linode](/docs/guides/how-to-build-your-infrastructure-using-terraform-and-linode/#use-linode-object-storage-to-store-state).
473
+
468
474
## Conclusion
469
475
470
476
Terraform is a powerful and efficient *Infrastructure as Code* (IaC) application. It automates the process of deploying infrastructure. To use Terraform, use the HCL or JSON formats to describe the final state of the network. Use the `terraform plan`command from the Terraform client to preview the changes and `terraform apply` to deploy the configuration.
@@ -58,7 +59,7 @@ Grafana supports a wide range of dashboards, including the Prometheus Node Expor
58
59
Grafana supports alerts, annotations, dashboard variables, plugins, and authentication. It also provides a range of analytics tools to further deconstruct the data. The Grafana web interface can be accessed using port `3000` of the host server. For best results, run Prometheus and Grafana on the same server. For more background information, see the [Introduction to Grafana](https://grafana.com/docs/grafana/latest/introduction/).
59
60
60
61
## Marketplace App
61
-
Installing a complete Prometheus and Grafana-based system is a multi-step process. To streamline deployments, you can use the [Prometheus and Grafana Marketplace App](/docs/guides/how-to-install-prometheus-and-grafana-on-ubuntu/). For a more traditional and hands-on deployment, follow the instructions below.
62
+
Installing a complete Prometheus and Grafana-based system is a multi-step process. To streamline deployments, you can use the [Prometheus and Grafana Marketplace App](https://www.linode.com/marketplace/apps/linode/prometheus-grafana/). For a more traditional and hands-on deployment, follow the instructions below.
0 commit comments