ElastiCache Reserved Cache Node Coverage

Trend Micro Cloud One™ – Conformity is a continuous assurance tool that provides peace of mind for your cloud infrastructure, delivering over 750 automated best practice checks.

Risk level: Medium (should be achieved)

Ensure that the reservation coverage percentage (i.e. the percentage of node instance hours that a reservation covered) available for your Amazon ElastiCache Reserved Cache Nodes (RCNs) does not fall below a target threshold. Reserved Cache Node (RCN) coverage tracks the number of running node hours that are covered by reservations, and can be measured over a daily, monthly, quarterly, or yearly cadence. For example, you can monitor your RCN coverage either at an aggregate level (e.g. monthly coverage of your entire Amazon ElastiCache RCN fleet) or at a more granular level of detail (e.g. monthly coverage of Amazon ElastiCache cache.m4.large nodes running within Asia Pacific - Tokyo region). The reservation coverage threshold (percentage) and the time period to retrieve the reservation coverage data for, must be defined in the conformity rule settings, on the Trend Micro Cloud One™ – Conformity account console.

This rule can help you work with the AWS Well-Architected Framework

Cost
optimisation

Amazon ElastiCache RCN reservations provide a significant discounted hourly rate (up to 75%) compared to On-Demand pricing, helping you to cut down on your ElastiCache costs. The Reserved Cache Node (RCN) coverage report produced by Amazon Cost Management service allows you to discover how much of your overall ElastiCache node usage is covered by RCNs, so that you can make informed decisions about when to purchase or modify a Reserved Cache Node to ensure maximum reservation coverage. The Cost Management service provides effective recommendations for which reservations to purchase in order to help you reduce your Amazon ElastiCache costs.


Audit

To determine if the reservation coverage (percentage) of your Amazon ElastiCache Reserved Cache Nodes fall below your target coverage, perform the following actions:

Using AWS Console

01 Sign in to your Trend Micro Cloud One™ – Conformity account, access ElastiCache Reserved Cache Node Coverage conformity rule settings and identify the Amazon ElastiCache reservation coverage threshold (percentage) defined for the specified period of time, configured for your AWS cloud account.

02 Sign in to AWS Management Console.

03 Navigate to Amazon Cost Management console at https://console.aws.amazon.com/cost-management/home.

04 In the navigation panel, under Reservations, choose Coverage report to access the reservation coverage report provided by Amazon Cost Management service for your AWS account. This helps you identify opportunities for cost savings when it comes to Reserved Cache Nodes (RCNs).

05 On the Coverage report page, perform the following operations:

  1. For FILTERS, select Service, ElastiCache, and choose Apply filters to display the RCN coverage data for Amazon ElastiCache nodes only.
  2. Click on the time period dropdown list to access the date/time picker, and choose the time frame to retrieve data about your reservation coverage (daily, monthly, quarterly or yearly) as specified in the conformity rule settings, identified at step no. 1. Once the appropriate time frame is selected, choose Apply to show the reservation coverage for that period.
  3. Check the reservation coverage (percentage) displayed in the Average Coverage (hours) panel box, under RI Coverage. If the reservation coverage (percentage) is lower than the target coverage threshold identified at step no. 1, the reservation coverage for your Amazon ElastiCache Reserved Cache Nodes (RCNs) falls below your target coverage, therefore actions must be taken to ensure maximum coverage.

06 If required, repeat step no. 1 – 5 determine the Amazon ElastiCache reservation coverage for other AWS accounts.

Using AWS CLI

01 Sign in to your Trend Micro Cloud One™ – Conformity account, access ElastiCache Reserved Cache Node Coverage conformity rule settings and identify the Amazon ElastiCache reservation coverage threshold (percentage) defined for the specified period of time, configured for your AWS cloud account.

02 Define the AWS service for which to return the reservation coverage, i.e. Amazon ElastiCache. Save the following configuration document to a JSON file named aws-service-filter.json:

{
  "Dimensions": {
     "Key": "SERVICE",
     "Values": [ "Amazon ElastiCache" ]
  }
}

03 Run get-reservation-coverage command (OSX/Linux/UNIX) using the filter configuration document created at the previous step as value for the --filter parameter and custom query filters to retrieve the reservation coverage for your Amazon ElastiCache Reserved Cache Nodes (RCNs), for the specified period of time. The --time-period parameter value indicates the start and end dates of the period that you want to retrieve data about reservation coverage for, and must match the time frame defined for the target threshold, identified at step no. 1:

aws ce get-reservation-coverage
	--time-period Start=2020-10-20,End=2020-11-20
	--granularity MONTHLY
	--filter file://aws-service-filter.json
	--query 'CoveragesByTime[*].Total.CoverageHours.CoverageHoursPercentage'

04 The command output should return the requested reservation coverage (percentage):

[
    "75"
]

If the reservation coverage (percentage) returned by the get-reservation-coverage command output is lower than the target coverage threshold identified at step no. 1, the reservation coverage for your Amazon ElastiCache Reserved Cache Nodes (RCNs) falls below your target coverage, therefore actions must be taken to ensure maximum coverage.

05 If required, repeat step no. 1 – 4 determine the Amazon ElastiCache reservation coverage for other AWS accounts.

Remediation / Resolution

To ensure maximum reservation coverage for your Amazon ElastiCache Reserved Cache Nodes (RCNs), follow the context-aware RCN purchase recommendations provided by Amazon Cost Management service to optimize your AWS costs by performing the following actions:

Using AWS Console

01 Sign in to AWS Management Console.

02 Navigate to Amazon Cost Management console at https://console.aws.amazon.com/cost-management/home.

03 In the navigation panel, under Reservations, choose Recommendations to access the Reserved Cache Node (RCN) purchase recommendations provided by Amazon Cost Management. These recommendations are based on your past usage and indicate opportunities to maximize your cost savings as compared to On-Demand usage.

04 On the Recommendations page, perform the following operations:

  1. For Select recommendation type, choose ElastiCache to show purchase recommendations for Amazon ElastiCache nodes only.
  2. For RI Recommendation Parameters, select the required RCN attributes and adjust the usage time period for which your purchase recommendations should be calculated:
    • For RI term, select the length of the RCN reservation that you want recommendations for.
    • For Payment option, choose whether you want to pay for recommended RCNs upfront.
    • For Based on the past, select the number of previous days that you want AWS to consider when it calculates your RCN recommendations.
  3. After all the required parameters are provided, you can see all the Reserved Cache Node (RCN) purchase recommendations made by Amazon Cost Management in the Purchase Recommendations section. Cost Management service recommends the smallest size node available in a node family. This makes it easier to purchase a size-flexible Reserved Cache Nodes. The service also shows the equal number of normalized units so that you can purchase any node size that you want. For example, your RCN purchase recommendation would be for cache.m4.large because that is the smallest size cache node in the M4 family.

05 To adopt the RCN recommendations provided by Amazon Cost Management service at the previous step and purchase new ElastiCache Reserved Cache Nodes (RCNs), navigate to Amazon ElastiCache console at https://console.aws.amazon.com/elasticache.

06 In the navigation panel, under ElastiCache Dashboard, choose Reserved Nodes.

07 Click Purchase Reserved Node button from the console top menu to initiate the purchasing process.

08 On the Purchase Reserved Nodes panel, specify the necessary Reserved Cache Node (RCN) offering details based on the purchase recommendations provided by Cost Management service at step no 4c:

  1. For Product Description, choose the appropriate in-memory cache engine (redis or memcached).
  2. For Node Type, select the required ElastiCache node type.
  3. For Term, select the length of time you want the cache node reserved.
  4. For Offering Type, choose the preferred offering type.
  5. (Optional) You can assign your own identifier (ID) to the reserved nodes that you purchase to help you track them. For Reserved Node ID, type a unique identifier for your reserved cache nodes.
  6. For Number of Nodes, specify the number of Amazon ElastiCache nodes that you want to reserve with this order.
  7. After you provide all the parameters required for RCN purchase, the ElastiCache service should display the pricing information. Choose Next.
  8. On the purchase summary panel, review your reserved cache node(s) configuration information. If the information is correct, choose Order to purchase the reserved Amazon ElastiCache node(s). The order processing may take few minutes as the node(s) status will change from pending-payment to active.

09 If required, repeat step no. 7 and 8 to purchase more Amazon ElastiCache Reserved Cache Nodes as specified in the RCN purchase recommendations list provided by Amazon Cost Management.

10 If required, repeat step no. 1 – 9 to perform the remediation process for other AWS accounts.

Using AWS CLI

01 Run get-reservation-purchase-recommendation command (OSX/Linux/UNIX) with custom query filters to get recommendations for which Amazon ElastiCache Reserved Cache Nodes to purchase. These recommendations are based on your past usage and indicate opportunities to maximize your cost savings as compared to On-Demand usage. The following command request example retrieves purchase recommendations for All Upfront ElastiCache nodes with one-year term, based on the last 30 days of Amazon ElastiCache usage:

aws ce get-reservation-purchase-recommendation
	--service "Amazon ElastiCache"
	--lookback-period-in-days THIRTY_DAYS
	--term-in-years ONE_YEAR
	--payment-option ALL_UPFRONT
	--query 'Recommendations[*].RecommendationDetails[]'

02 The command output should return the Amazon ElastiCache RCN purchase recommendation(s) provided by Amazon Cost Management service for your AWS account. AWS recommends the smallest size node in a node family. This makes it easier to purchase a size-flexible Reserved Cache Node. For example, the following command output describes one RCN purchase recommendation for cache.m4.large cache nodes:

[
    {
        "AverageUtilization": "100.0000000000",
        "RecurringStandardMonthlyCost": "0.0000000000",
        "MinimumNumberOfNodesUsedPerHour": "2.0000000000",
        "NodeDetails": {
            "ElastiCacheInstanceDetails": {
                "Family": "m4",
                "ProductDescription": "redis",
                "SizeFlexEligible": true,
                "CurrentGeneration": true,
                "Region": "Asia Pacific (Sydney)",
                "NodeType": "cache.m4.large"
            }
        },
        "EstimatedMonthlySavingsAmount": "103.9558887800",
        "AverageNumberOfNodesUsedPerHour": "2.0000000000",
        "EstimatedBreakEvenInMonths": "29.0568700700",
        "CurrencyCode": "USD",
        "EstimatedMonthlySavingsPercentage": "45.0000",
        "UpfrontCost": "446.0000000000",
        "MaximumNormalizedUnitsUsedPerHour": "1.0000000000",
        "MaximumNumberOfNodesUsedPerHour": "2.0000000000",
        "RecommendedNumberOfNodesToPurchase": "2",
        "EstimatedMonthlyOnDemandCost": "186.2750000000",
        "EstimatedReservationCostForLookbackPeriod": "60.1780820000",
        "RecommendedNormalizedUnitsToPurchase": "1.0",
        "AverageNormalizedUnitsUsedPerHour": "1.0000000000",
        "AccountId": "123456789012",
        "MinimumNormalizedUnitsUsedPerHour": "1.0000000000"
    }
]

03 Run describe-reserved-cache-nodes-offerings command (OSX/Linux/UNIX) to retrieve the pricing details and information about the available Amazon ElastiCache Reserved Cache Node offerings, based on the RCN purchase recommendations provided by Amazon Cost Management at the previous step:

aws elasticache describe-reserved-cache-nodes-offerings
	--region ap-southeast-2
	--cache-node-type cache.m4.large
	--product-description redis
	--offering-type "Heavy Utilization"
	--duration 31536000

04 The command output should return the requested offering information (including the Reserved Cache Node offering ID):

{
    "ReservedCacheNodesOfferings": [
        {
            "OfferingType": "Heavy Utilization",
            "FixedPrice": 446.0,
            "ReservedCacheNodesOfferingId": "abcd1234-abcd-1234-abcd-1234abcd1234",
            "UsagePrice": 0.0,
            "RecurringCharges": [
                {
                    "RecurringChargeAmount": 0.08,
                    "RecurringChargeFrequency": "Hourly"
                }
            ],
            "ProductDescription": "redis",
            "Duration": 31536000,
            "CacheNodeType": "cache.m4.large"
        }
    ]
}

05 Run purchase-reserved-cache-nodes-offering command (OSX/Linux/UNIX) using the ID of the RCN offering that you want to use (i.e. "ReservedCacheNodesOfferingId" attribute value), to purchase Amazon ElastiCache Reserved Cache Nodes based on the offering information returned at the previous step:

 aws elasticache purchase-reserved-cache-nodes-offering
 	--region ap-southeast-2
 	--reserved-cache-nodes-offering-id abcd1234-abcd-1234-abcd-1234abcd1234
 	--cache-node-count 2

06 The command output should return the metadata available for your new Amazon ElastiCache Reserved Cache Nodes (RCNs):

{
    "ReservedCacheNode": [
        {
            "ReservedCacheNodesOfferingId":
            "abcd1234-abcd-1234-abcd-1234abcd1234",
            "CacheNodeType": "cache.m4.large",
            "StartTime ": "2020-11-17T19:00:00.000Z",
            "Duration": 31536000,
            "FixedPrice": 446.0,
            "UsagePrice": 0.0,
            "CacheNodeCount": 2,
            "ProductDescription": "redis",
            "OfferingType": "Heavy Utilization",
            "RecurringCharges": [
                {
                    "RecurringChargeAmount": 0.08,
                    "RecurringChargeFrequency": "Hourly"
                }
            ],
            "State": "payment-pending"
        }
    ]
}

07 If required, repeat steps no. 3 – 6 to purchase more Amazon ElastiCache Reserved Cache Nodes as specified in the RCN purchase recommendations list provided by Amazon Cost Management.

08 If required, repeat step no. 1 – 7 to perform the entire remediation process for other AWS accounts.

References

Publication date Nov 24, 2020

Unlock the Remediation Steps


Gain free unlimited access
to our full Knowledge Base


Over 750 rules & best practices
for AWS and Azure

You are auditing:

ElastiCache Reserved Cache Node Coverage

Risk level: Medium