Code Monkey home page Code Monkey logo

aws-tags-monitorization's Introduction

AWS Untagged Resources S3 and Email report

This project use AWS CostExplorer csv reports to extract untagged resources. Use a cloudwatch rule to execute a lambda function who read cost explorer reports (always the last 1324-aws-billing-detailed-line-items-with-resources-and-tags-yyyy-mm.csv.zip file) and generate another csv report with the untagged resources, save them on s3 and send it on an email using AWS SES service.

The architecture diagram is:

Image arch

AWS have an API called resourcegroupstaggingapi but this one doesn't return resources who never have been tagged.

The purpose of this project is: based on custom tags defined on your account to identify your costs. Check automatically resources who doesn't have this custom tags, or never have been tagged.

Email and Txt template for report can be modified on files 'emailHtml.html' and 'emailText.txt'

CSV reports saved on S3 and cost explorer files are migrated to ONEZONE_IA after 30 days and deleted after 180 days. If needed remove LifecycleConfiguration on the CF definition of costsS3Bucket resource.

Properties definitions

Before deploy, edit the next values on file serverless.yml:

  • notificationEmail = Email where to send the reports, separated by comma if need to add more
  • senderEmail = Email sender
  • subject = Subject text for email report
  • bucketName = The name of the new bucket where to store cost reports and untagged csv reports files
  • reportCron = Cron expression for report execution. More info for sintax on: ScheduledEvents
  • customTags = Custom tags defined for cost explorer
  • stackTags: Use your own tags for identify the resources this stack create on you AWS account

Considerations

AWS SES service need to verify the emails addresses used on senderEmail and notificationEmail. More information on:

On your AWS Account, billing reports 'Detailed Billing Reports [Legacy]' must be enabled and configured after deploy. More information on: https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/configurecostallocreport.html

Usage

sls deploy
  • On your AWS account, on Billing preference, section 'Detailed Billing Reports [Legacy]', especify the s3 bucket created with 'bucketName' and check the option 'Detailed billing report with resources and tags*'

References:

aws-tags-monitorization's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

vibano007

aws-tags-monitorization's Issues

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.