Skip to content

Commit c490015

Browse files
committed
fix: create irsa without iam_role_arns or iam_authorizing_role_arns
1 parent 60e4bb7 commit c490015

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ resource "aws_iam_service_linked_role" "default" {
8383

8484
# Role that pods can assume for access to elasticsearch and kibana
8585
resource "aws_iam_role" "elasticsearch_user" {
86-
count = module.this.enabled && var.create_elasticsearch_user_role && (length(var.iam_authorizing_role_arns) > 0 || length(var.iam_role_arns) > 0) ? 1 : 0
86+
count = module.this.enabled && var.create_elasticsearch_user_role && (length(var.iam_authorizing_role_arns) > 0 || length(var.iam_role_arns) > 0 || var.iam_irsa_openid_connect_provider_arn != "") ? 1 : 0
8787
name = module.user_label.id
8888
assume_role_policy = join("", data.aws_iam_policy_document.assume_role[*].json)
8989
description = "IAM Role to assume to access the Elasticsearch ${module.this.id} cluster"
@@ -95,7 +95,7 @@ resource "aws_iam_role" "elasticsearch_user" {
9595
}
9696

9797
data "aws_iam_policy_document" "assume_role" {
98-
count = module.this.enabled && var.create_elasticsearch_user_role && (length(var.iam_authorizing_role_arns) > 0 || length(var.iam_role_arns) > 0) ? 1 : 0
98+
count = module.this.enabled && var.create_elasticsearch_user_role && (length(var.iam_authorizing_role_arns) > 0 || length(var.iam_role_arns) > 0 || var.iam_irsa_openid_connect_provider_arn != "") ? 1 : 0
9999

100100
statement {
101101
actions = [

0 commit comments

Comments
 (0)