github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/website/source/docs/enterprise/artifacts/managing-versions.html.md (about) 1 --- 2 layout: "enterprise" 3 page_title: "Managing Versions - Artifacts - Terraform Enterprise" 4 sidebar_current: "docs-enterprise-artifacts-versions" 5 description: |- 6 Artifacts are versioned and assigned a version number, here is how to manage the versions. 7 --- 8 9 # Managing Artifact Versions 10 11 Artifacts stored in Terraform Enterprise are versioned and assigned a version 12 number. Versions are useful to roll back, audit and deploy images specific 13 versions of images to certain environments in a targeted way. 14 15 This assumes you are familiar with the [artifact provider](https://terraform.io/docs/providers/terraform-enterprise/index.html) 16 in Terraform. 17 18 ### Finding the Version of an Artifact 19 20 Artifact versions can be found with the [`terraform show` command](https://terraform.io/docs/commands/show.html), 21 or by looking at the Packer logs generated during builds. After a 22 successful artifact upload, version numbers are displayed. "latest" can 23 be used to use the latest version of the artifact. 24 25 The following output is from `terraform show`. 26 27 ```text 28 atlas_artifact.web-worker: 29 id = us-east-1:ami-3a0a1d52 30 build = latest 31 metadata_full.# = 1 32 metadata_full.region-us-east-1 = ami-3a0a1d52 33 name = my-username/web-worker 34 slug = my-username/web-worker/amazon.image/7 35 type = amazon.image 36 ``` 37 38 In this case, the version is 7 and can be found in the persisted slug 39 attribute. 40 41 ### Pinning Artifacts to Specific Versions 42 43 You can pin artifacts to a specific version. This allows for a targeted 44 deploy. 45 46 ```hcl 47 resource "atlas_artifact" "web-worker" { 48 name = "my-username/web-worker" 49 type = "amazon.image" 50 version = 7 51 } 52 ``` 53 54 This will use version 7 of the `web-worker` artifact. 55 56 ### Pinning Artifacts to Specific Builds 57 58 Artifacts can also be pinned to an Terraform build number. This is only 59 possible if Terraform Enterprise was used to build the artifact with Packer. 60 61 ```hcl 62 resource "atlas_artifact" "web-worker" { 63 name = "my-username/web-worker" 64 type = "amazon.image" 65 build = 5 66 } 67 ``` 68 69 It's recommended to use versions, instead of builds, as it will be easier to 70 track when building outside of the Terraform Enterprise environment.