Skip to content

Commit

Permalink
Lookup tags to pass to karpenter CRD
Browse files Browse the repository at this point in the history
  • Loading branch information
mcgin314 committed Sep 13, 2024
1 parent 7ffc8b8 commit 0b9b0ad
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ resource "aws_iam_service_linked_role" "ec2_spot" {
aws_service_name = "spot.amazonaws.com"
}

# Get the default tags from the provider
data "aws_default_tags" "default_tags" {}

# SHOULD PROBABLY PUT THESE OBJECTS INTO A HELM CHART
# Create karpenter default
resource "kubectl_manifest" "karpenter_ec2_node_class" {
Expand All @@ -200,7 +203,7 @@ resource "kubectl_manifest" "karpenter_ec2_node_class" {
]
yaml_body = templatefile("${path.module}/ec2_node_class.yaml.tpl", {
cluster_name = var.cluster_name
tags = jsonencode(var.tags)
tags = jsonencode(data.aws_default_tags.default_tags.tags)
amd_ami_family = "Bottlerocket"
amd_ami_alias = "bottlerocket"
})
Expand Down

0 comments on commit 0b9b0ad

Please sign in to comment.