documentation: Add documentation for the ECS Cluster Data Source

Adds documentation for the ECS Cluster Data Source. Also removes duplicate struct declarations from the data source and test.
This commit is contained in:
Jake Champlin 2017-02-01 09:51:26 -05:00
parent 5566edd86e
commit ac73ce4199
No known key found for this signature in database
GPG Key ID: DC31F41958EF4AC2
4 changed files with 46 additions and 7 deletions

View File

@ -13,33 +13,33 @@ func dataSourceAwsEcsCluster() *schema.Resource {
Read: dataSourceAwsEcsClusterRead,
Schema: map[string]*schema.Schema{
"cluster_name": &schema.Schema{
"cluster_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"arn": &schema.Schema{
"arn": {
Type: schema.TypeString,
Computed: true,
},
"status": &schema.Schema{
"status": {
Type: schema.TypeString,
Computed: true,
},
"pending_tasks_count": &schema.Schema{
"pending_tasks_count": {
Type: schema.TypeInt,
Computed: true,
},
"running_tasks_count": &schema.Schema{
"running_tasks_count": {
Type: schema.TypeInt,
Computed: true,
},
"registered_container_instances_count": &schema.Schema{
"registered_container_instances_count": {
Type: schema.TypeInt,
Computed: true,
},

View File

@ -13,7 +13,7 @@ func TestAccAWSEcsDataSource_ecsCluster(t *testing.T) {
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
resource.TestStep{
{
Config: testAccCheckAwsEcsClusterDataSourceConfig,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("data.aws_ecs_cluster.default", "status", "ACTIVE"),

View File

@ -0,0 +1,36 @@
---
layout: "aws"
page_title: "AWS: aws_ecs_cluster"
sidebar_current: "docs-aws-datasource-ecs-cluster"
description: |-
Provides details about an ecs cluster
---
# aws\_ecs\_cluster
The ECS Cluster data source allows access to details of a specific
cluster within an AWS ECS service.
## Example Usage
```
data "aws_ecs_cluster" "ecs-mongo" {
cluster_name = "ecs-mongo-production"
}
```
## Argument Reference
The following arguments are supported:
* `cluster_name` - (Required) The name of the ECS Cluster
## Attributes Reference
The following attributes are exported:
* `arn` - The ARN of the ECS Cluster
* `status` - The status of the ECS Cluster
* `pending_tasks_count` - The number of pending tasks for the ECS Cluster
* `running_tasks_count` - The number of running tasks for the ECS Cluster
* `registered_container_instances_count` - The number of registered container instances for the ECS Cluster

View File

@ -50,6 +50,9 @@
<li<%= sidebar_current("docs-aws-datasource-ebs-volume") %>>
<a href="/docs/providers/aws/d/ebs_volume.html">aws_ebs_volume</a>
</li>
<li<%= sidebar_current("docs-aws-datasource-ecs-cluster") %>>
<a href="/docs/providers/aws/d/ecs_cluster.html">aws_ecs_cluster</a>
</li>
<li<%= sidebar_current("docs-aws-datasource-ecs-container-definition") %>>
<a href="/docs/providers/aws/d/ecs_container_definition.html">aws_ecs_container_definition</a>
</li>