Skip to content

elastic2ls-com/aws-cdk-finops-costreview-access

Repository files navigation

aws-cdk-finops-costreview-access

License
Status
Sponsor
Website

📦 Overview

aws-cdk-finops-costreview-access is an AWS CDK construct library to provision IAM resources for FinOps cloud cost reviews.

🚀 Features

  • Create IAM user or IAM role with optional external account trust
  • Attach AWS managed policies for Billing, CloudWatch, Organizations
  • Supports naming overrides
  • Works with CDK v2 (aws-cdk-lib)
  • CI/CD ready

📖 Usage

Install

npm install aws-cdk-lib constructs

Example CDK Stack

import { App } from 'aws-cdk-lib';
import { FinOpsStack } from '../lib/finops-stack';

const app = new App();
new FinOpsStack(app, 'FinOpsStack');

Example Construct

import { Stack, StackProps } from 'aws-cdk-lib';
import { Construct } from 'constructs';
import { FinOpsAccess } from './finops-access';

export class FinOpsStack extends Stack {
  constructor(scope: Construct, id: string, props?: StackProps) {
    super(scope, id, props);

    new FinOpsAccess(this, 'FinOpsAccess', {
      mode: 'iam-user',
      userName: 'finops-review-user',
      roleName: 'finops-review-role',
      attachOrganizationsPolicy: true,
      serviceProviderAccountId: '123456789012',
    });
  }
}

🏗 Setup

npm install
npm run build
npx cdk synth
npm test

✅ GitHub Actions

  • Node.js setup (.nvmrc)
  • Dependency install
  • Build
  • CDK synth
  • Jest tests

📂 Project Structure

.
├── bin/app.ts
├── lib/finops-stack.ts
├── .github/workflows/cdk.yml
├── package.json
├── tsconfig.json
├── jest.config.js
├── .nvmrc
├── .gitignore
├── cdk.json

💬 Contributing

  1. Fork the repo
  2. Create a feature branch
  3. Commit changes
  4. Push & create PR

📄 License

MIT — see LICENSE

About

AWS CDK construct to provision IAM users and roles for external FinOps cost reviews with least-privilege access.

Topics

Resources

License

Stars

Watchers

Forks

Packages