Skip to content

Commit 33afa18

Browse files
authored
Opensearch module fixes (#10)
* Update iops config * Update AWS pod permissions for hub staging
1 parent 51c4125 commit 33afa18

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

opensearch-variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ variable "es_application_name" {
77
variable "es_instance_count" {
88
type = number
99
description = "Number of instances in the cluster"
10-
default = 1
10+
default = 2
1111
}
1212

1313
variable "es_dedicated_master_type" {
@@ -36,7 +36,7 @@ variable "es_volume_size" {
3636
variable "es_ebs_iops" {
3737
type = number
3838
description = "Baseline input/output (I/O) performance of EBS volumes attached to data nodes"
39-
default = 1000
39+
default = 3000
4040
}
4141

4242
variable "es_engine_version" {

opensearch.tf

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,4 +158,23 @@ module "secret" {
158158
})
159159
}
160160

161+
resource "aws_iam_role_policy_attachment" "test-attach" {
162+
count = var.elasticsearch_enabled ? 1 : 0
163+
164+
role = module.pod_role.name
165+
policy_arn = "arn:aws:iam::aws:policy/aws-service-role/AmazonElasticsearchServiceRolePolicy"
166+
167+
depends_on = [ module.pod_policy ]
168+
}
169+
170+
module "pod_policy" {
171+
count = var.elasticsearch_enabled ? 1 : 0
172+
source = "github.com/thoughtbot/flightdeck//aws/service-account-policy?ref=v0.9.0"
173+
174+
name = "es-${var.es_application_name}-pods"
175+
policy_documents = module.secret[*].policy_json
176+
177+
role_names = [module.pod_role.name]
178+
}
179+
161180
data "aws_region" "current" {}

0 commit comments

Comments
 (0)