Coder Social home page Coder Social logo

bernard357 / sustainable-personal-accounts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from reply-fr/sustainable-personal-accounts

1.0 0.0 0.0 15.15 MB

automate the control, the purge and the management of AWS accounts assigned permanently to selected employees - foster innovation from cloud teams

License: Apache License 2.0

Python 89.23% Makefile 1.66% Gherkin 9.12%

sustainable-personal-accounts's Introduction

Sustainable Personal Accounts

Sustainable Personal Accounts (SPA) automates AWS accounts assigned permanently to employees

With Sustainable Personal Accounts (SPA) control, purge and manage AWS accounts assigned permanently to employees of your enterprise.

sustainable-personal-accounts

As a CTO/CCoE Leader/R&D Director:

  • I recognize that innovative companies distribute sandbox AWS accounts to their staff
  • I provide AWS accounts to cloud practitioners of my enterprise
  • I manage these corporate resources at scale with SPA

As a person who benefits from a personal AWS account:

  • After authentication, I connect to my account with AWSAdministratorAccess permission,
  • A budget is set automatically to alert me by email,
  • Cloudbuild projects are executed on my behalf for purging cloud resources and for alignment with corporate policies.

As a DevOps in charge of SPA deployment:

  • I drive the behavior of SPA from a single YAML file with all settings,
  • I can adjust the Codebuild project used for account preparation to evolving corporate policies
  • I can adjust the Codebuild project used for account purge to evolving corporate policies
  • I can select when maintenance transactions are triggered,
  • I can define settings for each organizational unit for easy scaling
  • I can define settings for individual accounts for fine-grained tuning
  • I can integrate tags from CSV files communicated by other teams (e.g., FinOps, Security, Enterprise Architecture)

As a SRE in charge of SPA operations:

  • I can manage preventive controls on personal accounts with SCP
  • An automated CloudWatch dashboard covers technical and functional monitoring in one place
  • SPA activities, aka, console logins, account on-boarding, account maintenance, are reported as CSV files in S3 bucket every month
  • FinOps reports are produced every month as CSV and Excel files in S3 bucket
  • Management exceptions are managed interactively in Incident Manager
  • Instant cost report is attached to incident records for contextual analysis
  • Inventories of accounts are produced as CSV files in S3 bucket every week

As a FinOps engineer:

  • I receive cost reports every month in my mailbox
  • The Excel report consolidates costs per cost center and per organizational unit for easy analysis
  • The CSV report is processed with custom software for automated show-back and charge-back

SPA has been designed for AWS Organizations

Mandatory requirements:

  • SPA is leveraging AWS Organization for events management and for account management across AWS accounts. The deployment of AWS Organizations can be managed by Amazon Control Tower, but Amazon Control Tower itself is not mandatory.
  • SPA should be deployed on a dedicated AWS account. This facilitates the management of permissions accross a large number of AWS accounts, and contributes to the separation of concerns.
  • SPA needs an assume role with permissions on the AWS Organization
  • SPA needs an assume role with permissions within each AWS account that it manages

We recommend to deploy Amazon Control Tower and to benefit from cloud automation at scale on top of AWS Organizations, of AWS Service Catalog and of AWS IAM Identity Center (successor to AWS SSO). However, this is not a requirement for SPA, and you can deploy and use the solution without Amazon Control Tower.

Get started with Sustainable Personal Accounts

A set of workbooks are available for common operations on Sustainable Personal Accounts, such as:

Sustainable Personal Accounts features an event-driven serverless architecture

Persistence of states is done with tags set on AWS accounts. State transitions are handled with Eventbridge, Lambda, CodeBuild and DynamoDB. The management of the solution is done with CloudWatch, SSM Incident Manager, Cost Explorer and S3 reporting bucket.

architecture

Sustainable Personal Accounts has been designed with following principles:

  • the entire solution is configured with one single YAML file
  • the entire infrastructure is deployed with python code and AWS CDK
  • the configuration of organizational units and accounts is store in SSM Parameter Store
  • states of the state machine are implemented with tags on AWS accounts -- no database for state management
  • computing resources are entirely serverless, powered by Lambda functions and CodeBuild projects
  • processing is driven by events, powered by AWS EventBridge
  • budget alerts are consolidated over SQS
  • data persistence is provided with DynamoDB tables
  • the preparation of an AWS account is done with a customizable Codebuild project -- adapt it to your corporate policy
  • the purge of an AWS account is done with a customisable Codebuild project -- adapt it to your FinOps best practices
  • monitoring is implemented with a CloudWatch dashboard deployed automatically
  • system can be extended to specific needs via custom event processing

Sustainable Personal Accounts provides an integrated monitoring dashboard

cloudwatch-dashboard

The monitoring dashboard provides a combination of business indicators and of technical indocators:

  • daily costs per cost center
  • daily transactions per cost center
  • daily transactions per label
  • events by label
  • exceptions by label
  • invocations of Lambda functions
  • durations of Lambda executions
  • Lambda errors
  • read from DynamoDB tables
  • write to DynamoDB tables
  • errors with DynamoDB tables

Sustainable Personal Accounts interacts with human beings on exceptions

management-by-exception

Sustainable Personal Accounts provides a monitoring dashboard that can be checked when you want. But you do not need to keep your eyes on the monitoring dashboard. On an exceptional situation, SPA can post a message in a Microsoft Teams channel. It can also send you an alert over e-mail. You can come back anytime to SSM Incident Manager, where SPA will push incident records with tags and with contextualised cost reports.

Sustainable Personal Accounts integrates ticket management

incident-record

When an exceptional situation is encoutered, Sustainable Personal Accounts creates incident records in SSM Incident Manager. Examples of exceptions:

  • budget alert
  • console login with IAM User or with root credentials
  • failed maintenance transaction

On exception, SPA queries cost explorer and produces a report for on-going costs. The report is attached to the incident record for easy access. Also, each incident record is tagged so that you can use information items for problem management, or for transverse analysis of past incident records.

Sustainable Personal Accounts automates reporting

automated-reporting

Sustainable Personal Accounts produces following kinds of reports:

  • inventories of accounts - These reports in CSV format mention cost centers, Organizational Units, dates of last login, and account state. They can be used to detect unused accounts, and accounts that have not be released for some reason.

  • activities such as on-boarding, maintenance and console login - These reports in CSV format are provided to feed a downward system such as a database. They can be used for service analytics.

  • costs - These reports in CSV and in Excel formats are produced for managers of the service, and for managers of cost centers.

Reports are put on a S3 bucket for easy storage. Summary reports can also be transmitted over email to selected recipients, for example to the FinOps mailbox.

Sustainable Personal Accounts contributes to FinOps

cost-and-usage-reports

FinOps teams can get cost details per cost centers and per Organizational Units. This structure has proven very convenient, since it leverages the strcuture put in AWS Organisations itself.

Sustainable Personal Accounts is driven by configuration files

collaborative-configuration

Sustainable Personal Accounts is provisioned and configured from a single YAML file. Settings cover every aspect of the solution, for example the cron expression that triggers the maintenance window, the buildspec files for CodeBuild tasks on accounts.

In addition, part of the solution configuration can be delegated to CSV files. This architecture allows extended contributions to the settings of SPA

Any other question?

Please check the Frequent Asked Questions page, maybe your point has already been addressed there.

sustainable-personal-accounts's People

Contributors

bernard357 avatar bgauchon-reply avatar geoffroyrenaud avatar

Stargazers

Sennastien 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.