github.com/kikitux/packer@v0.10.1-0.20160322154024-6237df566f9f/website/source/docs/post-processors/atlas.html.md (about) 1 --- 2 description: | 3 The Atlas post-processor for Packer receives an artifact from a Packer build and 4 uploads it to Atlas. Atlas hosts and serves artifacts, allowing you to version 5 and distribute them in a simple way. 6 layout: docs 7 page_title: 'Atlas Post-Processor' 8 ... 9 10 # Atlas Post-Processor 11 12 Type: `atlas` 13 14 The Atlas post-processor uploads artifacts from your packer builds to Atlas for 15 hosting. Artifacts hosted in Atlas are automatically made available for use 16 with Vagrant and Terraform, and Atlas provides additional features for managing 17 versions and releases. [Learn more about packer in 18 Atlas.](https://atlas.hashicorp.com/help/packer/features) 19 20 You can also use the push command to [run packer builds in 21 Atlas](/docs/command-line/push.html). The push command and Atlas post-processor 22 can be used together or independently. 23 24 ## Workflow 25 26 To take full advantage of Packer and Atlas, it's important to understand the 27 workflow for creating artifacts with Packer and storing them in Atlas using this 28 post-processor. The goal of the Atlas post-processor is to streamline the 29 distribution of public or private artifacts by hosting them in a central 30 location in Atlas. 31 32 Here is an example workflow: 33 34 1. Packer builds an AMI with the [Amazon AMI 35 builder](/docs/builders/amazon.html) 36 2. The `atlas` post-processor takes the resulting AMI and uploads it to Atlas. 37 The `atlas` post-processor is configured with the name of the AMI, for 38 example `hashicorp/foobar`, to create the artifact in Atlas or update the 39 version if the artifact already exists 40 3. The new version is ready and available to be used in deployments with a tool 41 like [Terraform](https://www.terraform.io) 42 43 ## Configuration 44 45 The configuration allows you to specify and access the artifact in Atlas. 46 47 ### Required: 48 49 - `token` (string) - Your access token for the Atlas API. 50 51 -> Login to Atlas to [generate an Atlas 52 Token](https://atlas.hashicorp.com/settings/tokens). The most convenient way to 53 configure your token is to set it to the `ATLAS_TOKEN` environment variable, but 54 you can also use `token` configuration option. 55 56 - `artifact` (string) - The shorthand tag for your artifact that maps to 57 Atlas, i.e `hashicorp/foobar` for `atlas.hashicorp.com/hashicorp/foobar`. 58 You must have access to the organization—hashicorp in this example—in order 59 to add an artifact to the organization in Atlas. 60 61 - `artifact_type` (string) - For uploading artifacts to Atlas. `artifact_type` 62 can be set to any unique identifier, however, the following are recommended 63 for consistency - `amazon.image`, `digitalocean.image`, `docker.image`, 64 `googlecompute.image`, `openstack.image`, `parallels.image`, `qemu.image`, 65 `virtualbox.image`, `vmware.image`, `custom.image`, and `vagrant.box`. 66 67 ### Optional: 68 69 - `atlas_url` (string) - Override the base URL for Atlas. This is useful if 70 you're using Atlas Enterprise in your own network. Defaults to 71 `https://atlas.hashicorp.com/api/v1`. 72 73 - `metadata` (map) - Send metadata about the artifact. If the artifact type is 74 "vagrant.box", you must specify a "provider" metadata about what provider 75 to use. 76 77 ### Example Configuration 78 79 ``` {.javascript} 80 { 81 "variables": { 82 "aws_access_key": "ACCESS_KEY_HERE", 83 "aws_secret_key": "SECRET_KEY_HERE", 84 "atlas_token": "ATLAS_TOKEN_HERE" 85 }, 86 "builders": [{ 87 "type": "amazon-ebs", 88 "access_key": "{{user `aws_access_key`}}", 89 "secret_key": "{{user `aws_secret_key`}}", 90 "region": "us-east-1", 91 "source_ami": "ami-fce3c696", 92 "instance_type": "t2.micro", 93 "ssh_username": "ubuntu", 94 "ami_name": "atlas-example {{timestamp}}" 95 }], 96 "provisioners": [ 97 { 98 "type": "shell", 99 "inline": [ 100 "sleep 30", 101 "sudo apt-get update", 102 "sudo apt-get install apache2 -y" 103 ] 104 }], 105 "post-processors": [ 106 { 107 "type": "atlas", 108 "token": "{{user `atlas_token`}}", 109 "artifact": "hashicorp/foobar", 110 "artifact_type": "amazon.image", 111 "metadata": { 112 "created_at": "{{timestamp}}" 113 } 114 } 115 ] 116 } 117 ``` 118 119 More information on the correct configuration of the `amazon-ebs` builder in this example can be found in the [amazon-ebs builder documentation](/docs/builders/amazon-ebs.html).