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