Skip to content

Commit

Permalink
fix: add aws provider to karpenter s3 template
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Telles committed Jul 26, 2023
1 parent 2e93969 commit d3a5680
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions utils/templates/karpenter_custom_addon_boostrap.tf.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ spec:
manifestHash: "{{ .ManifestHash }}"
EOF
key = "{{ .ClusterName }}/custom-addons/addon.yaml"
provider = aws.files
}

resource "aws_s3_object" "custom-addon-karpenter-provisioners" {
bucket = "{{ .Bucket }}"
content = file("${path.module}/data/aws_s3_object_karpenter_provisioners_content")
key = "{{ .ClusterName }}/custom-addons/karpenter-provisioners.wildlife.io/provisioners.yaml"
provider = aws.files
}


2 changes: 2 additions & 0 deletions utils/templates/tests/karpenter_custom_addon_boostrap.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ spec:
manifestHash: "785169a7d4ba0221779cd95ad7701652642e46b8408e641d54bacc100ab5fe9e"
EOF
key = "test-cluster.test.k8s.cluster/custom-addons/addon.yaml"
provider = aws.files
}

resource "aws_s3_object" "custom-addon-karpenter-provisioners" {
bucket = "tests"
content = file("${path.module}/data/aws_s3_object_karpenter_provisioners_content")
key = "test-cluster.test.k8s.cluster/custom-addons/karpenter-provisioners.wildlife.io/provisioners.yaml"
provider = aws.files
}


4 changes: 2 additions & 2 deletions utils/terraform_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ func ApplyTerraform(ctx context.Context, workingDir, terraformExecPath string, c
env := map[string]string{
"AWS_ACCESS_KEY_ID": credentials.AccessKeyID,
"AWS_SECRET_ACCESS_KEY": credentials.SecretAccessKey,
"SPOTINST_TOKEN": os.Getenv("SPOTINST_TOKEN"),
"SPOTINST_ACCOUNT": os.Getenv("SPOTINST_ACCOUNT"),
"SPOTINST_TOKEN": os.Getenv("SPOTINST_TOKEN"),
"SPOTINST_ACCOUNT": os.Getenv("SPOTINST_ACCOUNT"),
}

// this overrides all ENVVARs that are passed to Terraform
Expand Down

0 comments on commit d3a5680

Please sign in to comment.