Skip to content

Commit 61c4fc0

Browse files
authored
fix: Disable policy data source if the associated addon is disabled (#208)
1 parent c8281a1 commit 61c4fc0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,8 @@ locals {
673673
}
674674

675675
data "aws_iam_policy_document" "aws_fsx_csi_driver" {
676+
count = var.enable_aws_fsx_csi_driver ? 1 : 0
677+
676678
statement {
677679
sid = "AllowCreateServiceLinkedRoles"
678680
resources = ["arn:${local.partition}:iam::*:role/aws-service-role/s3.data-source.lustre.fsx.${local.dns_suffix}/*"]
@@ -825,6 +827,8 @@ locals {
825827
}
826828

827829
data "aws_iam_policy_document" "aws_load_balancer_controller" {
830+
count = var.enable_aws_load_balancer_controller ? 1 : 0
831+
828832
statement {
829833
sid = "AllowCreateServiceLinkedRole"
830834
effect = "Allow"

0 commit comments

Comments
 (0)