Skip to content

Commit 85043c2

Browse files
authored
Merge pull request #3 from lgallard/feature/add-timeouts
Add support for customizable update timeout
2 parents 49abc1f + 509078a commit 85043c2

File tree

9 files changed

+105
-46
lines changed

9 files changed

+105
-46
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
## 0.2.0 (May 2, 2020)
2+
3+
ENHANCEMENTS:
4+
5+
* Add support for customizable update timeout
6+
7+
UPDATES:
8+
9+
* Update public and vpc examples
10+
11+
112
## 0.1.2 (April 1, 2020)
213

314
UPDATES:

README.md

Lines changed: 47 additions & 40 deletions
Large diffs are not rendered by default.

examples/public/main.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ module "aws_es" {
2323
kms_key_id = "alias/aws/es"
2424
}
2525

26-
2726
log_publishing_options = {
2827
enabled = "true"
2928
}
@@ -32,7 +31,7 @@ module "aws_es" {
3231
"rest.action.multi.allow_explicit_index" = "true"
3332
}
3433

35-
access_policies = templatefile("${path.module}/whitelist.tpl", {
34+
access_policies = templatefile("${path.module}/whitelits.tpl", {
3635
region = data.aws_region.current.name,
3736
account = data.aws_caller_identity.current.account_id,
3837
domain_name = var.es_domain_name,
@@ -42,6 +41,8 @@ module "aws_es" {
4241
node_to_node_encryption_enabled = "true"
4342
snapshot_options_automated_snapshot_start_hour = "23"
4443

44+
timeouts_update = "60m"
45+
4546
tags = {
4647
Owner = "sysops"
4748
env = "dev"

examples/public/terraform.tfvars

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
region = "us-east-1"
2-
profile = "my-profile"
3-
es_domain_name = "elasticsearch_public"
2+
profile = "default"
3+
es_domain_name = "elasticsearch-public"
44
es_version = "7.1"
55
whitelist = ["1.1.1.1", "2.2.2.2"]

examples/vpc/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ module "aws_es" {
3737
domain_name = var.es_domain_name
3838
})
3939

40+
timeouts_update = "60m"
41+
4042
tags = {
4143
Owner = "sysops"
4244
env = "dev"

examples/vpc/terraform.tfvars

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
profile = "my-profile"
1+
profile = "default"
22
region = "us-east-1"
3-
es_domain_name = "elasticsearch_vpc"
3+
es_domain_name = "elasticsearch-vpc"
44
es_version = "7.1"

main.tf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,14 @@ resource "aws_elasticsearch_domain" "es_domain" {
9898
}
9999
}
100100

101+
# Timeouts
102+
dynamic "timeouts" {
103+
for_each = local.timeouts
104+
content {
105+
update = lookup(timeouts.value, "update")
106+
}
107+
}
108+
101109
# Tags
102110
tags = var.tags
103111

@@ -191,4 +199,13 @@ locals {
191199

192200
cognito_options = var.cognito_options_enabled == false || lookup(local.cognito_options_default, "enabled", "false") == "false" ? [] : [local.cognito_options_default]
193201

202+
# Timeouts
203+
# If timeouts block is provided, build one using the default values
204+
timeouts = var.timeouts_update == null && length(var.timeouts) == 0 ? [] : [
205+
{
206+
update = lookup(var.timeouts, "update", null) == null ? var.timeouts_update : lookup(var.timeouts, "update")
207+
}
208+
]
209+
210+
194211
}

variables.tf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,3 +230,17 @@ variable "tags" {
230230
type = map
231231
default = {}
232232
}
233+
234+
235+
# Timeouts
236+
variable "timeouts" {
237+
description = "Timeouts map."
238+
type = map
239+
default = {}
240+
}
241+
242+
variable "timeouts_update" {
243+
description = "How long to wait for updates."
244+
type = string
245+
default = null
246+
}

versions.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
terraform {
2+
required_version = ">= 0.12.9"
3+
4+
required_providers {
5+
aws = ">= 2.60.0"
6+
}
7+
}

0 commit comments

Comments
 (0)