Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

fix: update ElasticSearch type to have more region support #488

Merged
merged 1 commit into from
Oct 13, 2021
Merged
Changes from all commits
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
82 changes: 80 additions & 2 deletions cloudformation/elasticsearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,79 @@
# SPDX-License-Identifier: Apache-2.0
#

Mappings:
# For the most up to date ec2 types see: https://aws.amazon.com/opensearch-service/pricing/
RegionEC2Map:
us-east-2:
dev: c6g.large.elasticsearch
prod: m6g.large.elasticsearch
us-east-1:
dev: c6g.large.elasticsearch
prod: m6g.large.elasticsearch
us-west-1:
dev: c6g.large.elasticsearch
prod: r6g.large.elasticsearch
us-west-2:
dev: c6g.large.elasticsearch
prod: m6g.large.elasticsearch
af-south-1:
dev: c5.large.elasticsearch
prod: m5.large.elasticsearch
ap-east-1:
dev: c6g.large.elasticsearch
prod: m6g.large.elasticsearch
ap-south-1:
dev: c6g.large.elasticsearch
prod: r6g.large.elasticsearch
ap-northeast-3:
dev: c5.large.elasticsearch
prod: m5.large.elasticsearch
ap-northeast-2:
dev: c6g.large.elasticsearch
prod: m6g.large.elasticsearch
ap-southeast-1:
dev: c6g.large.elasticsearch
prod: m6g.large.elasticsearch
ap-southeast-2:
dev: c6g.large.elasticsearch
prod: m6g.large.elasticsearch
ap-northeast-1:
dev: c6g.large.elasticsearch
prod: m6g.large.elasticsearch
ca-central-1:
dev: c6g.large.elasticsearch
prod: m6g.large.elasticsearch
eu-central-1:
dev: c6g.large.elasticsearch
prod: m6g.large.elasticsearch
eu-west-1:
dev: c6g.large.elasticsearch
prod: m6g.large.elasticsearch
eu-west-2:
dev: c6g.large.elasticsearch
prod: m6g.large.elasticsearch
eu-south-1:
dev: c5.large.elasticsearch
prod: m5.large.elasticsearch
eu-west-3:
dev: c5.large.elasticsearch
prod: m5.large.elasticsearch
eu-north-1:
dev: c6g.large.elasticsearch
prod: m6g.large.elasticsearch
me-south-1:
dev: c5.large.elasticsearch
prod: m5.large.elasticsearch
sa-east-1:
dev: c6g.large.elasticsearch
prod: m6g.large.elasticsearch
us-gov-east-1:
dev: c6g.large.elasticsearch
prod: m6g.large.elasticsearch
us-gov-west-1:
dev: c6g.large.elasticsearch
prod: m6g.large.elasticsearch

Resources:
KibanaUserPool:
Type: AWS::Cognito::UserPool
Expand Down Expand Up @@ -100,11 +173,16 @@ Resources:
VolumeType: gp2
VolumeSize: !If [isDev, 10, 73]
ElasticsearchClusterConfig:
InstanceType: !If [isDev, c6g.large.elasticsearch, m6g.large.elasticsearch]
InstanceType:
!If [
isDev,
!FindInMap [RegionEC2Map, !Ref AWS::Region, dev],
!FindInMap [RegionEC2Map, !Ref AWS::Region, prod],
]
InstanceCount: !If [isDev, 1, 4]
DedicatedMasterEnabled: !If [isDev, false, true]
DedicatedMasterCount: !If [isDev, !Ref AWS::NoValue, 3]
DedicatedMasterType: !If [isDev, !Ref AWS::NoValue, c6g.large.elasticsearch]
DedicatedMasterType: !If [isDev, !Ref AWS::NoValue, !FindInMap [RegionEC2Map, !Ref AWS::Region, dev]]
ZoneAwarenessEnabled: !If [isDev, false, true]
ElasticsearchVersion: '7.10'
EncryptionAtRestOptions:
Expand Down