Documentation ¶
Index ¶
- Constants
- Variables
- type Accounter
- type AccountsService
- type AuthService
- type Authenticater
- type DeployConfig
- type DeployOverrides
- type DeployService
- type Deployer
- type InitService
- type Initer
- type LeaseLoginOptions
- type Leaser
- type LeasesService
- func (s *LeasesService) CreateLease(principalID string, budgetAmount float64, budgetCurrency string, ...)
- func (s *LeasesService) EndLease(accountID, principalID string)
- func (s *LeasesService) GetLease(leaseID string)
- func (s *LeasesService) ListLeases(acctID, principalID, nextAcctID, nextPrincipalID, leaseStatus string, ...)
- func (s *LeasesService) Login(opts *LeaseLoginOptions)
- func (s *LeasesService) LoginByID(leaseID string, opts *LeaseLoginOptions)
- type ServiceContainer
- type UsageService
- type Usager
Constants ¶
View Source
const AssetsFileName = "build_artifacts.zip"
View Source
const LeasesPath = "/leases"
Variables ¶
View Source
var ApiClient utl.APIer
View Source
var Out observ.OutputWriter
Functions ¶
This section is empty.
Types ¶
type AccountsService ¶
type AccountsService struct { Config *configs.Root Observation *observ.ObservationContainer Util *utl.UtilContainer }
func (*AccountsService) AddAccount ¶
func (s *AccountsService) AddAccount(accountID, adminRoleARN string)
func (*AccountsService) GetAccount ¶
func (s *AccountsService) GetAccount(accountID string)
func (*AccountsService) ListAccounts ¶
func (s *AccountsService) ListAccounts()
ListAccounts lists the accounts
func (*AccountsService) RemoveAccount ¶
func (s *AccountsService) RemoveAccount(accountID string)
type AuthService ¶
type AuthService struct { Config *configs.Root Observation *observ.ObservationContainer Util *utl.UtilContainer }
func (*AuthService) Authenticate ¶
func (s *AuthService) Authenticate() error
type Authenticater ¶
type Authenticater interface {
Authenticate() error
}
type DeployConfig ¶ added in v0.5.0
type DeployConfig struct { // Path to the DCE repo to deploy // May be a local file path (eg. /path/to/dce) // or a github repo (eg. github.com/Optum/dce) Location string // Version of DCE to deploy, eg 0.12.3 Version string // BatchMode, if enabled, forces DCE to run non-interactively // and supplies Terraform with -auto-approve and input=false BatchMode bool // TFInitOptions are options passed along to `terraform init` TFInitOptions string // TFApplyOptions are options passed along to `terraform apply` TFApplyOptions string // SaveTFOptions, if yes, will save the provided terraform options to the config file. SaveTFOptions bool // File location for deployment logs DeployLogFile string // Terraform variables to pass through to the DCE module AWSRegion string GlobalTags []string Namespace string BudgetNotificationFromEmail string BudgetNotificationBCCEmails []string BudgetNotificationTemplateHTML string BudgetNotificationTemplateText string BudgetNotificationTemplateSubject string }
type DeployOverrides ¶
type DeployOverrides struct { AWSRegion string GlobalTags []string Namespace string BudgetNotificationFromEmail string BudgetNotificationBCCEmails []string BudgetNotificationTemplateHTML string BudgetNotificationTemplateText string BudgetNotificationTemplateSubject string DCEVersion string // Location of the DCE terraform module DCEModulePath string }
type DeployService ¶
type DeployService struct { Config *configs.Root Observation *observ.ObservationContainer Util *utl.UtilContainer }
func (*DeployService) Deploy ¶
func (s *DeployService) Deploy(deployConfig *DeployConfig) error
Deploy writes the local `main.tf` file, using the overrides, and then calls Terraform init and apply using configuration directory (`~/.dce`) as the working folder and location of local state.
func (*DeployService) PostDeploy ¶ added in v0.4.0
func (s *DeployService) PostDeploy(deployConfig *DeployConfig) error
PostDeploy is intended to run after a successful call to Deploy()
type Deployer ¶
type Deployer interface { Deploy(input *DeployConfig) error PostDeploy(input *DeployConfig) error }
type InitService ¶
type InitService struct { Config *configs.Root Observation *observ.ObservationContainer Util *utl.UtilContainer }
func (*InitService) InitializeDCE ¶
func (s *InitService) InitializeDCE()
type LeaseLoginOptions ¶ added in v0.5.0
type Leaser ¶
type Leaser interface { CreateLease(principalID string, budgetAmount float64, budgetCurrency string, email []string, expiresOn string) EndLease(accountID, principalID string) LoginByID(leaseID string, opts *LeaseLoginOptions) Login(opts *LeaseLoginOptions) ListLeases(acctID, principalID, nextAcctID, nextPrincipalID, leaseStatus string, pagLimit int64) GetLease(leaseID string) }
type LeasesService ¶
type LeasesService struct { Config *configs.Root Observation *observ.ObservationContainer Util *utl.UtilContainer }
func (*LeasesService) CreateLease ¶
func (*LeasesService) EndLease ¶
func (s *LeasesService) EndLease(accountID, principalID string)
func (*LeasesService) GetLease ¶
func (s *LeasesService) GetLease(leaseID string)
func (*LeasesService) ListLeases ¶
func (s *LeasesService) ListLeases(acctID, principalID, nextAcctID, nextPrincipalID, leaseStatus string, pagLimit int64)
func (*LeasesService) Login ¶ added in v0.5.0
func (s *LeasesService) Login(opts *LeaseLoginOptions)
func (*LeasesService) LoginByID ¶ added in v0.5.0
func (s *LeasesService) LoginByID(leaseID string, opts *LeaseLoginOptions)
type ServiceContainer ¶
type ServiceContainer struct { Config *configs.Root Observation *observ.ObservationContainer Util *utl.UtilContainer Deployer Accounter Leaser Initer Authenticater Usager }
ServiceContainer is a service that injects its config and util into other services
func New ¶
func New(config *configs.Root, observation *observ.ObservationContainer, util *utl.UtilContainer) *ServiceContainer
New returns a new ServiceContainer given config
type UsageService ¶
type UsageService struct { Config *configs.Root Observation *observ.ObservationContainer Util *utl.UtilContainer }
func (*UsageService) GetUsage ¶
func (s *UsageService) GetUsage(startDate, endDate float64)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.