github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/website/source/docs/providers/atlas/r/artifact.html.markdown (about)

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