Skip to content
Merged
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
6 changes: 5 additions & 1 deletion templates/terraform/modules/environment/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
#
# Kubernetes admin role

locals {
non_upload_buckets = [for bucket in module.s3_hosting : bucket if !bucket.cf_signing_enabled]
}

# Create KubernetesAdmin role for aws-iam-authenticator
resource "aws_iam_role" "kubernetes_admin_role" {
name = "${var.project}-kubernetes-admin-${var.environment}"
Expand Down Expand Up @@ -81,7 +85,7 @@ data "aws_iam_policy_document" "deploy_assets_policy" {
"s3:GetBucketLocation",
]

resources = formatlist("%s/*", module.s3_hosting[*].bucket_arn)
resources = formatlist("%s/*", local.non_upload_buckets[*].bucket_arn)
}

statement {
Expand Down
2 changes: 1 addition & 1 deletion templates/terraform/modules/environment/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ module "assets_domains" {

module "s3_hosting" {
source = "commitdev/zero/aws//modules/s3_hosting"
version = "0.1.0"
version = "0.1.4"
count = length(var.hosted_domains)

cf_signed_downloads = var.hosted_domains[count.index].signed_urls
Expand Down