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