Skip to content

Commit

Permalink
Add version 19
Browse files Browse the repository at this point in the history
  • Loading branch information
psychomantys committed Oct 22, 2024
1 parent e416acc commit 7b9e9d6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,17 @@ resource "aws_iam_policy" "bucket_rw" {

// Extra custom policy
resource "aws_iam_user_policy_attachment" "extra_custom_policy" {
count = var.create && var.extra_custom_policy && var.create_iam_user ? 1 : 0
count = var.create && ( length(var.extra_custom_policy)>2 ) && var.create_iam_user ? 1 : 0

user = aws_iam_user.bucket_user[0].name
policy_arn = aws_iam_policy.extra_custom_policy[0].arn
}

resource "aws_iam_policy" "extra_custom_policy" {
count = var.create && var.extra_custom_policy && (var.create_iam_user || length(var.create_iam_eks_role) > 0) ? 1 : 0
count = var.create && ( length(var.extra_custom_policy)>2 ) && (var.create_iam_user || length(var.create_iam_eks_role) > 0) ? 1 : 0

name = "${var.bucket_name}-extra-custom-policy"
policy = try(
var.extra_custom_policy,
"{}"
policy = var.extra_custom_policy
)

description = "Provides extra custom policy to the '${var.bucket_name}' S3 bucket"
Expand Down

0 comments on commit 7b9e9d6

Please sign in to comment.