diff --git a/docs/patterns/kubecost.md b/docs/patterns/kubecost.md new file mode 100644 index 0000000000..5216d888ca --- /dev/null +++ b/docs/patterns/kubecost.md @@ -0,0 +1,7 @@ +--- +title: Kubecost +--- + +{% + include-markdown "../../patterns/kubecost/README.md" +%} diff --git a/patterns/kubecost/run-me-in-24h/main.tf b/patterns/kubecost/run-me-in-24h/main.tf index 89c5cfbf6d..eca1abe05e 100644 --- a/patterns/kubecost/run-me-in-24h/main.tf +++ b/patterns/kubecost/run-me-in-24h/main.tf @@ -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" @@ -25,7 +42,7 @@ locals { resource "null_resource" "download_file" { triggers = { - always_run = "${timestamp()}" + always_run = timestamp() } provisioner "local-exec" { @@ -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] -} \ No newline at end of file +}