Merge pull request #11605 from hashicorp/f-add-docs-ecs-cluster-datasource
documentation: Add documentation for the ECS Cluster Data Source
This commit is contained in:
commit
c83a971efb
|
@ -13,33 +13,33 @@ func dataSourceAwsEcsCluster() *schema.Resource {
|
||||||
Read: dataSourceAwsEcsClusterRead,
|
Read: dataSourceAwsEcsClusterRead,
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"cluster_name": &schema.Schema{
|
"cluster_name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"arn": &schema.Schema{
|
"arn": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"status": &schema.Schema{
|
"status": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"pending_tasks_count": &schema.Schema{
|
"pending_tasks_count": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"running_tasks_count": &schema.Schema{
|
"running_tasks_count": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"registered_container_instances_count": &schema.Schema{
|
"registered_container_instances_count": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
|
@ -13,7 +13,7 @@ func TestAccAWSEcsDataSource_ecsCluster(t *testing.T) {
|
||||||
PreCheck: func() { testAccPreCheck(t) },
|
PreCheck: func() { testAccPreCheck(t) },
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccCheckAwsEcsClusterDataSourceConfig,
|
Config: testAccCheckAwsEcsClusterDataSourceConfig,
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
resource.TestCheckResourceAttr("data.aws_ecs_cluster.default", "status", "ACTIVE"),
|
resource.TestCheckResourceAttr("data.aws_ecs_cluster.default", "status", "ACTIVE"),
|
||||||
|
|
|
@ -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
|
|
@ -50,6 +50,9 @@
|
||||||
<li<%= sidebar_current("docs-aws-datasource-ebs-volume") %>>
|
<li<%= sidebar_current("docs-aws-datasource-ebs-volume") %>>
|
||||||
<a href="/docs/providers/aws/d/ebs_volume.html">aws_ebs_volume</a>
|
<a href="/docs/providers/aws/d/ebs_volume.html">aws_ebs_volume</a>
|
||||||
</li>
|
</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") %>>
|
<li<%= sidebar_current("docs-aws-datasource-ecs-container-definition") %>>
|
||||||
<a href="/docs/providers/aws/d/ecs_container_definition.html">aws_ecs_container_definition</a>
|
<a href="/docs/providers/aws/d/ecs_container_definition.html">aws_ecs_container_definition</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
Loading…
Reference in New Issue