Giter VIP home page Giter VIP logo

azure-terraform-infracost's Introduction

Automating Cloud Cost Management with Terraform

This repository is part of the presentation "Automating Cloud Cost Management with Terraform" presented at the Cloud Conference Day 2023. For more information about the presentation, please visit here.

GitHub Action Integration

This code serves as a practical example of how to integrate Infracost with your GitHub Action workflow to receive cost estimates directly in Pull Requests.

How to Use This Code

1. Configuration of Secrets

The first step for integration is to create the necessary secrets in your project's repository if you don't mind. Be sure to add the following secrets:

  • ARM_CLIENT_ID: ID for the service principal created in Microsoft Azure.
  • ARM_CLIENT_SECRET: Secret for the service principal created in Microsoft Azure.
  • ARM_SUBSCRIPTION_ID: ID of the subscription where you plan to deploy resources.
  • ARM_TENANT_ID: Tenant ID where you plan to deploy resources.
  • INFRACOST_API_KEY: Infracost API key for integration.

2. Using the Cost Management Workflow

After configuring the secrets, follow the steps below to use the cost management workflow:

  • Create a new branch in your repository and make the necessary code changes.
  • Create a Pull Request on GitHub with your changes.
  • After creating the Pull Request, the PLAN workflow will be automatically triggered.
  • You can view the Infracost cost estimate in the comments of the Pull Request.

3. To destroy resources

To destroy the resources deployed by the workflow, you need to trigger the destroy action (destroy.yml) manually.

Make sure to review the cost estimates to ensure that your changes will not adversely affect the project's budget.

Take advantage of the Infracost integration to make informed decisions about the costs associated with changes in cloud infrastructure!

If you have any questions or need additional help, please don't hesitate to contact me.

Do you like my open source projects? Nominate me to Github Stars โญ

๐Ÿ“ License

This project is under MIT License.

azure-terraform-infracost's People

Contributors

asilvajunior avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.