Skip to content

Commit

Permalink
Add a snippet of using Artifactory as the Terraform Backend
Browse files Browse the repository at this point in the history
  • Loading branch information
eldada committed Nov 15, 2024
1 parent f0da4c0 commit 500efa1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions 2.kubernetes-nginx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ The work here assumes you have a Kubernetes cluster with `kubectl` installed and

The [main.tf](main.tf) file has the configuration that Terraform will use to create the Nginx in the Kubernetes cluster.

This example also has a commented out snippet of using Artifactory as the [Terraform backend](https://jfrog.com/help/r/jfrog-artifactory-documentation/terraform-backend-repository).

1. Initialize the Terraform configuration by running the following command
```shell
terraform init
Expand Down
20 changes: 20 additions & 0 deletions 2.kubernetes-nginx/main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
terraform {
## Configure the remote backend (Artifactory)
## This will store the state file in Artifactory.
## Follow https://jfrog.com/help/r/jfrog-artifactory-documentation/terraform-backend-repository
# backend "remote" {
# hostname = "eldada.jfrog.io"
# organization = "terraform-backend"
# workspaces {
# prefix = "demo-"
# }
# }

required_providers {
# Kubernetes provider
kubernetes = {
source = "hashicorp/kubernetes"
}
}
}

provider "kubernetes" {
config_path = "~/.kube/config"
}
Expand Down

0 comments on commit 500efa1

Please sign in to comment.