2017-02-15 19:47:30 +01:00
|
|
|
---
|
2021-12-15 03:41:17 +01:00
|
|
|
page_title: 'Backend Type: artifactory'
|
|
|
|
description: Terraform can store state in artifactory.
|
2017-02-15 19:47:30 +01:00
|
|
|
---
|
|
|
|
|
|
|
|
# artifactory
|
|
|
|
|
2017-02-15 21:19:38 +01:00
|
|
|
Stores the state as an artifact in a given repository in
|
|
|
|
[Artifactory](https://www.jfrog.com/artifactory/).
|
2017-02-15 19:47:30 +01:00
|
|
|
|
|
|
|
Generic HTTP repositories are supported, and state from different
|
|
|
|
configurations may be kept at different subpaths within the repository.
|
|
|
|
|
|
|
|
-> **Note:** The URL must include the path to the Artifactory installation.
|
|
|
|
It will likely end in `/artifactory`.
|
|
|
|
|
2021-12-15 03:41:17 +01:00
|
|
|
This backend does **not** support [state locking](/language/state/locking).
|
2021-12-07 22:07:22 +01:00
|
|
|
|
2017-02-15 21:19:38 +01:00
|
|
|
## Example Configuration
|
2017-02-15 19:47:30 +01:00
|
|
|
|
2017-04-05 17:29:27 +02:00
|
|
|
```hcl
|
2017-02-15 21:19:38 +01:00
|
|
|
terraform {
|
|
|
|
backend "artifactory" {
|
|
|
|
username = "SheldonCooper"
|
|
|
|
password = "AmyFarrahFowler"
|
|
|
|
url = "https://custom.artifactoryonline.com/artifactory"
|
|
|
|
repo = "foo"
|
2019-07-16 00:16:56 +02:00
|
|
|
subpath = "terraform-bar"
|
2017-02-15 21:19:38 +01:00
|
|
|
}
|
|
|
|
}
|
2017-02-15 19:47:30 +01:00
|
|
|
```
|
|
|
|
|
2020-02-19 01:40:14 +01:00
|
|
|
## Data Source Configuration
|
2017-02-15 19:47:30 +01:00
|
|
|
|
2017-04-05 17:29:27 +02:00
|
|
|
```hcl
|
2017-02-15 19:47:30 +01:00
|
|
|
data "terraform_remote_state" "foo" {
|
2017-04-05 17:29:27 +02:00
|
|
|
backend = "artifactory"
|
2018-10-29 17:22:21 +01:00
|
|
|
config = {
|
2017-04-05 17:29:27 +02:00
|
|
|
username = "SheldonCooper"
|
|
|
|
password = "AmyFarrahFowler"
|
|
|
|
url = "https://custom.artifactoryonline.com/artifactory"
|
|
|
|
repo = "foo"
|
|
|
|
subpath = "terraform-bar"
|
|
|
|
}
|
2017-02-15 19:47:30 +01:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Configuration variables
|
|
|
|
|
|
|
|
The following configuration options / environment variables are supported:
|
|
|
|
|
2021-12-15 03:41:17 +01:00
|
|
|
- `username` / `ARTIFACTORY_USERNAME` (Required) - The username
|
|
|
|
- `password` / `ARTIFACTORY_PASSWORD` (Required) - The password
|
|
|
|
- `url` / `ARTIFACTORY_URL` (Required) - The URL. Note that this is the base url to artifactory not the full repo and subpath.
|
|
|
|
- `repo` (Required) - The repository name
|
|
|
|
- `subpath` (Required) - Path within the repository
|