Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Elasticsearch] Implement specifying availability zone count ... #8144

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions aws/resource_aws_elasticsearch_domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ func resourceAwsElasticSearchDomain() *schema.Resource {
Type: schema.TypeBool,
Optional: true,
},
"zone_awareness_count": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two notes:

  • This argument needs documentation added in website/docs/r/elasticsearch_domain.html.markdown
  • Since this argument is not marked ForceNew: true, an additional TestStep should be added to the acceptance test that attempts to update or remove it

Type: schema.TypeInt,
Optional: true,
},
},
},
},
Expand Down
7 changes: 7 additions & 0 deletions aws/structure.go
Original file line number Diff line number Diff line change
Expand Up @@ -1205,6 +1205,10 @@ func expandESClusterConfig(m map[string]interface{}) *elasticsearch.Elasticsearc
config.ZoneAwarenessEnabled = aws.Bool(v.(bool))
}

if v, ok := m["zone_awareness_count"]; ok {
config.ZoneAwarenessConfig.AvailabilityZoneCount = aws.Int64(v.(int64))
}

return &config
}

Expand All @@ -1229,6 +1233,9 @@ func flattenESClusterConfig(c *elasticsearch.ElasticsearchClusterConfig) []map[s
if c.ZoneAwarenessEnabled != nil {
m["zone_awareness_enabled"] = *c.ZoneAwarenessEnabled
}
if c.ZoneAwarenessConfig.AvailabilityZoneCount != nil {
jtcressy marked this conversation as resolved.
Show resolved Hide resolved
m["zone_awareness_count"] = *c.ZoneAwarenessConfig.AvailabilityZoneCount
}

return []map[string]interface{}{m}
}
Expand Down