Create an automation script that will fix the cloudhealth status for an ENTERPRISE AWS Accounts from warning to healthy by updating the policies for every AWS account that has an status of “warning”. Used AWS Accounts API, CloudHealth Accounts API, and AWS CLI, it was written in ruby.
The program should update the policy in AWS accordingly, such that updating a new version of the policy by uploading a json file (v2.json). 📄
- location of the v2.json in your system
- location of the your config file
- Update the location of your config file
- Update the location of your v2.json file
File.read('C:\Users\kougav01.aws\config')
File.open('C:\Users\v2.json', 'w')
- Get all the accounts that have an status warning of yellow in CloudHealth
- Get all the Enterprise AWS accounts that belong to Enterprise
- Produce a array that contains both AWS RH with AWS CloudHealth
- Loop through each RH AWS ACCOUNT that has an status of Yellow, but updating v2.json with the proper cloudtrail tag