terraform/website/source/docs/providers/terraform-enterprise/r/artifact.html.markdown

93 lines
3.2 KiB
Markdown
Raw Normal View History

2014-12-08 03:42:27 +01:00
---
2017-04-07 06:14:57 +02:00
layout: "terraform-enterprise"
2017-03-23 20:28:10 +01:00
page_title: "Terraform Enterprise: atlas_artifact"
2017-04-07 06:14:57 +02:00
sidebar_current: "docs-terraform-enterprise-resource-artifact"
2014-12-08 03:42:27 +01:00
description: |-
2017-04-07 17:36:49 +02:00
Provides access to deployment artifacts managed by Terraform Enterprise. This
can be used to dynamically configure instantiation and provisioning of
resources.
2014-12-08 03:42:27 +01:00
---
2017-04-06 20:07:44 +02:00
# atlas_artifact
2014-12-08 03:42:27 +01:00
2017-04-07 17:36:49 +02:00
Provides access to deployment artifacts managed by Terraform Enterprise. This
can be used to dynamically configure instantiation and provisioning of
resources.
2014-12-08 03:42:27 +01:00
2017-03-23 20:28:10 +01:00
~> **This resource is deprecated!** Please use the
2017-04-07 06:14:57 +02:00
[Artifact Data Source](/docs/providers/terraform-enterprise/d/artifact.html)
2014-12-08 03:42:27 +01:00
## Example Usage
2015-04-21 23:39:22 +02:00
An artifact can be created that has metadata representing
an AMI in AWS. This AMI can be used to configure an instance. Any changes
to this artifact will trigger a change to that instance.
2017-04-06 20:07:44 +02:00
```hcl
2014-12-08 03:42:27 +01:00
# Read the AMI
resource "atlas_artifact" "web" {
name = "hashicorp/web"
type = "amazon.image"
build = "latest"
metadata {
arch = "386"
}
2014-12-08 03:42:27 +01:00
}
# Start our instance with the dynamic ami value
# Remember to include the AWS region as it is part of the full ID
2014-12-08 03:42:27 +01:00
resource "aws_instance" "app" {
ami = "${atlas_artifact.web.metadata_full.region-us-east-1}"
# ...
2014-12-08 03:42:27 +01:00
}
```
## Argument Reference
The following arguments are supported:
2017-03-23 20:28:10 +01:00
* `name` - (Required) Name of the artifact in Terraform Enterprise. This is given
2014-12-08 03:42:27 +01:00
in slug format like "organization/artifact".
* `type` - (Required) The type of artifact to query for.
2015-04-21 23:39:22 +02:00
* `build` - (Optional) The build number responsible for creating
the version of the artifact to filter on. This can be "latest",
2014-12-09 02:13:42 +01:00
to find a matching artifact in the latest build, "any" to find a
matching artifact in any build, or a specific number to pin to that
build. If `build` and `version` are unspecified, `version` will default
to "latest". Cannot be specified with `version`. Note: `build` is only
2017-03-23 20:28:10 +01:00
present if Terraform Enterprise builds the image.
2014-12-09 02:13:42 +01:00
2015-04-21 23:39:22 +02:00
* `version` - (Optional) The version of the artifact to filter on. This can
be "latest", to match against the latest version, "any" to find a matching artifact
2014-12-09 02:13:42 +01:00
in any version, or a specific number to pin to that version. Defaults to
"latest" if neither `build` or `version` is specified. Cannot be specified
with `build`.
2014-12-08 03:42:27 +01:00
* `metadata_keys` - (Optional) If given, only an artifact containing
the given keys will be returned. This is used to disambiguate when
multiple potential artifacts match. An example is "aws" to filter
on an AMI.
* `metadata` - (Optional) If given, only an artifact matching the
metadata filters will be returned. This is used to disambiguate when
multiple potential artifacts match. An example is "arch" = "386" to
filter on architecture.
## Attributes Reference
The following attributes are exported:
* `id` - The ID of the artifact. This could be an AMI ID, GCE Image ID, etc.
* `file_url` - For artifacts that are binaries, this is a download path.
2014-12-09 04:49:23 +01:00
* `metadata_full` - Contains the full metadata of the artifact. The keys are sanitized
to replace any characters that are invalid in a resource name with a hyphen.
2014-12-09 04:49:23 +01:00
For example, the "region.us-east-1" key will become "region-us-east-1".
2014-12-09 02:13:42 +01:00
* `version_real` - The matching version of the artifact
2017-03-23 20:28:10 +01:00
* `slug` - The artifact slug in Terraform Enterprise