github.com/marksheahan/packer@v0.10.2-0.20160613200515-1acb2d6645a0/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
    41      tool 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.
    62      `artifact_type` can be set to any unique identifier, however, the following
    63      are recommended for consistency - `amazon.image`, `digitalocean.image`,
    64      `docker.image`, `googlecompute.image`, `openstack.image`,
    65      `parallels.image`, `qemu.image`, `virtualbox.image`, `vmware.image`,
    66      `custom.image`, and `vagrant.box`.
    67  
    68  ### Optional:
    69  
    70  -   `atlas_url` (string) - Override the base URL for Atlas. This is useful if
    71      you're using Atlas Enterprise in your own network. Defaults to
    72      `https://atlas.hashicorp.com/api/v1`.
    73  
    74  -   `metadata` (map) - Send metadata about the artifact. If the artifact type
    75      is `vagrant.box`, you must specify a `provider` metadata about what
    76      provider to use.
    77  
    78      -   `description` (string) - Inside the metadata blob you can add a information
    79          about the uploaded artifact to Atlas. This will be reflected in the box
    80          description on Atlas.
    81  
    82      -   `provider` (string) - Used by Atlas to help determine, what should be used
    83          to run the artifact.
    84  
    85      -   `version` (string) - Used by Atlas to give a semantic version to the
    86          uploaded artifact.
    87  
    88  ## Environment Variables
    89  
    90  -   `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.
    91  
    92  -   `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.
    93  
    94  ### Example Configuration
    95  
    96  ``` {.javascript}
    97  {
    98      "variables": {
    99          "aws_access_key": "ACCESS_KEY_HERE",
   100          "aws_secret_key": "SECRET_KEY_HERE",
   101          "atlas_token": "ATLAS_TOKEN_HERE"
   102      },
   103      "builders": [{
   104          "type": "amazon-ebs",
   105          "access_key": "{{user `aws_access_key`}}",
   106          "secret_key": "{{user `aws_secret_key`}}",
   107          "region": "us-east-1",
   108          "source_ami": "ami-fce3c696",
   109          "instance_type": "t2.micro",
   110          "ssh_username": "ubuntu",
   111          "ami_name": "atlas-example {{timestamp}}"
   112      }],
   113      "provisioners": [
   114      {
   115          "type": "shell",
   116          "inline": [
   117              "sleep 30",
   118              "sudo apt-get update",
   119              "sudo apt-get install apache2 -y"
   120          ]
   121      }],
   122      "post-processors": [
   123        {
   124          "type": "atlas",
   125          "token": "{{user `atlas_token`}}",
   126          "artifact": "hashicorp/foobar",
   127          "artifact_type": "amazon.image",
   128          "metadata": {
   129            "created_at": "{{timestamp}}"
   130          }
   131        }
   132      ]
   133  }
   134  ```
   135  
   136  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).