Skip to content

Commit

Permalink
Fix PR feed back on hashicorp#2632
Browse files Browse the repository at this point in the history
  • Loading branch information
tomelliff committed Jan 21, 2018
1 parent ca73236 commit a56d511
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions aws/resource_aws_elasticsearch_domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"log"
"regexp"
"strings"
"time"

"github.com/aws/aws-sdk-go/aws"
Expand All @@ -13,7 +14,6 @@ import (
"github.com/hashicorp/errwrap"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/helper/schema"
"strings"
)

func resourceAwsElasticSearchDomain() *schema.Resource {
Expand Down Expand Up @@ -94,6 +94,7 @@ func resourceAwsElasticSearchDomain() *schema.Resource {
Type: schema.TypeList,
Optional: true,
Computed: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"enabled": {
Expand Down Expand Up @@ -315,17 +316,12 @@ func resourceAwsElasticSearchDomainCreate(d *schema.ResourceData, meta interface

if v, ok := d.GetOk("encrypt_at_rest"); ok {
options := v.([]interface{})

if len(options) > 1 {
return fmt.Errorf("Only a single encrypt_at_rest block is expected")
} else if len(options) == 1 {
if options[0] == nil {
return fmt.Errorf("At least one field is expected inside encrypt_at_rest")
}

s := options[0].(map[string]interface{})
input.EncryptionAtRestOptions = expandESEncryptAtRestOptions(s)
if options[0] == nil {
return fmt.Errorf("At least one field is expected inside encrypt_at_rest")
}

s := options[0].(map[string]interface{})
input.EncryptionAtRestOptions = expandESEncryptAtRestOptions(s)
}

if v, ok := d.GetOk("cluster_config"); ok {
Expand Down

0 comments on commit a56d511

Please sign in to comment.