@elastic2ls/finops-access
v1.0.0
Published
AWS CDK construct for setting up IAM user or role for FinOps cost review access
Readme
aws-cdk-finops-costreview-access
📦 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 constructsExample 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
- Fork the repo
- Create a feature branch
- Commit changes
- Push & create PR
📄 License
MIT — see LICENSE
