forked from hashicorp/terraform
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds documentation for hashicorp#12376
- Loading branch information
Arthur Burkart
committed
Mar 18, 2017
1 parent
9f6d24a
commit 1170c30
Showing
2 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
website/source/docs/providers/aws/d/instances.html.markdown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
layout: "aws" | ||
page_title: "AWS: aws_instances" | ||
sidebar_current: "docs-aws-datasource-instances" | ||
description: |- | ||
Get information on multiple Amazon EC2 Instances. | ||
--- | ||
|
||
# aws\_instances | ||
|
||
Use this data source to get the attributes of multiple Amazon EC2 Instances for use in other | ||
resources. | ||
|
||
## Example Usage | ||
|
||
``` | ||
data "aws_instances" "foo" { | ||
instance_ids = ["i-instanceid1"] | ||
filter { | ||
name = "image-id" | ||
values = ["ami-xxxxxxxx"] | ||
} | ||
filter { | ||
name = "tag:Name" | ||
values = ["instance-name-tag"] | ||
} | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
* `instance_ids` - (Optional) Specify list of Instance IDs with which to populate the data source. | ||
|
||
* `instance_tags` - (Optional) A mapping of tags, each pair of which must | ||
exactly match a pair on the desired Instances. | ||
|
||
* `filter` - (Optional) One or more name/value pairs to use as filters. There are | ||
several valid keys, for a full reference, check out | ||
[describe-instances in the AWS CLI reference][1]. | ||
|
||
~> **NOTE:** At least one of `filter`, `instance_tags`, or `instance_ids` must be specified. | ||
|
||
~> **NOTE:** Unlike the `aws_instance` data source, the search arguments used with `aws_instances` | ||
may match 0 or more instances. | ||
|
||
## Attributes Reference | ||
|
||
All of the argument attributes are also exported as result attributes. This data source will | ||
complete the data by populating any fields that are not included in the configuration with | ||
the data for the selected AWS Instances. | ||
|
||
~> **NOTE:** Some values are not always set and may not be available for | ||
interpolation. | ||
|
||
* `instances` - The attributes of all the AWS Instances matched by the provided search arguments. | ||
Refer to documenation for [aws_instance](/docs/providers/aws/d/instance.html) to view attributes | ||
that should be available on each instance. | ||
|
||
[1]: http://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html |