Documentation
¶
Overview ¶
Package rds provides AWS RDS Reserved Instances client
Index ¶
- Constants
- type API
- type Client
- func (c *Client) GetExistingCommitments(ctx context.Context) ([]common.Commitment, error)
- func (c *Client) GetOfferingDetails(ctx context.Context, rec common.Recommendation) (*common.OfferingDetails, error)
- func (c *Client) GetRecommendations(_ context.Context, _ *common.RecommendationParams) ([]common.Recommendation, error)
- func (c *Client) GetRegion() string
- func (c *Client) GetServiceType() common.ServiceType
- func (c *Client) GetValidResourceTypes(ctx context.Context) ([]string, error)
- func (c *Client) PurchaseCommitment(ctx context.Context, rec common.Recommendation, opts common.PurchaseOptions) (common.PurchaseResult, error)
- func (c *Client) SetRDSAPI(api API)
- func (c *Client) ValidateOffering(ctx context.Context, rec common.Recommendation) error
Constants ¶
const ( OneYearSeconds = purchasecfg.OneYearSeconds // 365 days in seconds ThreeYearSeconds = purchasecfg.ThreeYearSeconds // 3 * 365 days in seconds )
Duration constants for RI term calculations. Aliased from purchasecfg so the exported names stay available to downstream consumers of this module.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface {
DescribeReservedDBInstancesOfferings(ctx context.Context, params *rds.DescribeReservedDBInstancesOfferingsInput, optFns ...func(*rds.Options)) (*rds.DescribeReservedDBInstancesOfferingsOutput, error)
PurchaseReservedDBInstancesOffering(ctx context.Context, params *rds.PurchaseReservedDBInstancesOfferingInput, optFns ...func(*rds.Options)) (*rds.PurchaseReservedDBInstancesOfferingOutput, error)
DescribeReservedDBInstances(ctx context.Context, params *rds.DescribeReservedDBInstancesInput, optFns ...func(*rds.Options)) (*rds.DescribeReservedDBInstancesOutput, error)
}
API defines the interface for RDS operations (enables mocking).
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client handles AWS RDS Reserved Instances.
func NewClient ¶
NewClient creates a new RDS client with purchase-path retry/timeout settings. See purchasecfg for rationale.
func (*Client) GetExistingCommitments ¶
GetExistingCommitments retrieves existing RDS Reserved Instances.
func (*Client) GetOfferingDetails ¶
func (c *Client) GetOfferingDetails(ctx context.Context, rec common.Recommendation) (*common.OfferingDetails, error)
GetOfferingDetails retrieves offering details. All prices are per ONE reservation (callers multiply by rec.Count): UpfrontCost is FixedPrice, RecurringCost the hourly rate, TotalCost upfront plus hourly over the offering duration.
func (*Client) GetRecommendations ¶
func (c *Client) GetRecommendations(_ context.Context, _ *common.RecommendationParams) ([]common.Recommendation, error)
GetRecommendations returns empty as RDS uses centralized Cost Explorer recommendations.
func (*Client) GetServiceType ¶
func (c *Client) GetServiceType() common.ServiceType
GetServiceType returns the service type.
func (*Client) GetValidResourceTypes ¶
GetValidResourceTypes returns valid RDS instance types.
func (*Client) PurchaseCommitment ¶
func (c *Client) PurchaseCommitment(ctx context.Context, rec common.Recommendation, opts common.PurchaseOptions) (common.PurchaseResult, error)
PurchaseCommitment purchases an RDS Reserved Instance.
func (*Client) ValidateOffering ¶
ValidateOffering checks if an offering exists without purchasing.