From ac73ce4199364da5c6c355c41fca920ae879b973 Mon Sep 17 00:00:00 2001 From: Jake Champlin Date: Wed, 1 Feb 2017 09:51:26 -0500 Subject: [PATCH] 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. --- .../aws/data_source_aws_ecs_cluster.go | 12 +++---- .../aws/data_source_aws_ecs_cluster_test.go | 2 +- .../providers/aws/d/ecs_cluster.html.markdown | 36 +++++++++++++++++++ website/source/layouts/aws.erb | 3 ++ 4 files changed, 46 insertions(+), 7 deletions(-) create mode 100644 website/source/docs/providers/aws/d/ecs_cluster.html.markdown diff --git a/builtin/providers/aws/data_source_aws_ecs_cluster.go b/builtin/providers/aws/data_source_aws_ecs_cluster.go index e808814e7..2d8afeeea 100644 --- a/builtin/providers/aws/data_source_aws_ecs_cluster.go +++ b/builtin/providers/aws/data_source_aws_ecs_cluster.go @@ -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, }, diff --git a/builtin/providers/aws/data_source_aws_ecs_cluster_test.go b/builtin/providers/aws/data_source_aws_ecs_cluster_test.go index 25b0fbe0f..131c4656e 100644 --- a/builtin/providers/aws/data_source_aws_ecs_cluster_test.go +++ b/builtin/providers/aws/data_source_aws_ecs_cluster_test.go @@ -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"), diff --git a/website/source/docs/providers/aws/d/ecs_cluster.html.markdown b/website/source/docs/providers/aws/d/ecs_cluster.html.markdown new file mode 100644 index 000000000..9e25f0937 --- /dev/null +++ b/website/source/docs/providers/aws/d/ecs_cluster.html.markdown @@ -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 diff --git a/website/source/layouts/aws.erb b/website/source/layouts/aws.erb index 67190ef35..a62fe376a 100644 --- a/website/source/layouts/aws.erb +++ b/website/source/layouts/aws.erb @@ -50,6 +50,9 @@ > aws_ebs_volume + > + aws_ecs_cluster + > aws_ecs_container_definition