TerraformでElasticsearch Serviceを3 Availability Zone構成で作成できるようになりました。
以前までは、以下issueのコメントの通り、Elasticsearch Serviceを3-AZ構成で作成するために正しいと思われるコードを書いてもエラーが出てApplyできませんでした。
そのため当時の私は2-AZ構成で作成した後、AWSコンソール上で手動で3-AZ構成にmodifyしていました。
ただ先日ふと同じissueを覗いたら、以下コメントの通りこの問題がFIXしていたようです。
そのまま引用しますが、AWS Providerのバージョン2.20.0でzone_awareness_configとavailability_zone_countという設定が追加されました。
# Example implementation - only showing relevant new configuration
resource "aws_elasticsearch_domain" "example" {
# ... other configuration ...
cluster_config {
# ... other configuration ...
zone_awareness_enabled = true
zone_awareness_config {
availability_zone_count = 3
}
}
}
TerraformのDocumentも更新されています。
zone_awareness_enabled - (Optional) Indicates whether zone awareness is enabled. To enable awareness with three Availability Zones, the availability_zone_count within the zone_awareness_config must be set to 3.
今後TerraformでElasticsearch Serviceを3-AZ構成を組む際は、zone_awareness_config内で、availability_zone_countを必ず3にセットするようにします。
この記事が気に入ったらサポートをしてみませんか?