github.com/adrian-bl/terraform@v0.7.0-rc2.0.20160705220747-de0a34fc3517/website/source/docs/providers/atlas/d/artifact.html.markdown (about)

     1  ---
     2  layout: "atlas"
     3  page_title: "Atlas: atlas_artifact"
     4  sidebar_current: "docs-atlas-data-artifact"
     5  description: |-
     6    Provides a data source to deployment artifacts managed by Atlas. This can
     7    be used to dynamically configure instantiation and provisioning
     8    of resources.
     9  ---
    10  
    11  # atlas\_artifact
    12  
    13  Provides a [Data Source](/docs/configuration/data-sources.html) to access to deployment 
    14  artifacts managed by Atlas. This can be used to dynamically configure instantiation 
    15  and provisioning of resources.
    16  
    17  ## Example Usage
    18  
    19  An artifact can be created that has metadata representing
    20  an AMI in AWS. This AMI can be used to configure an instance. Any changes
    21  to this artifact will trigger a change to that instance.
    22  
    23  ```
    24  # Read the AMI
    25  data "atlas_artifact" "web" {
    26      name = "hashicorp/web"
    27      type = "amazon.image"
    28      build = "latest"
    29      metadata {
    30          arch = "386"
    31      }
    32  }
    33  
    34  # Start our instance with the dynamic ami value
    35  # Remember to include the AWS region as it is part of the full ID
    36  resource "aws_instance" "app" {
    37      ami = "${data.atlas_artifact.web.metadata_full.region-us-east-1}"
    38      ...
    39  }
    40  ```
    41  
    42  ## Argument Reference
    43  
    44  The following arguments are supported:
    45  
    46  * `name` - (Required) Name of the artifact in Atlas. This is given
    47    in slug format like "organization/artifact".
    48  
    49  * `type` - (Required) The type of artifact to query for.
    50  
    51  * `build` - (Optional) The build number responsible for creating
    52    the version of the artifact to filter on. This can be "latest",
    53    to find a matching artifact in the latest build, "any" to find a
    54    matching artifact in any build, or a specific number to pin to that
    55    build. If `build` and `version` are unspecified, `version` will default
    56    to "latest". Cannot be specified with `version`. Note: `build` is only 
    57    present if Atlas builds the image.
    58  
    59  * `version` - (Optional)  The version of the artifact to filter on. This can
    60    be "latest", to match against the latest version, "any" to find a matching artifact
    61    in any version, or a specific number to pin to that version. Defaults to
    62    "latest" if neither `build` or `version` is specified. Cannot be specified
    63    with `build`.
    64  
    65  * `metadata_keys` - (Optional) If given, only an artifact containing
    66    the given keys will be returned. This is used to disambiguate when
    67    multiple potential artifacts match. An example is "aws" to filter
    68    on an AMI.
    69  
    70  * `metadata` - (Optional) If given, only an artifact matching the
    71    metadata filters will be returned. This is used to disambiguate when
    72    multiple potential artifacts match. An example is "arch" = "386" to
    73    filter on architecture.
    74  
    75  
    76  ## Attributes Reference
    77  
    78  The following attributes are exported:
    79  
    80  * `id` - The ID of the artifact. This could be an AMI ID, GCE Image ID, etc.
    81  * `file_url` - For artifacts that are binaries, this is a download path.
    82  * `metadata_full` - Contains the full metadata of the artifact. The keys are sanitized
    83    to replace any characters that are invalid in a resource name with a hyphen.
    84    For example, the "region.us-east-1" key will become "region-us-east-1".
    85  * `version_real` - The matching version of the artifact
    86  * `slug` - The artifact slug in Atlas