Documentation ¶
Index ¶
- Constants
- func WriteProjectsConfig(projects []Project) error
- type Action
- type ComponentDiff
- type IngestionJob
- type IngestionJobStatus
- type ModularStateDiff
- type ModuleDef
- type Project
- type ProviderName
- type ResourceDef
- type ResourceDiff
- type StateDiff
- type Submission
- type SubmissionV2
- type SubmissionsDiff
- type SubmissionsDiffV2
Constants ¶
const (
ConfigPath = "pennywise_projects_config.yaml"
)
Variables ¶
This section is empty.
Functions ¶
func WriteProjectsConfig ¶ added in v1.7.0
Types ¶
type ComponentDiff ¶ added in v1.7.0
type ComponentDiff struct { Component cost.Component Current *cost.Component CompareTo *cost.Component Action Action CostDiff decimal.Decimal }
ComponentDiff type to show diff of a Component
type IngestionJob ¶
type IngestionJobStatus ¶
type IngestionJobStatus string
const ( IngestionJobCreated IngestionJobStatus = "CREATED" IngestionJobInProgress IngestionJobStatus = "IN_PROGRESS" IngestionJobSucceeded IngestionJobStatus = "SUCCEEDED" IngestionJobFailed IngestionJobStatus = "FAILED" )
type ModularStateDiff ¶ added in v1.7.0
type ModularStateDiff struct { Resources map[string]ResourceDiff ChildModules map[string]ModularStateDiff PriorCost decimal.Decimal NewCost decimal.Decimal Action Action }
func (*ModularStateDiff) TotalResourcesCount ¶ added in v1.7.0
func (s *ModularStateDiff) TotalResourcesCount() int
type ModuleDef ¶ added in v1.7.0
type ModuleDef struct { Address string `json:"address"` ChildModules []ModuleDef `json:"child_modules"` Resources []ResourceDef `json:"resources"` }
ModuleDef is a single module definition.
type Project ¶ added in v1.7.0
type Project struct { ID string `yaml:"id"` Name string `yaml:"name"` CreatedAt time.Time `yaml:"created_at"` Directory string `yaml:"directory"` Description string `yaml:"description"` Tags map[string][]string `yaml:"tags"` LastSubmission time.Time `yaml:"last_submission"` SubmissionsIds []string `yaml:"submissions_ids"` }
func CreateProject ¶ added in v1.7.0
CreateProject creates a new project
func GetProjects ¶ added in v1.7.0
func (*Project) AddSubmission ¶ added in v1.7.0
func (p *Project) AddSubmission(sub Submission)
AddSubmission add a new submission to the project
type ProviderName ¶
type ProviderName string
const ( AzureProvider ProviderName = "azurerm" AWSProvider ProviderName = "aws" )
type ResourceDef ¶
type ResourceDef struct { Address string `json:"address"` Type string `json:"type"` Name string `json:"name"` RegionCode string `json:"region_code"` ProviderName ProviderName `json:"provider_name"` Values map[string]interface{} `json:"values"` }
ResourceDef is a single resource definition.
type ResourceDiff ¶ added in v1.7.0
type ResourceDiff struct { Address string Provider ProviderName Type string Skipped bool IsSupported bool ComponentDiffs map[string][]ComponentDiff PriorCost decimal.Decimal NewCost decimal.Decimal Action Action }
ResourceDiff type to show diff of a Resource
type Submission ¶ added in v1.7.0
type Submission struct { ID string `json:"id"` CreatedAt time.Time `json:"created_at"` ProjectId string `json:"project_id"` Resources []ResourceDef `json:"resources"` }
Submission to store and track resources and usage data for each run
func CreateSubmission ¶ added in v1.7.0
func CreateSubmission(resources []ResourceDef) (*Submission, error)
CreateSubmission creates a new submission to store resources and usage data
func GetLatestSubmission ¶ added in v1.7.0
func GetLatestSubmission() (*Submission, error)
func ReadSubmissionFile ¶ added in v1.7.0
func ReadSubmissionFile(id string) (*Submission, error)
ReadSubmissionFile Reads a submission from a file
func (*Submission) StoreAsFile ¶ added in v1.7.0
func (s *Submission) StoreAsFile() error
StoreAsFile stores the submission as a file in .pennywise/submissions directory
type SubmissionV2 ¶ added in v1.7.0
type SubmissionV2 struct { ID string `json:"id"` Version string `json:"version"` CreatedAt time.Time `json:"created_at"` ProjectId string `json:"project_id"` RootModule ModuleDef `json:"root_modules"` }
SubmissionV2 to store and track resources and usage data for each run
func CreateSubmissionV2 ¶ added in v1.7.0
func CreateSubmissionV2(module ModuleDef) (*SubmissionV2, error)
CreateSubmissionV2 creates a new version2 submission to store resources and usage data
func GetLatestSubmissionV2 ¶ added in v1.7.0
func GetLatestSubmissionV2() (*SubmissionV2, error)
func ReadSubmissionFileV2 ¶ added in v1.7.0
func ReadSubmissionFileV2(id string) (*SubmissionV2, error)
ReadSubmissionFileV2 Reads a submission from a file
func (*SubmissionV2) GetResources ¶ added in v1.7.0
func (s *SubmissionV2) GetResources() []ResourceDef
func (*SubmissionV2) StoreAsFile ¶ added in v1.7.0
func (s *SubmissionV2) StoreAsFile() error
StoreAsFile stores the submission as a file in .pennywise/submissions directory
type SubmissionsDiff ¶ added in v1.7.0
type SubmissionsDiff struct { Current Submission `json:"current"` CompareTo Submission `json:"compare_to"` }
type SubmissionsDiffV2 ¶ added in v1.7.0
type SubmissionsDiffV2 struct { Current SubmissionV2 `json:"current"` CompareTo SubmissionV2 `json:"compare_to"` }