Skip to content

Commit 12fca4e

Browse files
patch: Fix lambda role logic (#18)
* Fixing lambda function iam role logic * Fixing lambda function iam role logic * Auto Format Co-authored-by: cloudpossebot <[email protected]>
1 parent 47dc230 commit 12fca4e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

iam-role.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ resource "aws_iam_role_policy_attachment" "cloudwatch_insights" {
3232
}
3333

3434
resource "aws_iam_role_policy_attachment" "vpc_access" {
35-
count = local.enabled && try(length(var.vpc_config), 0) > 0 ? 1 : 0
35+
count = local.enabled && var.vpc_config != null ? 1 : 0
3636

3737
policy_arn = "arn:${local.partition}:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
3838
role = aws_iam_role.this[0].name
3939
}
4040

4141
resource "aws_iam_role_policy_attachment" "xray" {
42-
count = local.enabled && try(length(var.tracing_config_mode), 0) > 0 ? 1 : 0
42+
count = local.enabled && var.tracing_config_mode != null ? 1 : 0
4343

4444
policy_arn = "arn:${local.partition}:iam::aws:policy/AWSXRayDaemonWriteAccess"
4545
role = aws_iam_role.this[0].name

0 commit comments

Comments
 (0)