Skip to content

Commit 282db78

Browse files
committed
fix: ensure the dependency on the cluster
1 parent 7a6901d commit 282db78

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

kubecosts.tf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ locals {
88
enable_kubecosts = try(var.kubecosts.enable, false)
99
## Indicating if we should enable cloud costs via Athena
1010
enable_kubecosts_cloud_costs = try(var.kubecosts.cloud_costs.enable, false)
11-
## List of principals to allowed to write to the federated bucket - we always allow
11+
## List of principals to allowed to write to the federated bucket - we always allow
1212
## the root account and the kubecost pod identity
1313
allowed_principals = concat(
1414
[local.root_account_arn],
@@ -34,7 +34,7 @@ data "aws_iam_policy_document" "kubecost_federated_bucket_policy" {
3434
]
3535
}
3636

37-
## Allow all accounts within my organization, using the kubecost agent
37+
## Allow all accounts within my organization, using the kubecost agent
3838
dynamic "statement" {
3939
for_each = toset(local.allowed_principals)
4040
content {
@@ -81,6 +81,7 @@ module "kubecost_federated_bucket" {
8181
force_destroy = true
8282
object_ownership = "BucketOwnerEnforced"
8383
policy = data.aws_iam_policy_document.kubecost_federated_bucket_policy.json
84+
tags = local.tags
8485

8586
lifecycle_rule = [
8687
{
@@ -128,7 +129,7 @@ module "kubecost_pod_identity" {
128129
associations = {
129130
kubecost = {
130131
## The name of the cluster to associate the Kubecost Platform pod identity with
131-
cluster_name = var.cluster_name
132+
cluster_name = module.eks.cluster_name
132133
## The namespace to associate the Kubecost Platform pod identity with
133134
namespace = try(var.kubecosts.namespace, "kubecosts")
134135
## The service account to associate the Kubecost Platform pod identity with
@@ -225,7 +226,7 @@ module "kubecost_agent_pod_identity" {
225226
associations = {
226227
kubecost = {
227228
## The name of the cluster to associate the Kubecost Agent pod identity with
228-
cluster_name = var.cluster_name
229+
cluster_name = module.eks.cluster_name
229230
## The namespace to associate the Kubecost Agent pod identity with
230231
namespace = try(var.kubecosts_agent.namespace, "kubecosts")
231232
## The service account to associate the Kubecost Agent pod identity with

0 commit comments

Comments
 (0)