Merge pull request #14845 from hashicorp/thrashr888/tfe-doc-snippets

Docs: Update atlas_artifact resource to use data
This commit is contained in:
Paul Thrasher 2017-05-26 14:00:09 -07:00 committed by GitHub
commit be9ca35f79
4 changed files with 8 additions and 8 deletions

View File

@ -25,7 +25,7 @@ func resourceArtifact() *schema.Resource {
Type: schema.TypeString,
Required: true,
ForceNew: true,
Deprecated: `atlas_artifact is now deprecated. Use the Atlas Artifact Data Source instead. See https://terraform.io/docs/providers/atlas/d/artifact.html`,
Deprecated: `atlas_artifact is now deprecated. Use the Atlas Artifact Data Source instead. See https://www.terraform.io/docs/providers/terraform-enterprise/d/artifact.html`,
},
"type": &schema.Schema{

View File

@ -26,7 +26,7 @@ provider "atlas" {
token = "${var.atlas_token}"
}
resource "atlas_artifact" "web-worker" {
data "atlas_artifact" "web-worker" {
name = "my-username/web-worker"
type = "amazon.image"
version = "latest"

View File

@ -44,9 +44,9 @@ You can pin artifacts to a specific version. This allows for a targeted
deploy.
```hcl
resource "atlas_artifact" "web-worker" {
name = "my-username/web-worker"
type = "amazon.image"
data "atlas_artifact" "web-worker" {
name = "my-username/web-worker"
type = "amazon.image"
version = 7
}
```
@ -59,7 +59,7 @@ Artifacts can also be pinned to an Terraform build number. This is only
possible if Terraform Enterprise was used to build the artifact with Packer.
```hcl
resource "atlas_artifact" "web-worker" {
data "atlas_artifact" "web-worker" {
name = "my-username/web-worker"
type = "amazon.image"
build = 5

View File

@ -26,7 +26,7 @@ variable "atlas_username" {}
variable "pinned_name" {}
variable "pinned_version" { default = "latest" }
resource "atlas_artifact" "pinned" {
data "atlas_artifact" "pinned" {
name = "${var.atlas_username}/${var.pinned_name}"
type = "${var.type}"
version = "${var.pinned_version}"
@ -57,7 +57,7 @@ variable "atlas_username" {}
variable "artifact_name" {}
variable "artifact_version" { default = "latest" }
resource "atlas_artifact" "artifact" {
data "atlas_artifact" "artifact" {
name = "${var.atlas_username}/${var.artifact_name}"
type = "${var.type}"
count = "${length(split(",", var.artifact_version))}"