tagging

package
v0.0.0-...-77bc8a9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2026 License: OSL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package tagging builds the shared CUDly tag set applied to AWS Reserved Instance-style commitments at purchase time.

It exists so RDS, ElastiCache, and MemoryDB (all three of which accept a Tags field on their respective PurchaseReserved*OfferingInput types) share ONE source of truth for what that tag set looks like, instead of the byte-for-byte identical `createPurchaseTags` method that used to live on each service client. Each AWS SDK exposes its own `types.Tag` struct (rds/types.Tag, elasticache/types.Tag, memorydb/types.Tag) — distinct Go types with the same underlying shape — so this package returns SDK-agnostic Pair values and each service converts with a 5-line adapter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pair

type Pair struct {
	Key   string
	Value string
}

Pair is a single tag key/value independent of any AWS SDK type.

func PurchasePairs

func PurchasePairs(rec common.Recommendation, purpose, resourceKey, source string) []Pair

PurchasePairs returns the standard CUDly purchase-time tag set:

Purpose          = <caller-supplied purpose string>
<resourceKey>    = rec.ResourceType   // "ResourceType" for RDS,
                                      // "NodeType" for ElastiCache & MemoryDB
Region           = rec.Region
PurchaseDate     = <today, YYYY-MM-DD>
Tool             = CUDly
purchase-automation = source           // only when source != ""

The purpose text and resource-type key name differ per service (AWS convention varies — RDS uses "ResourceType", ElastiCache and MemoryDB use "NodeType"; purpose strings describe the product being bought) — those two are the only things each service customizes.

Empty source skips the purchase-automation pair rather than writing an empty value, matching the convention established when the tag was first rolled out (so callers that haven't set a Source don't poison cloud tag inventories).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL