provider/aws: `aws_elastisearch_domain` tags not being set correctly.
The top level object was used not the tags within
This commit is contained in:
parent
f09a5661cf
commit
7b61567bf6
|
@ -290,10 +290,12 @@ func resourceAwsElasticSearchDomainRead(d *schema.ResourceData, meta interface{}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
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", tagsToMapElasticsearchService(est))
|
||||||
|
|
||||||
d.Set("tags", listOut)
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,8 +60,6 @@ func TestAccAWSElasticSearch_tags(t *testing.T) {
|
||||||
Config: testAccESDomainConfig,
|
Config: testAccESDomainConfig,
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckESDomainExists("aws_elasticsearch_domain.example", &domain),
|
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 = `
|
const testAccESDomainConfig = `
|
||||||
resource "aws_elasticsearch_domain" "example" {
|
resource "aws_elasticsearch_domain" "example" {
|
||||||
domain_name = "tf-test-1"
|
domain_name = "tf-test-1"
|
||||||
|
|
||||||
tags {
|
|
||||||
bar = "baz"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,10 @@ CONFIG
|
||||||
snapshot_options {
|
snapshot_options {
|
||||||
automated_snapshot_start_hour = 23
|
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.
|
* `ebs_options` - (Optional) EBS related options, see below.
|
||||||
* `cluster_config` - (Optional) Cluster configuration of the domain, see below.
|
* `cluster_config` - (Optional) Cluster configuration of the domain, see below.
|
||||||
* `snapshot_options` - (Optional) Snapshot related options, 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:
|
**ebs_options** supports the following attributes:
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue