Skip to content

Commit

Permalink
Merge pull request #68 from cycloidio/aws-elasticache
Browse files Browse the repository at this point in the history
 aws: add support for elasticache resource
  • Loading branch information
talset authored Mar 22, 2022
2 parents 4c0178d + a582f56 commit ddec684
Show file tree
Hide file tree
Showing 26 changed files with 1,235 additions and 277 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
## [Unreleased]

### Added

- AWS support for `aws_eip`, `aws_aws_elasticache_cluster`, `aws_elasticache_replication_group`
([Pull #68](https://github.com/cycloidio/terracost/pull/68))

### Changed

- AWS ingester change to keep consistency between name from CSV
([Pull #68](https://github.com/cycloidio/terracost/pull/68))

## [0.5.0] _2022-01-18_

### Added
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ file, err := os.Open("path/to/tfplan.json")
plan, err := terracost.EstimateTerraformPlan(ctx, backend, file)

for _, res := range plan.ResourceDifferences() {
fmt.Printf("%s: %s -> %s\n", res.Address, res.PriorCost().String(), res.PlannedCost().String())
priorCost, err := res.PriorCost()
plannedCost, err := res.PlannedCost()

fmt.Printf("%s: %s -> %s\n", res.Address, priorCost, plannedCost)
}
```

Expand Down
52 changes: 25 additions & 27 deletions aws/field/field.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,34 @@ type Field uint8

// List of fields used by the AWS pricing offer file (CSV).
const (
SKU Field = iota // SKU
OfferTermCode // OfferTermCode
RateCode // RateCode
PurchaseOption // TermType
PriceDescription // PriceDescription
EffectiveDate // EffectiveDate
StartingRange // StartingRange
EndingRange // EndingRange
Unit // Unit
PricePerUnit // PricePerUnit
Currency // Currency
TermLength // LeaseContractLength
TermPurchaseOption // PurchaseOption
TermOfferingClass // OfferingClass
ProductFamily // Product Family
ServiceCode // serviceCode
Location // Location
InstanceType // Instance Type
StorageMedia // Storage Media
VolumeType // Volume Type
Tenancy // Tenancy
OperatingSystem // Operating System
UsageType // usageType
CapacityStatus // CapacityStatus
PreInstalledSW // Pre Installed S/W
VolumeAPIName // Volume API Name
///// Product Attributes /////
SKU Field = iota // SKU
CapacityStatus // CapacityStatus
Group // Group
InstanceType // Instance Type
Location // Location
OperatingSystem // Operating System
PreInstalledSW // Pre Installed S/W
ProductFamily // Product Family
ServiceCode // serviceCode
Tenancy // Tenancy
UsageType // usageType
VolumeAPIName // Volume API Name
VolumeType // Volume Type

// ElastiCache
CacheEngine // Cache Engine

// RDS fields
DatabaseEngine // Database Engine
DatabaseEdition // Database Edition
LicenseModel // License Model
DeploymentOption // Deployment Option
LicenseModel // License Model

///// Price Attributes /////
Currency // Currency
PricePerUnit // PricePerUnit
StartingRange // StartingRange
TermType // TermType
Unit // Unit
)
216 changes: 94 additions & 122 deletions aws/field/field_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ddec684

Please sign in to comment.