Instances, volumes, snapshots, RDS, security groups, elastic IPs and beyond. A single report to get all the invaluable information that will keep you informed to make critical and quick decisions.
The guys from powerupcloud shared an initial script in their blog which they put in github. I forked it and after some tweaks found it so useful that I decided to ask the author for a pull request. The new Lambda Function:
* Adds support for environment variables * Adds security groups listing * Removes hardcoded and non generic names * Corrects some comments * Retrieves the ownerId instead of hardcoding it * Adds the description for volumes for clearer identification * Lists the Elastic IPs with the instanceId the are assigned to for clearer identification * Has a TODO ;-: Naming conventions should be establishedHere is a quick start:
- Create IAM role | Name:Inventory; Role Type: AWSLambda; Policy: EC2ReadOnly, AmazonS3FullAccess, AmazonRDSReadOnlyAccess
- Create S3 bucket | Name: YourInventoryS3Name
- Create Lambda | Name: YourInventoryLambda; Description: Extracts the AWS Inventory; Runtime: Python; Role: Inventory; Timeout: 3 min; environment variables: SES_SMTP_USER, SES_SMTP_PASSWORD, S3_INVENTORY_BUCKET, MAIL_FROM, MAIL_TO
- Schedule the Lambda: Select Lambda | Trigger | Add Trigger | CloudWatch Events - Schedule | Rule Name: InventorySchedulerRule; Rule Description: Inventory Scheduler Rule; Schedule Expression: cron(0 14 ? * FRI *) if you want it to run every Friday at 9AM ET| Enable Trigger | Submit
- Verify the domain: SES | Manage Entities | Verify a New Domain ; yourdomain.com
- Follow the instructions. To complete the verification you must add several TXT/CNAME records to your domain's DNS settings
- Verify email addresses: SES | hit the domain | Verify a New Email Address | Confirm from email
- After getting confirmation go to SES | SMTP Settings | Create my SMTP Credentials | Provide a username like ‘anyusername’ for example and Amazon will show you the credentials (SMTP Username and SMTP Password). Keep them in safe place. You can also download them. This is the last time AWS will share them with you.