Skip to content

Commit

Permalink
documentation: Add documentation for the ECS Cluster Data Source
Browse files Browse the repository at this point in the history
Adds documentation for the ECS Cluster Data Source. Also removes duplicate struct declarations from the data source and test.
  • Loading branch information
grubernaut authored and arcadiatea committed Feb 7, 2017
1 parent 4b2bb91 commit bbfbf87
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 7 deletions.
12 changes: 6 additions & 6 deletions builtin/providers/aws/data_source_aws_ecs_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
2 changes: 1 addition & 1 deletion builtin/providers/aws/data_source_aws_ecs_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
36 changes: 36 additions & 0 deletions website/source/docs/providers/aws/d/ecs_cluster.html.markdown
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions website/source/layouts/aws.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit bbfbf87

Please sign in to comment.