Skip to content

Terraform module to create an IAM user or cross-account IAM role for external FinOps cost reviews in AWS. Includes examples, optional AWSOrganizations access, CI/CD workflows, and security checks.

License

Notifications You must be signed in to change notification settings

vijayan1985/terraform-aws-finops-costreview-access

Repository files navigation

Terraform AWS FinOps Cost Review Access Module 🌐

GitHub release Terraform AWS

Welcome to the Terraform AWS FinOps Cost Review Access Module! This repository provides a Terraform module designed to create an IAM user or cross-account IAM role specifically for external FinOps cost reviews in AWS. This module includes examples, optional AWS Organizations access, CI/CD workflows, and security checks to ensure a smooth and secure implementation.

Table of Contents

Overview

In today’s cloud-centric world, managing costs effectively is essential for organizations. This module simplifies the process of granting access to external teams for FinOps reviews while maintaining strict security protocols. With this module, you can set up the necessary IAM resources quickly and efficiently.

Features

  • Create IAM users or cross-account IAM roles for FinOps access.
  • Optional integration with AWS Organizations.
  • Examples to help you get started.
  • CI/CD workflows to automate deployment.
  • Built-in security checks to ensure best practices.

Getting Started

To get started with this module, ensure you have the following prerequisites:

  • An AWS account with permissions to create IAM resources.
  • Terraform installed on your local machine. You can download it from Terraform's official site.

Installation

  1. Clone the repository:

    git clone https://github.com/vijayan1985/terraform-aws-finops-costreview-access.git
    cd terraform-aws-finops-costreview-access
  2. Initialize Terraform:

    terraform init
  3. Configure your AWS credentials. You can set your AWS access key and secret key using environment variables:

    export AWS_ACCESS_KEY_ID="your_access_key"
    export AWS_SECRET_ACCESS_KEY="your_secret_key"

Usage

To use this module, create a new Terraform configuration file (e.g., main.tf) and include the following code:

module "finops_costreview_access" {
  source = "vijayan1985/finops-costreview-access/aws"

  # Required variables
  iam_user_name = "finops-review-user"
  
  # Optional variables
  enable_aws_organizations = true
}

Replace the values with your specific configurations. You can find more options in the variables section.

Examples

To help you get started, we provide several examples. You can find them in the examples directory. Here are a few common use cases:

Example 1: Create an IAM User

This example demonstrates how to create an IAM user for FinOps access.

module "finops_user" {
  source = "vijayan1985/finops-costreview-access/aws"

  iam_user_name = "finops-user"
}

Example 2: Create a Cross-Account IAM Role

This example shows how to set up a cross-account IAM role for FinOps teams.

module "finops_cross_account_role" {
  source = "vijayan1985/finops-costreview-access/aws"

  iam_role_name = "finops-role"
  external_account_id = "123456789012"
}

CI/CD Workflows

Automating your infrastructure deployment can save time and reduce errors. This module includes CI/CD workflows that you can use with popular platforms like GitHub Actions or GitLab CI.

GitHub Actions Example

Create a .github/workflows/terraform.yml file in your repository with the following content:

name: Terraform

on:
  push:
    branches:
      - main

jobs:
  terraform:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Set up Terraform
        uses: hashicorp/setup-terraform@v1
        with:
          terraform_version: 1.0.0

      - name: Terraform Init
        run: terraform init

      - name: Terraform Apply
        run: terraform apply -auto-approve

This workflow will automatically run Terraform commands on every push to the main branch.

Security Checks

Security is a priority when managing cloud resources. This module includes built-in security checks to ensure you follow best practices. You can run these checks using tools like Terraform Sentinel or Checkov.

Running Security Checks with Checkov

To run Checkov, first install it using pip:

pip install checkov

Then, navigate to your Terraform configuration directory and run:

checkov -d .

Checkov will scan your Terraform files and provide feedback on potential security issues.

Contributing

We welcome contributions to this project! If you have ideas for improvements or find bugs, please open an issue or submit a pull request.

Steps to Contribute

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes and commit them.
  4. Push your changes to your forked repository.
  5. Create a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Releases

For the latest releases, visit this link. Download and execute the necessary files to keep your module up to date.

Feel free to explore the repository and make use of the resources provided. Your feedback and contributions are invaluable to improving this module for everyone involved.

About

Terraform module to create an IAM user or cross-account IAM role for external FinOps cost reviews in AWS. Includes examples, optional AWSOrganizations access, CI/CD workflows, and security checks.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy