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