Skip to content

Commit aeff8a1

Browse files
authored
Fix reference to empty eks resource when creating S3 (#92)
* only do the permission assignment when eks is enabled * add changes to the src recipes * revert changes on the legacy aws-modular recipe * format file
1 parent a179b03 commit aeff8a1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/mlstacks/terraform/aws-modular/eks.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ resource "aws_eks_node_group" "nodegroup" {
8585
}
8686

8787
resource "aws_iam_role" "ng" {
88-
count = local.enable_eks || var.enable_artifact_store ? 1 : 0
88+
count = local.enable_eks ? 1 : 0
8989

9090
name_prefix = "${local.prefix}-${local.eks.cluster_name}-ng"
9191
assume_role_policy = jsonencode({

src/mlstacks/terraform/aws-modular/s3.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ resource "aws_s3_bucket_public_access_block" "example" {
2525
}
2626

2727
resource "aws_s3_bucket_policy" "allow_access_from_another_account" {
28-
count = var.enable_artifact_store ? 1 : 0
28+
count = local.enable_eks ? 1 : 0
2929
bucket = aws_s3_bucket.zenml-artifact-store[0].id
3030
policy = data.aws_iam_policy_document.allow_access_from_another_account[0].json
3131
}
3232

3333
data "aws_iam_policy_document" "allow_access_from_another_account" {
34-
count = var.enable_artifact_store ? 1 : 0
34+
count = local.enable_eks ? 1 : 0
3535
statement {
3636
principals {
3737
type = "AWS"

0 commit comments

Comments
 (0)