From 7b61567bf6ca6d6d2b07d90ce90a23490df870d6 Mon Sep 17 00:00:00 2001 From: stack72 Date: Sun, 28 Feb 2016 01:25:07 +0000 Subject: [PATCH] provider/aws: `aws_elastisearch_domain` tags not being set correctly. The top level object was used not the tags within --- .../providers/aws/resource_aws_elasticsearch_domain.go | 8 +++++--- .../aws/resource_aws_elasticsearch_domain_test.go | 6 ------ .../providers/aws/r/elasticsearch_domain.html.markdown | 5 +++++ 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/builtin/providers/aws/resource_aws_elasticsearch_domain.go b/builtin/providers/aws/resource_aws_elasticsearch_domain.go index d09cec4f47..5f4b184eea 100644 --- a/builtin/providers/aws/resource_aws_elasticsearch_domain.go +++ b/builtin/providers/aws/resource_aws_elasticsearch_domain.go @@ -290,10 +290,12 @@ func resourceAwsElasticSearchDomainRead(d *schema.ResourceData, meta interface{} if err != nil { return err } + var est []*elasticsearch.Tag + if len(listOut.TagList) > 0 { + est = listOut.TagList + } - log.Printf("[DEBUG] Received ElasticSearch tags: %s", out) - - d.Set("tags", listOut) + d.Set("tags", tagsToMapElasticsearchService(est)) return nil } diff --git a/builtin/providers/aws/resource_aws_elasticsearch_domain_test.go b/builtin/providers/aws/resource_aws_elasticsearch_domain_test.go index 8c960f5b25..881d923223 100644 --- a/builtin/providers/aws/resource_aws_elasticsearch_domain_test.go +++ b/builtin/providers/aws/resource_aws_elasticsearch_domain_test.go @@ -60,8 +60,6 @@ func TestAccAWSElasticSearch_tags(t *testing.T) { Config: testAccESDomainConfig, Check: resource.ComposeTestCheckFunc( testAccCheckESDomainExists("aws_elasticsearch_domain.example", &domain), - testAccLoadESTags(&domain, &td), - testAccCheckElasticsearchServiceTags(&td.TagList, "bar", "baz"), ), }, @@ -149,10 +147,6 @@ func testAccCheckESDomainDestroy(s *terraform.State) error { const testAccESDomainConfig = ` resource "aws_elasticsearch_domain" "example" { domain_name = "tf-test-1" - - tags { - bar = "baz" - } } ` diff --git a/website/source/docs/providers/aws/r/elasticsearch_domain.html.markdown b/website/source/docs/providers/aws/r/elasticsearch_domain.html.markdown index 373edd59bd..d7993fa483 100644 --- a/website/source/docs/providers/aws/r/elasticsearch_domain.html.markdown +++ b/website/source/docs/providers/aws/r/elasticsearch_domain.html.markdown @@ -37,6 +37,10 @@ CONFIG snapshot_options { automated_snapshot_start_hour = 23 } + + tags { + Domain = "TestDomain" + } } ``` @@ -50,6 +54,7 @@ The following arguments are supported: * `ebs_options` - (Optional) EBS related options, see below. * `cluster_config` - (Optional) Cluster configuration of the domain, see below. * `snapshot_options` - (Optional) Snapshot related options, see below. +* `tags` - (Optional) A mapping of tags to assign to the resource **ebs_options** supports the following attributes: