/hygieia-iac-terraform-collector

[WIP] - Terraform Infrastructure as Code Collector for Hygieia

Primary LanguageJavaApache License 2.0Apache-2.0

Due to lack of activity, this repo is currently not being supported and is archived as of 07/12/22. Please note since archival, the project is not maintained and will be available in a read-only state. Please reach out to hygieia2@capitalone.com should you have any questions.

A collector to showcase the Terraform Cloud App details

https://app.terraform.io

How is Terraform App Organized?

Each Terraform app has Organization > Workspace > run jobs * Organization : Model to store the Organization details from Terraform Cloud App * Workspace : Model to Store Workpsace belonging to an Organizatiion from Terrafrom Cloud App * Run : Model to Store Runs belonging to an Workpsace from Terrafrom Cloud App * TerraformCollectorItem: The class extending the CollectorItem storing only the apiToken, which is enough to call the Terraform Cloud Apis

Which API this collector calls?

The Workspace Cloud App by Terraform provide REST api to call and share details about Organizatiion, Workspace & Run Jobs

What data this collector Stores?

This Collector stores data as Organization, Workspace & Run (The same model are provided in domain) https://www.terraform.io/docs/cloud/api/workspaces.html

Technical Description

The Classes and the description Terraform Controller: To expose the api calls made from UI to get the Component Data TerraformCollectorTask : As with the framework , implemeting Collector Task to regulary collect the details from Terraform Cloud App and feed into the MongoDb TeraafromServiceImpl: To populate the componentData mdel and send back to UI TerraformCustomRepository: A MongoTemplate based repository, to do some aggrrgate group by queries against mondo db

To build docker & mounting the application.properties while docker build

docker run -t -i -p port-internal:port-external -v properties_location://hygieia/config image_name