Skip to content

Commit

Permalink
fix bug on vpc option
Browse files Browse the repository at this point in the history
  • Loading branch information
brunodasilvalenga committed May 4, 2022
1 parent bb81ccb commit 8d92e29
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
16 changes: 14 additions & 2 deletions _variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ variable "encrypt_kms_key_id" {
variable "saml_subject_key" {
description = "Element of the SAML assertion to use for username."
type = string
default = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"
default = ""
}

variable "saml_roles_key" {
description = "Element of the SAML assertion to use for backend roles."
type = string
default = "http://schemas.microsoft.com/ws/2008/06/identity/claims/role"
default = ""
}

variable "saml_entity_id" {
Expand All @@ -132,6 +132,18 @@ variable "saml_session_timeout" {
default = 60
}

variable "saml_master_backend_role" {
description = "SAML Master backend role."
type = string
default = ""
}

variable "saml_master_user_name" {
description = "SAML master user name"
type = string
default = ""
}

variable "index_templates" {
description = "A map of all index templates to create."
type = map(any)
Expand Down
4 changes: 3 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ resource "aws_elasticsearch_domain" "opensearch" {
}

dynamic "vpc_options" {
for_each = (length(var.subnets_id) > 1) ? [1] : []
for_each = (length(var.subnets_id) >= 1) ? [1] : []

content {
subnet_ids = var.subnets_id
Expand Down Expand Up @@ -104,6 +104,8 @@ resource "aws_elasticsearch_domain_saml_options" "opensearch" {
subject_key = var.saml_subject_key
roles_key = var.saml_roles_key
session_timeout_minutes = var.saml_session_timeout
master_backend_role = var.saml_master_backend_role
master_user_name = var.saml_master_user_name

idp {
entity_id = var.saml_entity_id
Expand Down

0 comments on commit 8d92e29

Please sign in to comment.