Skip to content

Commit

Permalink
docs: Adding Kubecost on docs/patterns (#1867)
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigobersa authored Jan 26, 2024
1 parent 5296f9a commit d0c875e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
7 changes: 7 additions & 0 deletions docs/patterns/kubecost.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: Kubecost
---

{%
include-markdown "../../patterns/kubecost/README.md"
%}
27 changes: 22 additions & 5 deletions patterns/kubecost/run-me-in-24h/main.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
terraform {
required_version = ">= 1.0"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.47"
}
time = {
source = "hashicorp/time"
version = "0.10.0"
}
null = {
source = "hashicorp/null"
version = "3.2.2"
}
}
}

provider "aws" {
region = local.region
}
data "aws_caller_identity" "current" {}
data "aws_availability_zones" "available" {}

data "terraform_remote_state" "main" {
backend = "local"
Expand All @@ -25,7 +42,7 @@ locals {

resource "null_resource" "download_file" {
triggers = {
always_run = "${timestamp()}"
always_run = timestamp()
}

provisioner "local-exec" {
Expand All @@ -48,9 +65,9 @@ resource "time_sleep" "wait_60_seconds" {
resource "aws_cloudformation_stack" "athena_integration" {
count = fileexists("${path.module}/crawler-cfn.yml") ? 1 : 0

name = "kubecost"
name = "kubecost"
template_body = try(file("${path.module}/crawler-cfn.yml"), null)
capabilities = ["CAPABILITY_IAM"]

depends_on = [null_resource.download_file, time_sleep.wait_60_seconds]
}
}

0 comments on commit d0c875e

Please sign in to comment.