Please note, this needs to either be deployed in the master payer account of your organization. Or in a delegated administrator accounts.
You can also use this module within an AWS Lambda function. And those AWS Lambda functions can then be orchestrated using Step Functions.
The definition of the state machine can be found here: cloudformation/state_machine.asl.json
.
The first lambda will use the package to read the entire organization, the sample code can be found here: cloudformation/read_organization/index.py
.
Next we can extract a list of workloads running within the organization, the sample code can be found here: cloudformation/list_workloads/index.py
.
You can deploy the cloudformation/template.yaml
template using AWS SAM.