|
|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
---
|
|
|
|
|
layout: "enterprise"
|
|
|
|
|
page_title: "Managing Artifact Versions"
|
|
|
|
|
page_title: "Managing Versions - Artifacts - Terraform Enterprise"
|
|
|
|
|
sidebar_current: "docs-enterprise-artifacts-versions"
|
|
|
|
|
description: |-
|
|
|
|
|
Artifacts are versioned and assigned a version number, here is how to manage the versions.
|
|
|
|
|
@ -8,9 +8,9 @@ description: |-
|
|
|
|
|
|
|
|
|
|
# Managing Artifact Versions
|
|
|
|
|
|
|
|
|
|
Artifacts stored in Terraform Enterprise are versioned and assigned a version number.
|
|
|
|
|
Versions are useful to roll back, audit and deploy images specific versions
|
|
|
|
|
of images to certain environments in a targeted way.
|
|
|
|
|
Artifacts stored in Terraform Enterprise are versioned and assigned a version
|
|
|
|
|
number. Versions are useful to roll back, audit and deploy images specific
|
|
|
|
|
versions of images to certain environments in a targeted way.
|
|
|
|
|
|
|
|
|
|
This assumes you are familiar with the [artifact provider](https://terraform.io/docs/providers/atlas/index.html)
|
|
|
|
|
in Terraform.
|
|
|
|
|
@ -24,14 +24,16 @@ be used to use the latest version of the artifact.
|
|
|
|
|
|
|
|
|
|
The following output is from `terraform show`.
|
|
|
|
|
|
|
|
|
|
atlas_artifact.web-worker:
|
|
|
|
|
id = us-east-1:ami-3a0a1d52
|
|
|
|
|
build = latest
|
|
|
|
|
metadata_full.# = 1
|
|
|
|
|
metadata_full.region-us-east-1 = ami-3a0a1d52
|
|
|
|
|
name = %{DEFAULT_USERNAME}/web-worker
|
|
|
|
|
slug = %{DEFAULT_USERNAME}/web-worker/amazon.image/7
|
|
|
|
|
type = amazon.image
|
|
|
|
|
```text
|
|
|
|
|
atlas_artifact.web-worker:
|
|
|
|
|
id = us-east-1:ami-3a0a1d52
|
|
|
|
|
build = latest
|
|
|
|
|
metadata_full.# = 1
|
|
|
|
|
metadata_full.region-us-east-1 = ami-3a0a1d52
|
|
|
|
|
name = my-username/web-worker
|
|
|
|
|
slug = my-username/web-worker/amazon.image/7
|
|
|
|
|
type = amazon.image
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
In this case, the version is 7 and can be found in the persisted slug
|
|
|
|
|
attribute.
|
|
|
|
|
@ -41,11 +43,13 @@ attribute.
|
|
|
|
|
You can pin artifacts to a specific version. This allows for a targeted
|
|
|
|
|
deploy.
|
|
|
|
|
|
|
|
|
|
resource "atlas_artifact" "web-worker" {
|
|
|
|
|
name = "%{DEFAULT_USERNAME}/web-worker"
|
|
|
|
|
type = "amazon.image"
|
|
|
|
|
version = 7
|
|
|
|
|
}
|
|
|
|
|
```hcl
|
|
|
|
|
resource "atlas_artifact" "web-worker" {
|
|
|
|
|
name = "my-username/web-worker"
|
|
|
|
|
type = "amazon.image"
|
|
|
|
|
version = 7
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
This will use version 7 of the `web-worker` artifact.
|
|
|
|
|
|
|
|
|
|
@ -54,12 +58,13 @@ This will use version 7 of the `web-worker` artifact.
|
|
|
|
|
Artifacts can also be pinned to an Terraform build number. This is only
|
|
|
|
|
possible if Terraform Enterprise was used to build the artifact with Packer.
|
|
|
|
|
|
|
|
|
|
resource "atlas_artifact" "web-worker" {
|
|
|
|
|
name = "%{DEFAULT_USERNAME}/web-worker"
|
|
|
|
|
type = "amazon.image"
|
|
|
|
|
build = 5
|
|
|
|
|
}
|
|
|
|
|
```hcl
|
|
|
|
|
resource "atlas_artifact" "web-worker" {
|
|
|
|
|
name = "my-username/web-worker"
|
|
|
|
|
type = "amazon.image"
|
|
|
|
|
build = 5
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
It's recommended to use versions, instead of builds, as it will
|
|
|
|
|
be easier to track when building outside of the Terraform Enterprise
|
|
|
|
|
environment.
|
|
|
|
|
It's recommended to use versions, instead of builds, as it will be easier to
|
|
|
|
|
track when building outside of the Terraform Enterprise environment.
|
|
|
|
|
|