Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws: add support for elasticache resource #68

Merged
merged 12 commits into from
Mar 22, 2022
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