Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:add new support for permission boundry #19

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
12 changes: 6 additions & 6 deletions iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,11 @@ data "aws_iam_policy_document" "this_irsa" {
}

resource "aws_iam_role" "this" {
count = local.irsa_role_create ? 1 : 0
name = "${var.irsa_role_name_prefix}-${var.helm_chart_name}" # tflint-ignore: aws_iam_role_invalid_name
assume_role_policy = data.aws_iam_policy_document.this_irsa[0].json
tags = var.irsa_tags
count = local.irsa_role_create ? 1 : 0
name = "${var.irsa_role_name_prefix}-${var.helm_chart_name}" # tflint-ignore: aws_iam_role_invalid_name
assume_role_policy = data.aws_iam_policy_document.this_irsa[0].json
permissions_boundary = var.irsa_permissions_boundary

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when permission boundary is empty tflint is failing. It needs to be ignore with the comment:

# tflint-ignore: aws_iam_role_invalid_permissions_boundary

tags = var.irsa_tags
}

resource "aws_iam_role_policy_attachment" "this" {
Expand All @@ -97,8 +98,7 @@ resource "aws_iam_role_policy_attachment" "this" {
}

resource "aws_iam_role_policy_attachment" "this_additional" {
for_each = local.irsa_role_create ? var.irsa_additional_policies : {}

for_each = local.irsa_role_create ? var.irsa_additional_policies : {}
role = aws_iam_role.this[0].name
policy_arn = each.value
}
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ variable "irsa_tags" {
description = "IRSA resources tags"
}

variable "irsa_permissions_boundary" {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when adding new variables make sure to run terraform-docs so README.md is adjusted along with the Terraform changes.

terraform-docs markdown table --output-file README.md --output-mode inject .

type = string
default = ""
description = "An ARN of a policy permission boundary to attach to the irsa role."
}

# ================ argo variables (required) ================

variable "argo_namespace" {
Expand Down
Loading