Documentation
¶
Overview ¶
Package cloudsweeper is where all the 'sweeping logic is defined. Such as what to notify about and what to clean up. For using Cloudsweeper in larger organizations, the Organization structure was implemeted.
Index ¶
- type AWSAccount
- type AWSAccounts
- type Department
- type Departments
- type Employee
- type Employees
- type GCPProject
- type GCPProjects
- type Organization
- func (org *Organization) AccountToUserMapping(csp cloud.CSP) map[string]string
- func (org *Organization) EmployeesForManager(manager *Employee) (Employees, error)
- func (org *Organization) EnabledAccounts(csp cloud.CSP) []string
- func (org *Organization) UsernameToEmployeeMapping() map[string]*Employee
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AWSAccount ¶
type AWSAccount struct {
ID string `json:"id"`
CloudsweeperEnabled bool `json:"cloudsweeper_enabled,omitempty"`
}
AWSAccount represents an account in AWS. An account can have automatic cleanup enabled, indiacated by the CloudsweeperEnabled attribute.
type Department ¶
type Department struct {
Number int `json:"number"`
ID string `json:"id"`
Name string `json:"name"`
}
Department represents a department in your org
type Employee ¶
type Employee struct {
Username string `json:"username"`
RealName string `json:"real_name"`
ManagerID string `json:"manager"`
Manager *Employee `json:"-"`
DepartmentID string `json:"department"`
Department *Department `json:"-"`
Disabled bool `json:"disabled,omitempty"`
AWSAccounts AWSAccounts `json:"aws_accounts"`
GCPProjects GCPProjects `json:"gcp_projects"`
}
Employee represents an employee, which belong to a department and has a manager. An employee can also have multiple accounts and projects associated with them in AWS and GCP. "Disabled" employees are employees who should no longer be regarded as active in the company
type GCPProject ¶
type GCPProject struct {
ID string `json:"id"`
CloudsweeperEnabled bool `json:"cloudsweeper_enabled,omitempty"`
}
GCPProject represents a project in GPC. A project can have automatic cleanup enabled, indiacated by the CloudsweeperEnabled attribute.
type Organization ¶
type Organization struct {
Managers Employees `json:"-"`
ManagerIDs []managerID `json:"managers"`
Departments Departments `json:"departments"`
Employees Employees `json:"employees"`
// contains filtered or unexported fields
}
Organization represents the employees, their departments, and their managers within an organization. This structure was set up for an org wherein all employees have their own cloud accounts, and are aggregated under a single payer account. In the case you have only a single account, this will be superfluous.
func InitOrganization ¶
func InitOrganization(orgData []byte) (*Organization, error)
InitOrganization initializes an organisation from raw data, e.g. the contents of a JSON file.
func (*Organization) AccountToUserMapping ¶
func (org *Organization) AccountToUserMapping(csp cloud.CSP) map[string]string
AccountToUserMapping is a helper method that maps accounts to their owners username. This is useful for sending out emails to the owner of an account.
func (*Organization) EmployeesForManager ¶
func (org *Organization) EmployeesForManager(manager *Employee) (Employees, error)
EmployeesForManager gets all the employees who has the specifed manager as their manager.
func (*Organization) EnabledAccounts ¶
func (org *Organization) EnabledAccounts(csp cloud.CSP) []string
EnabledAccounts will return a list of all cloudsweeper enabled accounts in the specified CSP
func (*Organization) UsernameToEmployeeMapping ¶
func (org *Organization) UsernameToEmployeeMapping() map[string]*Employee
UsernameToEmployeeMapping is a helper method that returns a map of username to Employee struct.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package find is containing functionality to find more information about a cloud resource given its ID.
|
Package find is containing functionality to find more information about a cloud resource given its ID. |
|
Package notify is responsible for all actions related to notifying employees and managers about their resources.
|
Package notify is responsible for all actions related to notifying employees and managers about their resources. |