Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Support tier rating #4

Open
1 task
chargio opened this issue May 23, 2018 · 4 comments
Open
1 task

Support tier rating #4

chargio opened this issue May 23, 2018 · 4 comments
Labels
enhancement New feature or request

Comments

@chargio
Copy link
Contributor

chargio commented May 23, 2018

User Story

As a user, I want to be able to define rates that use tiers so that I can replicate costs in the cloud.

Impacts

API, Docs

Role

Engine

Assumptions

  • Tiers are defined in a way that no overlap exist.

Acceptance Criteria

  • User rates some consumption with a rate that uses tiers, and tiers are applied properly

Rate are defined as a group of tiers (that can go to Infinite).

TierUnit: the Unit that defines what tiers are we using. If it does not exist (nil), it is the variable Unit.
Tiers are defined as components of an SKU price in AWS, modified by an offerTermCode (Tier == OfferTerm)

BeginRange: Integer
EndRange: Integer (can be Infinite - Inf)
Unit: The Unit for the input value (i.e. Quantity, Dollar)
PricePerUnit: variable price to be used
PriceFixed: fixed price to be used (AWS refers to it as quantity = 1, and a price)

Price Plan has many Rates
Rate has many Tiers

@chargio chargio added the enhancement New feature or request label May 23, 2018
@chambridge
Copy link
Collaborator

How do the tiers get defined? A previous story mentioned no db, so I'm not clear what this issue is trying to do? Is it passed some consumption data (what is the format) and tier data and then provides cost as output?

@chargio
Copy link
Contributor Author

chargio commented May 23, 2018

https://github.com/project-koku/kokudaka/wiki/Tier

The tiers need to be defined as part of the price plan. Input value, start, end.

@chargio
Copy link
Contributor Author

chargio commented May 24, 2018

Example from mobile analytics in AWS that we need to replicate:

For Amazon, tiers are defined with the same unit than the input.

SKU: unique for product price
priceDimensions: different rates that are applied within the SKU, includes Tier definition
beginRange..endRange. (0 to 1M, 1M - Infinity)
unit: "Activitites"
PricePerUnit (including currency)

{
  "formatVersion" : "v1.0",
  "disclaimer" : "This pricing list is for informational purposes only. All prices are subject to the additional terms included in the pricing pages on http://aws.amazon.com. All Free Tier prices are also subject to the terms included at https://aws.amazon.com/free/",
  "offerCode" : "mobileanalytics",
  "version" : "20170419201859",
  "publicationDate" : "2017-04-19T20:18:59Z",
  "products" : {
    "HVG2S4GDXS575D3S" : {
      "sku" : "HVG2S4GDXS575D3S",
      "productFamily" : "AWSMobile-Analytics",
      "attributes" : {
        "servicecode" : "mobileanalytics",
        "description" : "Amazon Mobile Analytics events recorded per month",
        "location" : "US East (N. Virginia)",
        "locationType" : "AWS Region",
        "usagetype" : "EventsRecorded",
        "operation" : "PutEvents",
        "includedEvents" : "First 100M events recorded per month"
      }
    }
  },
  "terms" : {
    "OnDemand" : {
      "HVG2S4GDXS575D3S" : {
        "HVG2S4GDXS575D3S.JRTCKXETXF" : {
          "offerTermCode" : "JRTCKXETXF",
          "sku" : "HVG2S4GDXS575D3S",
          "effectiveDate" : "2014-08-01T00:00:00Z",
          "priceDimensions" : {
            "HVG2S4GDXS575D3S.JRTCKXETXF.F83EQNDM5J" : {
              "rateCode" : "HVG2S4GDXS575D3S.JRTCKXETXF.F83EQNDM5J",
              "description" : "$1.00 per 1,000,000 Amazon Mobile Analytics events per month thereafter",
              "beginRange" : "100000000",
              "endRange" : "Inf",
              "unit" : "Activities",
              "pricePerUnit" : {
                "USD" : "0.0000010000"
              },
              "appliesTo" : [ ]
            },
            "HVG2S4GDXS575D3S.JRTCKXETXF.8DQQFJNTGA" : {
              "rateCode" : "HVG2S4GDXS575D3S.JRTCKXETXF.8DQQFJNTGA",
              "description" : "First 100,000,000 Amazon Mobile Analytics events per month are free",
              "beginRange" : "0",
              "endRange" : "100000000",
              "unit" : "Activities",
              "pricePerUnit" : {
                "USD" : "0.0000000000"
              },
              "appliesTo" : [ ]
            }
          },
          "termAttributes" : { }
        }
      }
    }
  }
}

For other services, there can be a different definition of tiers, in this case, the input is the $ expended in the account:

{
  "formatVersion" : "v1.0",
  "disclaimer" : "This pricing list is for informational purposes only. All prices are subject to the additional terms included in the pricing pages on http://aws.amazon.com. All Free Tier prices are also subject to the terms included at https://aws.amazon.com/free/",
  "offerCode" : "AWSSupportEnterprise",
  "version" : "20170419202515",
  "publicationDate" : "2017-04-19T20:25:15Z",
  "products" : {
    "H523M4KWZBFZM8WY" : {
      "sku" : "H523M4KWZBFZM8WY",
      "productFamily" : "AWSSupportEnterprise",
      "attributes" : {
        "servicecode" : "AWSSupportEnterprise",
        "location" : "Any",
        "locationType" : "Other",
        "usagetype" : "Dollar",
        "operation" : "",
        "accountAssistance" : "Assigned Support Concierge",
        "architecturalReview" : "Access to a Well-Architected Review delivered by AWS Solution Architects",
        "architectureSupport" : "Consultative review and guidance based on your applications",
        "bestPractices" : "Access to full set of Trusted Advisor checks",
        "caseSeverityresponseTimes" : "Critical: < 15 minutes, Urgent: < 1 hour, High: < 4 hours, Normal: < 12 hours, Low: < 24 hours",
        "customerServiceAndCommunities" : "24x7 access to customer service, documentation, whitepapers, and support forums",
        "includedServices" : "All AWS services except Support",
        "launchSupport" : "Infrastructure Event Management (Included)",
        "operationsSupport" : "Operational reviews, recommendations, and reporting",
        "proactiveGuidance" : "Designated Technical Account Manager",
        "programmaticCaseManagement" : "AWS Support API",
        "technicalSupport" : "24x7 access to Sr. Cloud Support Engineers via email, chat & phone",
        "thirdpartySoftwareSupport" : "Interoperability & configuration guidance and troubleshooting",
        "training" : "Access to online self-paced labs",
        "whoCanOpenCases" : "Unlimited contacts/Unlimited cases (IAM supported)"
      }
    }
  },
  "terms" : {
    "OnDemand" : {
      "H523M4KWZBFZM8WY" : {
        "H523M4KWZBFZM8WY.JRTCKXETXF" : {
          "offerTermCode" : "JRTCKXETXF",
          "sku" : "H523M4KWZBFZM8WY",
          "effectiveDate" : "2012-05-01T00:00:00Z",
          "priceDimensions" : {
            "H523M4KWZBFZM8WY.JRTCKXETXF.TZU98YBNT4" : {
              "rateCode" : "H523M4KWZBFZM8WY.JRTCKXETXF.TZU98YBNT4",
              "description" : "10% of monthly AWS usage for the first $0-$150K",
              "beginRange" : "0",
              "endRange" : "150000",
              "unit" : "Dollar",
              "pricePerUnit" : {
                "USD" : "0.1000000000"
              },
              "appliesTo" : [ ]
            },
            "H523M4KWZBFZM8WY.JRTCKXETXF.J8BW7J3JFF" : {
              "rateCode" : "H523M4KWZBFZM8WY.JRTCKXETXF.J8BW7J3JFF",
              "description" : "Recurring Fee",
              "unit" : "Quantity",
              "pricePerUnit" : {
                "USD" : "15000"
              },
              "appliesTo" : [ ]
            },
            "H523M4KWZBFZM8WY.JRTCKXETXF.8HDSK2HNXX" : {
              "rateCode" : "H523M4KWZBFZM8WY.JRTCKXETXF.8HDSK2HNXX",
              "description" : "7% of monthly AWS usage from $150K-$500K",
              "beginRange" : "150000",
              "endRange" : "500000",
              "unit" : "Dollar",
              "pricePerUnit" : {
                "USD" : "0.0700000000"
              },
              "appliesTo" : [ ]
            },
            "H523M4KWZBFZM8WY.JRTCKXETXF.VNJQCFJPS4" : {
              "rateCode" : "H523M4KWZBFZM8WY.JRTCKXETXF.VNJQCFJPS4",
              "description" : "3% of monthly AWS usage from $1M+",
              "beginRange" : "1000000",
              "endRange" : "Inf",
              "unit" : "Dollar",
              "pricePerUnit" : {
                "USD" : "0.0300000000"
              },
              "appliesTo" : [ ]
            },
            "H523M4KWZBFZM8WY.JRTCKXETXF.5GVXPFCSQW" : {
              "rateCode" : "H523M4KWZBFZM8WY.JRTCKXETXF.5GVXPFCSQW",
              "description" : "5% of monthly AWS usage from $500K-$1M",
              "beginRange" : "500000",
              "endRange" : "1000000",
              "unit" : "Dollar",
              "pricePerUnit" : {
                "USD" : "0.0500000000"
              },
              "appliesTo" : [ ]
            }
          },
          "termAttributes" : { }
        }
      }
    }
  }
}

@chargio
Copy link
Contributor Author

chargio commented May 24, 2018

For Openshift online, tiers were different:

  • The first 3 pods: free
  • The rest: a price per hour.

So the tier for rating depending on the index of the pod.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants