All Projects → Bjorn248 → Terraform_cashier

Bjorn248 / Terraform_cashier

Licence: mit
Designed to analyze terraform template files and return a cost estimate of running the infrastructure, assuming AWS is the target cloud. Perhaps other clouds can be supported going forward?

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Terraform cashier

Terraform Eks
Terraform for AWS EKS
Stars: ✭ 82 (-27.43%)
Mutual labels:  aws, terraform
Toc
A Table of Contents of all Gruntwork Code
Stars: ✭ 111 (-1.77%)
Mutual labels:  aws, terraform
Terraform Aws Ecs Codepipeline
Terraform Module for CI/CD with AWS Code Pipeline and Code Build for ECS https://cloudposse.com/
Stars: ✭ 85 (-24.78%)
Mutual labels:  aws, terraform
Serverless static website with basic auth
Builds a serverless infrastructure in AWS for hosting a static website protected with Basic Authentication and published on a subdomain registered via Route 53
Stars: ✭ 112 (-0.88%)
Mutual labels:  aws, terraform
Terraform Aws Dynamic Subnets
Terraform module for public and private subnets provisioning in existing VPC
Stars: ✭ 106 (-6.19%)
Mutual labels:  aws, terraform
Mikado
🤖💨Mikado helps managing your AWS infrastructure for WordPress sites by defining an out-of-box, highly available, easy-to-deploy setup
Stars: ✭ 80 (-29.2%)
Mutual labels:  aws, terraform
Terraform Aws Rabbitmq
Terraform configuration for creating RabbitMQ cluster on AWS.
Stars: ✭ 86 (-23.89%)
Mutual labels:  aws, terraform
Terraform Aws Elasticache Redis
Terraform module to provision an ElastiCache Redis Cluster
Stars: ✭ 73 (-35.4%)
Mutual labels:  aws, terraform
Buildpipeline
AWS-powered serverless build, test and deploy pipeline ft. multiple environments
Stars: ✭ 105 (-7.08%)
Mutual labels:  aws, terraform
Typhoon
Minimal and free Kubernetes distribution with Terraform
Stars: ✭ 1,397 (+1136.28%)
Mutual labels:  aws, terraform
Terraform Ebs Attachmentizer
Convert ebs_block_device blocks in aws_instance resource to aws_ebs_volume and aws_volume_attachment resources
Stars: ✭ 79 (-30.09%)
Mutual labels:  aws, terraform
Terraform Aws Config
Enables AWS Config and adds managed config rules with good defaults.
Stars: ✭ 107 (-5.31%)
Mutual labels:  aws, terraform
Terraboard
🌍 📋 A web dashboard to inspect Terraform States
Stars: ✭ 1,192 (+954.87%)
Mutual labels:  aws, terraform
Terraform Aws Ecr
Terraform Module to manage Docker Container Registries on AWS ECR
Stars: ✭ 110 (-2.65%)
Mutual labels:  aws, terraform
Tf aws elasticsearch
Terraform module which creates AWS Elasticsearch resources
Stars: ✭ 73 (-35.4%)
Mutual labels:  aws, terraform
Ecs Pipeline
☁️ 🐳 ⚡️ 🚀 Create environment and deployment pipelines to ECS Fargate with CodePipeline, CodeBuild and Github using Terraform
Stars: ✭ 85 (-24.78%)
Mutual labels:  aws, terraform
Gitops Terraform Jenkins
GitOps Workflow with Jenkins and Terraform
Stars: ✭ 73 (-35.4%)
Mutual labels:  aws, terraform
Terraform Aws Couchbase
Reusable infrastructure modules for running Couchbase on AWS
Stars: ✭ 73 (-35.4%)
Mutual labels:  aws, terraform
Aws Minikube
Single node Kubernetes instance implemented using Terraform and kubeadm
Stars: ✭ 101 (-10.62%)
Mutual labels:  aws, terraform
Aws Ecs Airflow
Run Airflow in AWS ECS(Elastic Container Service) using Fargate tasks
Stars: ✭ 107 (-5.31%)
Mutual labels:  aws, terraform

terraform_cashier

Go Report Card Build Status codecov Maintainability

This uses https://github.com/Bjorn248/graphql_aws_pricing_api to get pricing data

Designed to analyze terraform template files and return a cost estimate of running the infrastructure, assuming AWS is the target cloud. Perhaps other clouds can be supported going forward?

NOTE: This only calculates the cost of EC2 and RDS resources right now. To add support for more resources, open a PR or leave a comment. I'm always looking for feedback.

This is very much in a prototype state right now. Any advice or assistance is appreciated.

Plan File

This relies on terraform plan files generated using terraform plan -out=<filename>. It is recommended that you plan against an empty state so that all of your resources are present in the plan file.

Empty/Blank state plan

If you are using remote state, you will need to disable this. I accomplish this by renaming the file that defines my remote state, appending the extension .off. Then, I have to run terraform init again to initialize a blank local state. Then I can generate a plan that contains all my resources using the following command terraform plan -out=<filename> -refresh=false.

Environment Variables

Variable Name Description
AWS_REGION The Region for which you want to create a price estimation (e.g. us-east-1)
TERRAFORM_PLANFILE Where cashier should find your terraform plan output.
RUNNING_HOURS (Optional) The number of running hours normally used in a month for your resources, on average. Defaults to 730 assuming 24/7 operation.
GRAPHQL_API_URL (Optional) Change the API URL that cashier uses. Defaults to live API Gateway URL.
PRINT_VERSION (Optional) If true will print current version of cashier and exit

Installation and usage

Simply download the latest release from the releases page here: https://github.com/Bjorn248/terraform_cashier/releases Make sure that the binary is set executable Set your environment variables appropriately

export TERRAFORM_PLANFILE="./terraform.plan"
export AWS_REGION="us-west-1"

And then run the cashier binary

If you wish to see the current version of cashier, use the following environment variable

PRINT_VERSION=true

Docker

The Docker image is not published on Docker Hub or any other registry provider, although you can build and use it locally.

Build

$ docker build -t local/cashier:0.0.1 .

Run

$ docker run -v $(pwd):/data local/cashier:0.0.1

Run using custom ENV_VARs

$ docker run --env AWS_REGION=us-east-1 --env TERRAFORM_PLANFILE=/data/terraform.plan -v $(pwd):/data local/cashier:0.0.1

Local Development

This project uses Go Modules for dependency management. go build should just work if your Go version supports modules.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].