We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a3c9a85 commit 7abc181Copy full SHA for 7abc181
main.tf
@@ -520,9 +520,27 @@ data "aws_iam_policy_document" "bucket_policy" {
520
values = var.source_ip_allow_list
521
}
522
523
-
524
525
+ dynamic "statement" {
526
+ for_each = length(var.source_ip_allow_list_s3_objects) > 0 ? [1] : []
527
+
528
+ content {
529
+ sid = "AllowIPPrincipalsOnObjects"
530
+ effect = "Deny"
531
+ actions = ["s3:*"]
532
+ resources = ["${local.bucket_arn}/*"]
533
+ principals {
534
+ identifiers = ["*"]
535
+ type = "*"
536
+ }
537
+ condition {
538
+ test = "NotIpAddress"
539
+ variable = "aws:SourceIp"
540
+ values = var.source_ip_allow_list_s3_objects
541
542
543
544
545
546
data "aws_iam_policy_document" "aggregated_policy" {
0 commit comments