Class AwsPriceListRateCard

java.lang.Object
com.eqixiac.equinix.design.value.ratecard.provider.AwsPriceListRateCard
All Implemented Interfaces:
RateCard

public final class AwsPriceListRateCard extends Object implements RateCard
A RateCard that sources AWS data-egress rates from the public AWS Price List Bulk API. Both bulk offers it reads are unauthenticated, so this adapter needs no credentials or request signing. Every rate it returns is tagged PriceSource.PROVIDER_API.
  • EgressPath.INTERNET → the AWSDataTransfer offer's AWS Outbound / External products, resolved by source region. The per-GB figure is the first paid on-demand tier (the headline rate; the free-tier dimension, if any, is skipped).
  • EgressPath.PRIVATE → the AWSDirectConnect offer's Data Transfer products with an *Outbound transfer type for the region. The per-GB figure is the lowest positive on-demand rate (the best-case / local Direct Connect egress rate — the savings-relevant figure).

The offer files are large; each is fetched once on first success and cached for the adapter's lifetime — a failed fetch is never memoized, so a transient outage is retried on the next lookup rather than pinning "no rate" forever. The adapter is fault-tolerant — any fetch or parse failure yields no rate rather than an exception. A null region yields empty, since AWS egress pricing is region-specific.

  • Field Details

    • DEFAULT_OFFER_URL

      public static final String DEFAULT_OFFER_URL
      The public AWSDataTransfer bulk-offer URL (internet-egress rates); the default data-transfer source for create() and create(String).
      See Also:
    • DEFAULT_DIRECT_CONNECT_OFFER_URL

      public static final String DEFAULT_DIRECT_CONNECT_OFFER_URL
      The public AWSDirectConnect bulk-offer URL (private-egress rates); the default Direct Connect source unless overridden via create(String, String).
      See Also:
  • Method Details

    • create

      public static AwsPriceListRateCard create()
      Creates an adapter over the public AWS bulk-offer URLs (DEFAULT_OFFER_URL / DEFAULT_DIRECT_CONNECT_OFFER_URL). No credentials or request signing required; the offers are fetched lazily on first lookup.
      Returns:
      a new AWS pricing adapter
    • create

      public static AwsPriceListRateCard create(String offerUrl)
      Creates an adapter with a custom data-transfer offer URL (Direct Connect uses the default) — for a mirror, a proxy, or testing.
      Parameters:
      offerUrl - the full URL of the AWSDataTransfer index.json
    • create

      public static AwsPriceListRateCard create(String offerUrl, String directConnectOfferUrl)
      Creates an adapter with custom data-transfer and Direct Connect offer URLs.
      Parameters:
      offerUrl - the full URL of the AWSDataTransfer index.json
      directConnectOfferUrl - the full URL of the AWSDirectConnect index.json
    • connection

      public Optional<PriceQuote> connection(ConnectionType type, int bandwidthMbps, MetroCode metro, Term term)
      Description copied from interface: RateCard
      Resolves the price of a single Fabric connection / virtual connection.

      Implementation contract. The matching strategy is implementation-specific, and a card whose data lacks an axis (metro, term, type) still returns its best figure — or empty — rather than failing; callers must not assume every card is sensitive to every parameter. Of the bundled cards: CustomRateCard resolves the most specific declared entry (exact metro+term down to metro/term-agnostic, then a declared default); EquinixRateCard matches bandwidth and type against the live catalogue, honours a requested metro strictly (a wrong-metro row is never returned), and prefers a term-matched row — a different-term row is only ever returned with a note naming the substitution; ReferenceRateCard matches on bandwidth alone (smallest tabulated tier at or above the request, linearly extrapolated with an EXTRAPOLATED note above the top tier) and ignores type, metro, and term entirely.

      Specified by:
      connection in interface RateCard
      Parameters:
      type - the connection type (e.g. EVPL_VC); may be null for any type
      bandwidthMbps - the provisioned bandwidth in Mbps
      metro - the metro the connection originates in (may be null if metro-agnostic)
      term - the commitment term (may be null if term-agnostic)
      Returns:
      the resolved quote, or Optional.empty() if this card cannot price the connection
    • cloudRouter

      public Optional<PriceQuote> cloudRouter(String packageCode, MetroCode metro, Term term)
      Description copied from interface: RateCard
      Resolves the price of a single Fabric Cloud Router instance.

      Implementation contract. As with RateCard.connection(ConnectionType, int, MetroCode, Term), matching is implementation-specific and cards without a metro/term axis return their best figure regardless. Of the bundled cards: CustomRateCard resolves the most specific declared (packageCode, metro, term) entry; EquinixRateCard matches the package code and metro structurally against the row's own descriptor (exact package equality, the row's own metro code) and prefers a term-matched row, labelling any term substitution; ReferenceRateCard ignores metro and term, and substitutes its STANDARD figure for an unlisted package with a note naming the substitution.

      Specified by:
      cloudRouter in interface RateCard
      Parameters:
      packageCode - the router package / tier code (e.g. "STANDARD"); may be null for any
      metro - the metro the router is deployed in (may be null if metro-agnostic)
      term - the commitment term (may be null if term-agnostic)
      Returns:
      the resolved quote, or Optional.empty() if this card cannot price the router
    • egress

      public Optional<EgressRate> egress(CloudProviderType provider, String region, EgressPath path, Term term)
      Description copied from interface: RateCard
      Resolves the per-GB data-egress rate for a cloud provider over a given path.

      Equinix does not sell cloud egress, so EquinixRateCard returns Optional.empty() here (the default); egress rates come from a CustomRateCard (your figures), a ReferenceRateCard (bundled indicative figures), or a provider-pricing-API card. The default returns empty so cards that do not model egress need not override it. Cards whose data has no region or term axis ignore those parameters — the custom and reference cards match on provider + path alone; only the provider-API adapters are region-sensitive.

      Specified by:
      egress in interface RateCard
      Parameters:
      provider - the cloud provider the data is leaving
      region - the provider region (may be null for a provider-wide rate)
      path - internet vs. private interconnect
      term - the commitment term (may be null; ignored by term-agnostic cards)
      Returns:
      the resolved egress rate, or Optional.empty() if this card cannot price it
    • source

      public PriceSource source()
      Description copied from interface: RateCard
      The dominant provenance of prices this card produces. Aggregating cards report PriceSource.COMPOSITE.
      Specified by:
      source in interface RateCard
      Returns:
      the price source