{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.ComputeOptimizer.Types.InstanceRecommendation
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.ComputeOptimizer.Types.InstanceRecommendation where

import Amazonka.ComputeOptimizer.Types.CurrentPerformanceRisk
import Amazonka.ComputeOptimizer.Types.EffectiveRecommendationPreferences
import Amazonka.ComputeOptimizer.Types.Finding
import Amazonka.ComputeOptimizer.Types.InferredWorkloadType
import Amazonka.ComputeOptimizer.Types.InstanceRecommendationFindingReasonCode
import Amazonka.ComputeOptimizer.Types.InstanceRecommendationOption
import Amazonka.ComputeOptimizer.Types.RecommendationSource
import Amazonka.ComputeOptimizer.Types.UtilizationMetric
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Describes an Amazon EC2 instance recommendation.
--
-- /See:/ 'newInstanceRecommendation' smart constructor.
data InstanceRecommendation = InstanceRecommendation'
  { -- | The Amazon Web Services account ID of the instance.
    InstanceRecommendation -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text,
    -- | The instance type of the current instance.
    InstanceRecommendation -> Maybe Text
currentInstanceType :: Prelude.Maybe Prelude.Text,
    -- | The risk of the current instance not meeting the performance needs of
    -- its workloads. The higher the risk, the more likely the current instance
    -- cannot meet the performance requirements of its workload.
    InstanceRecommendation -> Maybe CurrentPerformanceRisk
currentPerformanceRisk :: Prelude.Maybe CurrentPerformanceRisk,
    -- | An object that describes the effective recommendation preferences for
    -- the instance.
    InstanceRecommendation -> Maybe EffectiveRecommendationPreferences
effectiveRecommendationPreferences :: Prelude.Maybe EffectiveRecommendationPreferences,
    -- | The finding classification of the instance.
    --
    -- Findings for instances include:
    --
    -- -   __@Underprovisioned@__ —An instance is considered under-provisioned
    --     when at least one specification of your instance, such as CPU,
    --     memory, or network, does not meet the performance requirements of
    --     your workload. Under-provisioned instances may lead to poor
    --     application performance.
    --
    -- -   __@Overprovisioned@__ —An instance is considered over-provisioned
    --     when at least one specification of your instance, such as CPU,
    --     memory, or network, can be sized down while still meeting the
    --     performance requirements of your workload, and no specification is
    --     under-provisioned. Over-provisioned instances may lead to
    --     unnecessary infrastructure cost.
    --
    -- -   __@Optimized@__ —An instance is considered optimized when all
    --     specifications of your instance, such as CPU, memory, and network,
    --     meet the performance requirements of your workload and is not over
    --     provisioned. For optimized resources, Compute Optimizer might
    --     recommend a new generation instance type.
    InstanceRecommendation -> Maybe Finding
finding :: Prelude.Maybe Finding,
    -- | The reason for the finding classification of the instance.
    --
    -- Finding reason codes for instances include:
    --
    -- -   __@CPUOverprovisioned@__ — The instance’s CPU configuration can be
    --     sized down while still meeting the performance requirements of your
    --     workload. This is identified by analyzing the @CPUUtilization@
    --     metric of the current instance during the look-back period.
    --
    -- -   __@CPUUnderprovisioned@__ — The instance’s CPU configuration
    --     doesn\'t meet the performance requirements of your workload and
    --     there is an alternative instance type that provides better CPU
    --     performance. This is identified by analyzing the @CPUUtilization@
    --     metric of the current instance during the look-back period.
    --
    -- -   __@MemoryOverprovisioned@__ — The instance’s memory configuration
    --     can be sized down while still meeting the performance requirements
    --     of your workload. This is identified by analyzing the memory
    --     utilization metric of the current instance during the look-back
    --     period.
    --
    -- -   __@MemoryUnderprovisioned@__ — The instance’s memory configuration
    --     doesn\'t meet the performance requirements of your workload and
    --     there is an alternative instance type that provides better memory
    --     performance. This is identified by analyzing the memory utilization
    --     metric of the current instance during the look-back period.
    --
    --     Memory utilization is analyzed only for resources that have the
    --     unified CloudWatch agent installed on them. For more information,
    --     see
    --     <https://docs.aws.amazon.com/compute-optimizer/latest/ug/metrics.html#cw-agent Enabling memory utilization with the Amazon CloudWatch Agent>
    --     in the /Compute Optimizer User Guide/. On Linux instances, Compute
    --     Optimizer analyses the @mem_used_percent@ metric in the @CWAgent@
    --     namespace, or the legacy @MemoryUtilization@ metric in the
    --     @System\/Linux@ namespace. On Windows instances, Compute Optimizer
    --     analyses the @Memory % Committed Bytes In Use@ metric in the
    --     @CWAgent@ namespace.
    --
    -- -   __@EBSThroughputOverprovisioned@__ — The instance’s EBS throughput
    --     configuration can be sized down while still meeting the performance
    --     requirements of your workload. This is identified by analyzing the
    --     @VolumeReadOps@ and @VolumeWriteOps@ metrics of EBS volumes attached
    --     to the current instance during the look-back period.
    --
    -- -   __@EBSThroughputUnderprovisioned@__ — The instance’s EBS throughput
    --     configuration doesn\'t meet the performance requirements of your
    --     workload and there is an alternative instance type that provides
    --     better EBS throughput performance. This is identified by analyzing
    --     the @VolumeReadOps@ and @VolumeWriteOps@ metrics of EBS volumes
    --     attached to the current instance during the look-back period.
    --
    -- -   __@EBSIOPSOverprovisioned@__ — The instance’s EBS IOPS configuration
    --     can be sized down while still meeting the performance requirements
    --     of your workload. This is identified by analyzing the
    --     @VolumeReadBytes@ and @VolumeWriteBytes@ metric of EBS volumes
    --     attached to the current instance during the look-back period.
    --
    -- -   __@EBSIOPSUnderprovisioned@__ — The instance’s EBS IOPS
    --     configuration doesn\'t meet the performance requirements of your
    --     workload and there is an alternative instance type that provides
    --     better EBS IOPS performance. This is identified by analyzing the
    --     @VolumeReadBytes@ and @VolumeWriteBytes@ metric of EBS volumes
    --     attached to the current instance during the look-back period.
    --
    -- -   __@NetworkBandwidthOverprovisioned@__ — The instance’s network
    --     bandwidth configuration can be sized down while still meeting the
    --     performance requirements of your workload. This is identified by
    --     analyzing the @NetworkIn@ and @NetworkOut@ metrics of the current
    --     instance during the look-back period.
    --
    -- -   __@NetworkBandwidthUnderprovisioned@__ — The instance’s network
    --     bandwidth configuration doesn\'t meet the performance requirements
    --     of your workload and there is an alternative instance type that
    --     provides better network bandwidth performance. This is identified by
    --     analyzing the @NetworkIn@ and @NetworkOut@ metrics of the current
    --     instance during the look-back period. This finding reason happens
    --     when the @NetworkIn@ or @NetworkOut@ performance of an instance is
    --     impacted.
    --
    -- -   __@NetworkPPSOverprovisioned@__ — The instance’s network PPS
    --     (packets per second) configuration can be sized down while still
    --     meeting the performance requirements of your workload. This is
    --     identified by analyzing the @NetworkPacketsIn@ and
    --     @NetworkPacketsIn@ metrics of the current instance during the
    --     look-back period.
    --
    -- -   __@NetworkPPSUnderprovisioned@__ — The instance’s network PPS
    --     (packets per second) configuration doesn\'t meet the performance
    --     requirements of your workload and there is an alternative instance
    --     type that provides better network PPS performance. This is
    --     identified by analyzing the @NetworkPacketsIn@ and
    --     @NetworkPacketsIn@ metrics of the current instance during the
    --     look-back period.
    --
    -- -   __@DiskIOPSOverprovisioned@__ — The instance’s disk IOPS
    --     configuration can be sized down while still meeting the performance
    --     requirements of your workload. This is identified by analyzing the
    --     @DiskReadOps@ and @DiskWriteOps@ metrics of the current instance
    --     during the look-back period.
    --
    -- -   __@DiskIOPSUnderprovisioned@__ — The instance’s disk IOPS
    --     configuration doesn\'t meet the performance requirements of your
    --     workload and there is an alternative instance type that provides
    --     better disk IOPS performance. This is identified by analyzing the
    --     @DiskReadOps@ and @DiskWriteOps@ metrics of the current instance
    --     during the look-back period.
    --
    -- -   __@DiskThroughputOverprovisioned@__ — The instance’s disk throughput
    --     configuration can be sized down while still meeting the performance
    --     requirements of your workload. This is identified by analyzing the
    --     @DiskReadBytes@ and @DiskWriteBytes@ metrics of the current instance
    --     during the look-back period.
    --
    -- -   __@DiskThroughputUnderprovisioned@__ — The instance’s disk
    --     throughput configuration doesn\'t meet the performance requirements
    --     of your workload and there is an alternative instance type that
    --     provides better disk throughput performance. This is identified by
    --     analyzing the @DiskReadBytes@ and @DiskWriteBytes@ metrics of the
    --     current instance during the look-back period.
    --
    -- For more information about instance metrics, see
    -- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html List the available CloudWatch metrics for your instances>
    -- in the /Amazon Elastic Compute Cloud User Guide/. For more information
    -- about EBS volume metrics, see
    -- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using_cloudwatch_ebs.html Amazon CloudWatch metrics for Amazon EBS>
    -- in the /Amazon Elastic Compute Cloud User Guide/.
    InstanceRecommendation
-> Maybe [InstanceRecommendationFindingReasonCode]
findingReasonCodes :: Prelude.Maybe [InstanceRecommendationFindingReasonCode],
    -- | The applications that might be running on the instance as inferred by
    -- Compute Optimizer.
    --
    -- Compute Optimizer can infer if one of the following applications might
    -- be running on the instance:
    --
    -- -   @AmazonEmr@ - Infers that Amazon EMR might be running on the
    --     instance.
    --
    -- -   @ApacheCassandra@ - Infers that Apache Cassandra might be running on
    --     the instance.
    --
    -- -   @ApacheHadoop@ - Infers that Apache Hadoop might be running on the
    --     instance.
    --
    -- -   @Memcached@ - Infers that Memcached might be running on the
    --     instance.
    --
    -- -   @NGINX@ - Infers that NGINX might be running on the instance.
    --
    -- -   @PostgreSql@ - Infers that PostgreSQL might be running on the
    --     instance.
    --
    -- -   @Redis@ - Infers that Redis might be running on the instance.
    InstanceRecommendation -> Maybe [InferredWorkloadType]
inferredWorkloadTypes :: Prelude.Maybe [InferredWorkloadType],
    -- | The Amazon Resource Name (ARN) of the current instance.
    InstanceRecommendation -> Maybe Text
instanceArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the current instance.
    InstanceRecommendation -> Maybe Text
instanceName :: Prelude.Maybe Prelude.Text,
    -- | The timestamp of when the instance recommendation was last generated.
    InstanceRecommendation -> Maybe POSIX
lastRefreshTimestamp :: Prelude.Maybe Data.POSIX,
    -- | The number of days for which utilization metrics were analyzed for the
    -- instance.
    InstanceRecommendation -> Maybe Double
lookBackPeriodInDays :: Prelude.Maybe Prelude.Double,
    -- | An array of objects that describe the recommendation options for the
    -- instance.
    InstanceRecommendation -> Maybe [InstanceRecommendationOption]
recommendationOptions :: Prelude.Maybe [InstanceRecommendationOption],
    -- | An array of objects that describe the source resource of the
    -- recommendation.
    InstanceRecommendation -> Maybe [RecommendationSource]
recommendationSources :: Prelude.Maybe [RecommendationSource],
    -- | An array of objects that describe the utilization metrics of the
    -- instance.
    InstanceRecommendation -> Maybe [UtilizationMetric]
utilizationMetrics :: Prelude.Maybe [UtilizationMetric]
  }
  deriving (InstanceRecommendation -> InstanceRecommendation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstanceRecommendation -> InstanceRecommendation -> Bool
$c/= :: InstanceRecommendation -> InstanceRecommendation -> Bool
== :: InstanceRecommendation -> InstanceRecommendation -> Bool
$c== :: InstanceRecommendation -> InstanceRecommendation -> Bool
Prelude.Eq, ReadPrec [InstanceRecommendation]
ReadPrec InstanceRecommendation
Int -> ReadS InstanceRecommendation
ReadS [InstanceRecommendation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstanceRecommendation]
$creadListPrec :: ReadPrec [InstanceRecommendation]
readPrec :: ReadPrec InstanceRecommendation
$creadPrec :: ReadPrec InstanceRecommendation
readList :: ReadS [InstanceRecommendation]
$creadList :: ReadS [InstanceRecommendation]
readsPrec :: Int -> ReadS InstanceRecommendation
$creadsPrec :: Int -> ReadS InstanceRecommendation
Prelude.Read, Int -> InstanceRecommendation -> ShowS
[InstanceRecommendation] -> ShowS
InstanceRecommendation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstanceRecommendation] -> ShowS
$cshowList :: [InstanceRecommendation] -> ShowS
show :: InstanceRecommendation -> String
$cshow :: InstanceRecommendation -> String
showsPrec :: Int -> InstanceRecommendation -> ShowS
$cshowsPrec :: Int -> InstanceRecommendation -> ShowS
Prelude.Show, forall x. Rep InstanceRecommendation x -> InstanceRecommendation
forall x. InstanceRecommendation -> Rep InstanceRecommendation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InstanceRecommendation x -> InstanceRecommendation
$cfrom :: forall x. InstanceRecommendation -> Rep InstanceRecommendation x
Prelude.Generic)

-- |
-- Create a value of 'InstanceRecommendation' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'accountId', 'instanceRecommendation_accountId' - The Amazon Web Services account ID of the instance.
--
-- 'currentInstanceType', 'instanceRecommendation_currentInstanceType' - The instance type of the current instance.
--
-- 'currentPerformanceRisk', 'instanceRecommendation_currentPerformanceRisk' - The risk of the current instance not meeting the performance needs of
-- its workloads. The higher the risk, the more likely the current instance
-- cannot meet the performance requirements of its workload.
--
-- 'effectiveRecommendationPreferences', 'instanceRecommendation_effectiveRecommendationPreferences' - An object that describes the effective recommendation preferences for
-- the instance.
--
-- 'finding', 'instanceRecommendation_finding' - The finding classification of the instance.
--
-- Findings for instances include:
--
-- -   __@Underprovisioned@__ —An instance is considered under-provisioned
--     when at least one specification of your instance, such as CPU,
--     memory, or network, does not meet the performance requirements of
--     your workload. Under-provisioned instances may lead to poor
--     application performance.
--
-- -   __@Overprovisioned@__ —An instance is considered over-provisioned
--     when at least one specification of your instance, such as CPU,
--     memory, or network, can be sized down while still meeting the
--     performance requirements of your workload, and no specification is
--     under-provisioned. Over-provisioned instances may lead to
--     unnecessary infrastructure cost.
--
-- -   __@Optimized@__ —An instance is considered optimized when all
--     specifications of your instance, such as CPU, memory, and network,
--     meet the performance requirements of your workload and is not over
--     provisioned. For optimized resources, Compute Optimizer might
--     recommend a new generation instance type.
--
-- 'findingReasonCodes', 'instanceRecommendation_findingReasonCodes' - The reason for the finding classification of the instance.
--
-- Finding reason codes for instances include:
--
-- -   __@CPUOverprovisioned@__ — The instance’s CPU configuration can be
--     sized down while still meeting the performance requirements of your
--     workload. This is identified by analyzing the @CPUUtilization@
--     metric of the current instance during the look-back period.
--
-- -   __@CPUUnderprovisioned@__ — The instance’s CPU configuration
--     doesn\'t meet the performance requirements of your workload and
--     there is an alternative instance type that provides better CPU
--     performance. This is identified by analyzing the @CPUUtilization@
--     metric of the current instance during the look-back period.
--
-- -   __@MemoryOverprovisioned@__ — The instance’s memory configuration
--     can be sized down while still meeting the performance requirements
--     of your workload. This is identified by analyzing the memory
--     utilization metric of the current instance during the look-back
--     period.
--
-- -   __@MemoryUnderprovisioned@__ — The instance’s memory configuration
--     doesn\'t meet the performance requirements of your workload and
--     there is an alternative instance type that provides better memory
--     performance. This is identified by analyzing the memory utilization
--     metric of the current instance during the look-back period.
--
--     Memory utilization is analyzed only for resources that have the
--     unified CloudWatch agent installed on them. For more information,
--     see
--     <https://docs.aws.amazon.com/compute-optimizer/latest/ug/metrics.html#cw-agent Enabling memory utilization with the Amazon CloudWatch Agent>
--     in the /Compute Optimizer User Guide/. On Linux instances, Compute
--     Optimizer analyses the @mem_used_percent@ metric in the @CWAgent@
--     namespace, or the legacy @MemoryUtilization@ metric in the
--     @System\/Linux@ namespace. On Windows instances, Compute Optimizer
--     analyses the @Memory % Committed Bytes In Use@ metric in the
--     @CWAgent@ namespace.
--
-- -   __@EBSThroughputOverprovisioned@__ — The instance’s EBS throughput
--     configuration can be sized down while still meeting the performance
--     requirements of your workload. This is identified by analyzing the
--     @VolumeReadOps@ and @VolumeWriteOps@ metrics of EBS volumes attached
--     to the current instance during the look-back period.
--
-- -   __@EBSThroughputUnderprovisioned@__ — The instance’s EBS throughput
--     configuration doesn\'t meet the performance requirements of your
--     workload and there is an alternative instance type that provides
--     better EBS throughput performance. This is identified by analyzing
--     the @VolumeReadOps@ and @VolumeWriteOps@ metrics of EBS volumes
--     attached to the current instance during the look-back period.
--
-- -   __@EBSIOPSOverprovisioned@__ — The instance’s EBS IOPS configuration
--     can be sized down while still meeting the performance requirements
--     of your workload. This is identified by analyzing the
--     @VolumeReadBytes@ and @VolumeWriteBytes@ metric of EBS volumes
--     attached to the current instance during the look-back period.
--
-- -   __@EBSIOPSUnderprovisioned@__ — The instance’s EBS IOPS
--     configuration doesn\'t meet the performance requirements of your
--     workload and there is an alternative instance type that provides
--     better EBS IOPS performance. This is identified by analyzing the
--     @VolumeReadBytes@ and @VolumeWriteBytes@ metric of EBS volumes
--     attached to the current instance during the look-back period.
--
-- -   __@NetworkBandwidthOverprovisioned@__ — The instance’s network
--     bandwidth configuration can be sized down while still meeting the
--     performance requirements of your workload. This is identified by
--     analyzing the @NetworkIn@ and @NetworkOut@ metrics of the current
--     instance during the look-back period.
--
-- -   __@NetworkBandwidthUnderprovisioned@__ — The instance’s network
--     bandwidth configuration doesn\'t meet the performance requirements
--     of your workload and there is an alternative instance type that
--     provides better network bandwidth performance. This is identified by
--     analyzing the @NetworkIn@ and @NetworkOut@ metrics of the current
--     instance during the look-back period. This finding reason happens
--     when the @NetworkIn@ or @NetworkOut@ performance of an instance is
--     impacted.
--
-- -   __@NetworkPPSOverprovisioned@__ — The instance’s network PPS
--     (packets per second) configuration can be sized down while still
--     meeting the performance requirements of your workload. This is
--     identified by analyzing the @NetworkPacketsIn@ and
--     @NetworkPacketsIn@ metrics of the current instance during the
--     look-back period.
--
-- -   __@NetworkPPSUnderprovisioned@__ — The instance’s network PPS
--     (packets per second) configuration doesn\'t meet the performance
--     requirements of your workload and there is an alternative instance
--     type that provides better network PPS performance. This is
--     identified by analyzing the @NetworkPacketsIn@ and
--     @NetworkPacketsIn@ metrics of the current instance during the
--     look-back period.
--
-- -   __@DiskIOPSOverprovisioned@__ — The instance’s disk IOPS
--     configuration can be sized down while still meeting the performance
--     requirements of your workload. This is identified by analyzing the
--     @DiskReadOps@ and @DiskWriteOps@ metrics of the current instance
--     during the look-back period.
--
-- -   __@DiskIOPSUnderprovisioned@__ — The instance’s disk IOPS
--     configuration doesn\'t meet the performance requirements of your
--     workload and there is an alternative instance type that provides
--     better disk IOPS performance. This is identified by analyzing the
--     @DiskReadOps@ and @DiskWriteOps@ metrics of the current instance
--     during the look-back period.
--
-- -   __@DiskThroughputOverprovisioned@__ — The instance’s disk throughput
--     configuration can be sized down while still meeting the performance
--     requirements of your workload. This is identified by analyzing the
--     @DiskReadBytes@ and @DiskWriteBytes@ metrics of the current instance
--     during the look-back period.
--
-- -   __@DiskThroughputUnderprovisioned@__ — The instance’s disk
--     throughput configuration doesn\'t meet the performance requirements
--     of your workload and there is an alternative instance type that
--     provides better disk throughput performance. This is identified by
--     analyzing the @DiskReadBytes@ and @DiskWriteBytes@ metrics of the
--     current instance during the look-back period.
--
-- For more information about instance metrics, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html List the available CloudWatch metrics for your instances>
-- in the /Amazon Elastic Compute Cloud User Guide/. For more information
-- about EBS volume metrics, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using_cloudwatch_ebs.html Amazon CloudWatch metrics for Amazon EBS>
-- in the /Amazon Elastic Compute Cloud User Guide/.
--
-- 'inferredWorkloadTypes', 'instanceRecommendation_inferredWorkloadTypes' - The applications that might be running on the instance as inferred by
-- Compute Optimizer.
--
-- Compute Optimizer can infer if one of the following applications might
-- be running on the instance:
--
-- -   @AmazonEmr@ - Infers that Amazon EMR might be running on the
--     instance.
--
-- -   @ApacheCassandra@ - Infers that Apache Cassandra might be running on
--     the instance.
--
-- -   @ApacheHadoop@ - Infers that Apache Hadoop might be running on the
--     instance.
--
-- -   @Memcached@ - Infers that Memcached might be running on the
--     instance.
--
-- -   @NGINX@ - Infers that NGINX might be running on the instance.
--
-- -   @PostgreSql@ - Infers that PostgreSQL might be running on the
--     instance.
--
-- -   @Redis@ - Infers that Redis might be running on the instance.
--
-- 'instanceArn', 'instanceRecommendation_instanceArn' - The Amazon Resource Name (ARN) of the current instance.
--
-- 'instanceName', 'instanceRecommendation_instanceName' - The name of the current instance.
--
-- 'lastRefreshTimestamp', 'instanceRecommendation_lastRefreshTimestamp' - The timestamp of when the instance recommendation was last generated.
--
-- 'lookBackPeriodInDays', 'instanceRecommendation_lookBackPeriodInDays' - The number of days for which utilization metrics were analyzed for the
-- instance.
--
-- 'recommendationOptions', 'instanceRecommendation_recommendationOptions' - An array of objects that describe the recommendation options for the
-- instance.
--
-- 'recommendationSources', 'instanceRecommendation_recommendationSources' - An array of objects that describe the source resource of the
-- recommendation.
--
-- 'utilizationMetrics', 'instanceRecommendation_utilizationMetrics' - An array of objects that describe the utilization metrics of the
-- instance.
newInstanceRecommendation ::
  InstanceRecommendation
newInstanceRecommendation :: InstanceRecommendation
newInstanceRecommendation =
  InstanceRecommendation'
    { $sel:accountId:InstanceRecommendation' :: Maybe Text
accountId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:currentInstanceType:InstanceRecommendation' :: Maybe Text
currentInstanceType = forall a. Maybe a
Prelude.Nothing,
      $sel:currentPerformanceRisk:InstanceRecommendation' :: Maybe CurrentPerformanceRisk
currentPerformanceRisk = forall a. Maybe a
Prelude.Nothing,
      $sel:effectiveRecommendationPreferences:InstanceRecommendation' :: Maybe EffectiveRecommendationPreferences
effectiveRecommendationPreferences =
        forall a. Maybe a
Prelude.Nothing,
      $sel:finding:InstanceRecommendation' :: Maybe Finding
finding = forall a. Maybe a
Prelude.Nothing,
      $sel:findingReasonCodes:InstanceRecommendation' :: Maybe [InstanceRecommendationFindingReasonCode]
findingReasonCodes = forall a. Maybe a
Prelude.Nothing,
      $sel:inferredWorkloadTypes:InstanceRecommendation' :: Maybe [InferredWorkloadType]
inferredWorkloadTypes = forall a. Maybe a
Prelude.Nothing,
      $sel:instanceArn:InstanceRecommendation' :: Maybe Text
instanceArn = forall a. Maybe a
Prelude.Nothing,
      $sel:instanceName:InstanceRecommendation' :: Maybe Text
instanceName = forall a. Maybe a
Prelude.Nothing,
      $sel:lastRefreshTimestamp:InstanceRecommendation' :: Maybe POSIX
lastRefreshTimestamp = forall a. Maybe a
Prelude.Nothing,
      $sel:lookBackPeriodInDays:InstanceRecommendation' :: Maybe Double
lookBackPeriodInDays = forall a. Maybe a
Prelude.Nothing,
      $sel:recommendationOptions:InstanceRecommendation' :: Maybe [InstanceRecommendationOption]
recommendationOptions = forall a. Maybe a
Prelude.Nothing,
      $sel:recommendationSources:InstanceRecommendation' :: Maybe [RecommendationSource]
recommendationSources = forall a. Maybe a
Prelude.Nothing,
      $sel:utilizationMetrics:InstanceRecommendation' :: Maybe [UtilizationMetric]
utilizationMetrics = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Web Services account ID of the instance.
instanceRecommendation_accountId :: Lens.Lens' InstanceRecommendation (Prelude.Maybe Prelude.Text)
instanceRecommendation_accountId :: Lens' InstanceRecommendation (Maybe Text)
instanceRecommendation_accountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRecommendation' {Maybe Text
accountId :: Maybe Text
$sel:accountId:InstanceRecommendation' :: InstanceRecommendation -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: InstanceRecommendation
s@InstanceRecommendation' {} Maybe Text
a -> InstanceRecommendation
s {$sel:accountId:InstanceRecommendation' :: Maybe Text
accountId = Maybe Text
a} :: InstanceRecommendation)

-- | The instance type of the current instance.
instanceRecommendation_currentInstanceType :: Lens.Lens' InstanceRecommendation (Prelude.Maybe Prelude.Text)
instanceRecommendation_currentInstanceType :: Lens' InstanceRecommendation (Maybe Text)
instanceRecommendation_currentInstanceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRecommendation' {Maybe Text
currentInstanceType :: Maybe Text
$sel:currentInstanceType:InstanceRecommendation' :: InstanceRecommendation -> Maybe Text
currentInstanceType} -> Maybe Text
currentInstanceType) (\s :: InstanceRecommendation
s@InstanceRecommendation' {} Maybe Text
a -> InstanceRecommendation
s {$sel:currentInstanceType:InstanceRecommendation' :: Maybe Text
currentInstanceType = Maybe Text
a} :: InstanceRecommendation)

-- | The risk of the current instance not meeting the performance needs of
-- its workloads. The higher the risk, the more likely the current instance
-- cannot meet the performance requirements of its workload.
instanceRecommendation_currentPerformanceRisk :: Lens.Lens' InstanceRecommendation (Prelude.Maybe CurrentPerformanceRisk)
instanceRecommendation_currentPerformanceRisk :: Lens' InstanceRecommendation (Maybe CurrentPerformanceRisk)
instanceRecommendation_currentPerformanceRisk = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRecommendation' {Maybe CurrentPerformanceRisk
currentPerformanceRisk :: Maybe CurrentPerformanceRisk
$sel:currentPerformanceRisk:InstanceRecommendation' :: InstanceRecommendation -> Maybe CurrentPerformanceRisk
currentPerformanceRisk} -> Maybe CurrentPerformanceRisk
currentPerformanceRisk) (\s :: InstanceRecommendation
s@InstanceRecommendation' {} Maybe CurrentPerformanceRisk
a -> InstanceRecommendation
s {$sel:currentPerformanceRisk:InstanceRecommendation' :: Maybe CurrentPerformanceRisk
currentPerformanceRisk = Maybe CurrentPerformanceRisk
a} :: InstanceRecommendation)

-- | An object that describes the effective recommendation preferences for
-- the instance.
instanceRecommendation_effectiveRecommendationPreferences :: Lens.Lens' InstanceRecommendation (Prelude.Maybe EffectiveRecommendationPreferences)
instanceRecommendation_effectiveRecommendationPreferences :: Lens'
  InstanceRecommendation (Maybe EffectiveRecommendationPreferences)
instanceRecommendation_effectiveRecommendationPreferences = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRecommendation' {Maybe EffectiveRecommendationPreferences
effectiveRecommendationPreferences :: Maybe EffectiveRecommendationPreferences
$sel:effectiveRecommendationPreferences:InstanceRecommendation' :: InstanceRecommendation -> Maybe EffectiveRecommendationPreferences
effectiveRecommendationPreferences} -> Maybe EffectiveRecommendationPreferences
effectiveRecommendationPreferences) (\s :: InstanceRecommendation
s@InstanceRecommendation' {} Maybe EffectiveRecommendationPreferences
a -> InstanceRecommendation
s {$sel:effectiveRecommendationPreferences:InstanceRecommendation' :: Maybe EffectiveRecommendationPreferences
effectiveRecommendationPreferences = Maybe EffectiveRecommendationPreferences
a} :: InstanceRecommendation)

-- | The finding classification of the instance.
--
-- Findings for instances include:
--
-- -   __@Underprovisioned@__ —An instance is considered under-provisioned
--     when at least one specification of your instance, such as CPU,
--     memory, or network, does not meet the performance requirements of
--     your workload. Under-provisioned instances may lead to poor
--     application performance.
--
-- -   __@Overprovisioned@__ —An instance is considered over-provisioned
--     when at least one specification of your instance, such as CPU,
--     memory, or network, can be sized down while still meeting the
--     performance requirements of your workload, and no specification is
--     under-provisioned. Over-provisioned instances may lead to
--     unnecessary infrastructure cost.
--
-- -   __@Optimized@__ —An instance is considered optimized when all
--     specifications of your instance, such as CPU, memory, and network,
--     meet the performance requirements of your workload and is not over
--     provisioned. For optimized resources, Compute Optimizer might
--     recommend a new generation instance type.
instanceRecommendation_finding :: Lens.Lens' InstanceRecommendation (Prelude.Maybe Finding)
instanceRecommendation_finding :: Lens' InstanceRecommendation (Maybe Finding)
instanceRecommendation_finding = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRecommendation' {Maybe Finding
finding :: Maybe Finding
$sel:finding:InstanceRecommendation' :: InstanceRecommendation -> Maybe Finding
finding} -> Maybe Finding
finding) (\s :: InstanceRecommendation
s@InstanceRecommendation' {} Maybe Finding
a -> InstanceRecommendation
s {$sel:finding:InstanceRecommendation' :: Maybe Finding
finding = Maybe Finding
a} :: InstanceRecommendation)

-- | The reason for the finding classification of the instance.
--
-- Finding reason codes for instances include:
--
-- -   __@CPUOverprovisioned@__ — The instance’s CPU configuration can be
--     sized down while still meeting the performance requirements of your
--     workload. This is identified by analyzing the @CPUUtilization@
--     metric of the current instance during the look-back period.
--
-- -   __@CPUUnderprovisioned@__ — The instance’s CPU configuration
--     doesn\'t meet the performance requirements of your workload and
--     there is an alternative instance type that provides better CPU
--     performance. This is identified by analyzing the @CPUUtilization@
--     metric of the current instance during the look-back period.
--
-- -   __@MemoryOverprovisioned@__ — The instance’s memory configuration
--     can be sized down while still meeting the performance requirements
--     of your workload. This is identified by analyzing the memory
--     utilization metric of the current instance during the look-back
--     period.
--
-- -   __@MemoryUnderprovisioned@__ — The instance’s memory configuration
--     doesn\'t meet the performance requirements of your workload and
--     there is an alternative instance type that provides better memory
--     performance. This is identified by analyzing the memory utilization
--     metric of the current instance during the look-back period.
--
--     Memory utilization is analyzed only for resources that have the
--     unified CloudWatch agent installed on them. For more information,
--     see
--     <https://docs.aws.amazon.com/compute-optimizer/latest/ug/metrics.html#cw-agent Enabling memory utilization with the Amazon CloudWatch Agent>
--     in the /Compute Optimizer User Guide/. On Linux instances, Compute
--     Optimizer analyses the @mem_used_percent@ metric in the @CWAgent@
--     namespace, or the legacy @MemoryUtilization@ metric in the
--     @System\/Linux@ namespace. On Windows instances, Compute Optimizer
--     analyses the @Memory % Committed Bytes In Use@ metric in the
--     @CWAgent@ namespace.
--
-- -   __@EBSThroughputOverprovisioned@__ — The instance’s EBS throughput
--     configuration can be sized down while still meeting the performance
--     requirements of your workload. This is identified by analyzing the
--     @VolumeReadOps@ and @VolumeWriteOps@ metrics of EBS volumes attached
--     to the current instance during the look-back period.
--
-- -   __@EBSThroughputUnderprovisioned@__ — The instance’s EBS throughput
--     configuration doesn\'t meet the performance requirements of your
--     workload and there is an alternative instance type that provides
--     better EBS throughput performance. This is identified by analyzing
--     the @VolumeReadOps@ and @VolumeWriteOps@ metrics of EBS volumes
--     attached to the current instance during the look-back period.
--
-- -   __@EBSIOPSOverprovisioned@__ — The instance’s EBS IOPS configuration
--     can be sized down while still meeting the performance requirements
--     of your workload. This is identified by analyzing the
--     @VolumeReadBytes@ and @VolumeWriteBytes@ metric of EBS volumes
--     attached to the current instance during the look-back period.
--
-- -   __@EBSIOPSUnderprovisioned@__ — The instance’s EBS IOPS
--     configuration doesn\'t meet the performance requirements of your
--     workload and there is an alternative instance type that provides
--     better EBS IOPS performance. This is identified by analyzing the
--     @VolumeReadBytes@ and @VolumeWriteBytes@ metric of EBS volumes
--     attached to the current instance during the look-back period.
--
-- -   __@NetworkBandwidthOverprovisioned@__ — The instance’s network
--     bandwidth configuration can be sized down while still meeting the
--     performance requirements of your workload. This is identified by
--     analyzing the @NetworkIn@ and @NetworkOut@ metrics of the current
--     instance during the look-back period.
--
-- -   __@NetworkBandwidthUnderprovisioned@__ — The instance’s network
--     bandwidth configuration doesn\'t meet the performance requirements
--     of your workload and there is an alternative instance type that
--     provides better network bandwidth performance. This is identified by
--     analyzing the @NetworkIn@ and @NetworkOut@ metrics of the current
--     instance during the look-back period. This finding reason happens
--     when the @NetworkIn@ or @NetworkOut@ performance of an instance is
--     impacted.
--
-- -   __@NetworkPPSOverprovisioned@__ — The instance’s network PPS
--     (packets per second) configuration can be sized down while still
--     meeting the performance requirements of your workload. This is
--     identified by analyzing the @NetworkPacketsIn@ and
--     @NetworkPacketsIn@ metrics of the current instance during the
--     look-back period.
--
-- -   __@NetworkPPSUnderprovisioned@__ — The instance’s network PPS
--     (packets per second) configuration doesn\'t meet the performance
--     requirements of your workload and there is an alternative instance
--     type that provides better network PPS performance. This is
--     identified by analyzing the @NetworkPacketsIn@ and
--     @NetworkPacketsIn@ metrics of the current instance during the
--     look-back period.
--
-- -   __@DiskIOPSOverprovisioned@__ — The instance’s disk IOPS
--     configuration can be sized down while still meeting the performance
--     requirements of your workload. This is identified by analyzing the
--     @DiskReadOps@ and @DiskWriteOps@ metrics of the current instance
--     during the look-back period.
--
-- -   __@DiskIOPSUnderprovisioned@__ — The instance’s disk IOPS
--     configuration doesn\'t meet the performance requirements of your
--     workload and there is an alternative instance type that provides
--     better disk IOPS performance. This is identified by analyzing the
--     @DiskReadOps@ and @DiskWriteOps@ metrics of the current instance
--     during the look-back period.
--
-- -   __@DiskThroughputOverprovisioned@__ — The instance’s disk throughput
--     configuration can be sized down while still meeting the performance
--     requirements of your workload. This is identified by analyzing the
--     @DiskReadBytes@ and @DiskWriteBytes@ metrics of the current instance
--     during the look-back period.
--
-- -   __@DiskThroughputUnderprovisioned@__ — The instance’s disk
--     throughput configuration doesn\'t meet the performance requirements
--     of your workload and there is an alternative instance type that
--     provides better disk throughput performance. This is identified by
--     analyzing the @DiskReadBytes@ and @DiskWriteBytes@ metrics of the
--     current instance during the look-back period.
--
-- For more information about instance metrics, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html List the available CloudWatch metrics for your instances>
-- in the /Amazon Elastic Compute Cloud User Guide/. For more information
-- about EBS volume metrics, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using_cloudwatch_ebs.html Amazon CloudWatch metrics for Amazon EBS>
-- in the /Amazon Elastic Compute Cloud User Guide/.
instanceRecommendation_findingReasonCodes :: Lens.Lens' InstanceRecommendation (Prelude.Maybe [InstanceRecommendationFindingReasonCode])
instanceRecommendation_findingReasonCodes :: Lens'
  InstanceRecommendation
  (Maybe [InstanceRecommendationFindingReasonCode])
instanceRecommendation_findingReasonCodes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRecommendation' {Maybe [InstanceRecommendationFindingReasonCode]
findingReasonCodes :: Maybe [InstanceRecommendationFindingReasonCode]
$sel:findingReasonCodes:InstanceRecommendation' :: InstanceRecommendation
-> Maybe [InstanceRecommendationFindingReasonCode]
findingReasonCodes} -> Maybe [InstanceRecommendationFindingReasonCode]
findingReasonCodes) (\s :: InstanceRecommendation
s@InstanceRecommendation' {} Maybe [InstanceRecommendationFindingReasonCode]
a -> InstanceRecommendation
s {$sel:findingReasonCodes:InstanceRecommendation' :: Maybe [InstanceRecommendationFindingReasonCode]
findingReasonCodes = Maybe [InstanceRecommendationFindingReasonCode]
a} :: InstanceRecommendation) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The applications that might be running on the instance as inferred by
-- Compute Optimizer.
--
-- Compute Optimizer can infer if one of the following applications might
-- be running on the instance:
--
-- -   @AmazonEmr@ - Infers that Amazon EMR might be running on the
--     instance.
--
-- -   @ApacheCassandra@ - Infers that Apache Cassandra might be running on
--     the instance.
--
-- -   @ApacheHadoop@ - Infers that Apache Hadoop might be running on the
--     instance.
--
-- -   @Memcached@ - Infers that Memcached might be running on the
--     instance.
--
-- -   @NGINX@ - Infers that NGINX might be running on the instance.
--
-- -   @PostgreSql@ - Infers that PostgreSQL might be running on the
--     instance.
--
-- -   @Redis@ - Infers that Redis might be running on the instance.
instanceRecommendation_inferredWorkloadTypes :: Lens.Lens' InstanceRecommendation (Prelude.Maybe [InferredWorkloadType])
instanceRecommendation_inferredWorkloadTypes :: Lens' InstanceRecommendation (Maybe [InferredWorkloadType])
instanceRecommendation_inferredWorkloadTypes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRecommendation' {Maybe [InferredWorkloadType]
inferredWorkloadTypes :: Maybe [InferredWorkloadType]
$sel:inferredWorkloadTypes:InstanceRecommendation' :: InstanceRecommendation -> Maybe [InferredWorkloadType]
inferredWorkloadTypes} -> Maybe [InferredWorkloadType]
inferredWorkloadTypes) (\s :: InstanceRecommendation
s@InstanceRecommendation' {} Maybe [InferredWorkloadType]
a -> InstanceRecommendation
s {$sel:inferredWorkloadTypes:InstanceRecommendation' :: Maybe [InferredWorkloadType]
inferredWorkloadTypes = Maybe [InferredWorkloadType]
a} :: InstanceRecommendation) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Resource Name (ARN) of the current instance.
instanceRecommendation_instanceArn :: Lens.Lens' InstanceRecommendation (Prelude.Maybe Prelude.Text)
instanceRecommendation_instanceArn :: Lens' InstanceRecommendation (Maybe Text)
instanceRecommendation_instanceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRecommendation' {Maybe Text
instanceArn :: Maybe Text
$sel:instanceArn:InstanceRecommendation' :: InstanceRecommendation -> Maybe Text
instanceArn} -> Maybe Text
instanceArn) (\s :: InstanceRecommendation
s@InstanceRecommendation' {} Maybe Text
a -> InstanceRecommendation
s {$sel:instanceArn:InstanceRecommendation' :: Maybe Text
instanceArn = Maybe Text
a} :: InstanceRecommendation)

-- | The name of the current instance.
instanceRecommendation_instanceName :: Lens.Lens' InstanceRecommendation (Prelude.Maybe Prelude.Text)
instanceRecommendation_instanceName :: Lens' InstanceRecommendation (Maybe Text)
instanceRecommendation_instanceName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRecommendation' {Maybe Text
instanceName :: Maybe Text
$sel:instanceName:InstanceRecommendation' :: InstanceRecommendation -> Maybe Text
instanceName} -> Maybe Text
instanceName) (\s :: InstanceRecommendation
s@InstanceRecommendation' {} Maybe Text
a -> InstanceRecommendation
s {$sel:instanceName:InstanceRecommendation' :: Maybe Text
instanceName = Maybe Text
a} :: InstanceRecommendation)

-- | The timestamp of when the instance recommendation was last generated.
instanceRecommendation_lastRefreshTimestamp :: Lens.Lens' InstanceRecommendation (Prelude.Maybe Prelude.UTCTime)
instanceRecommendation_lastRefreshTimestamp :: Lens' InstanceRecommendation (Maybe UTCTime)
instanceRecommendation_lastRefreshTimestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRecommendation' {Maybe POSIX
lastRefreshTimestamp :: Maybe POSIX
$sel:lastRefreshTimestamp:InstanceRecommendation' :: InstanceRecommendation -> Maybe POSIX
lastRefreshTimestamp} -> Maybe POSIX
lastRefreshTimestamp) (\s :: InstanceRecommendation
s@InstanceRecommendation' {} Maybe POSIX
a -> InstanceRecommendation
s {$sel:lastRefreshTimestamp:InstanceRecommendation' :: Maybe POSIX
lastRefreshTimestamp = Maybe POSIX
a} :: InstanceRecommendation) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The number of days for which utilization metrics were analyzed for the
-- instance.
instanceRecommendation_lookBackPeriodInDays :: Lens.Lens' InstanceRecommendation (Prelude.Maybe Prelude.Double)
instanceRecommendation_lookBackPeriodInDays :: Lens' InstanceRecommendation (Maybe Double)
instanceRecommendation_lookBackPeriodInDays = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRecommendation' {Maybe Double
lookBackPeriodInDays :: Maybe Double
$sel:lookBackPeriodInDays:InstanceRecommendation' :: InstanceRecommendation -> Maybe Double
lookBackPeriodInDays} -> Maybe Double
lookBackPeriodInDays) (\s :: InstanceRecommendation
s@InstanceRecommendation' {} Maybe Double
a -> InstanceRecommendation
s {$sel:lookBackPeriodInDays:InstanceRecommendation' :: Maybe Double
lookBackPeriodInDays = Maybe Double
a} :: InstanceRecommendation)

-- | An array of objects that describe the recommendation options for the
-- instance.
instanceRecommendation_recommendationOptions :: Lens.Lens' InstanceRecommendation (Prelude.Maybe [InstanceRecommendationOption])
instanceRecommendation_recommendationOptions :: Lens' InstanceRecommendation (Maybe [InstanceRecommendationOption])
instanceRecommendation_recommendationOptions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRecommendation' {Maybe [InstanceRecommendationOption]
recommendationOptions :: Maybe [InstanceRecommendationOption]
$sel:recommendationOptions:InstanceRecommendation' :: InstanceRecommendation -> Maybe [InstanceRecommendationOption]
recommendationOptions} -> Maybe [InstanceRecommendationOption]
recommendationOptions) (\s :: InstanceRecommendation
s@InstanceRecommendation' {} Maybe [InstanceRecommendationOption]
a -> InstanceRecommendation
s {$sel:recommendationOptions:InstanceRecommendation' :: Maybe [InstanceRecommendationOption]
recommendationOptions = Maybe [InstanceRecommendationOption]
a} :: InstanceRecommendation) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An array of objects that describe the source resource of the
-- recommendation.
instanceRecommendation_recommendationSources :: Lens.Lens' InstanceRecommendation (Prelude.Maybe [RecommendationSource])
instanceRecommendation_recommendationSources :: Lens' InstanceRecommendation (Maybe [RecommendationSource])
instanceRecommendation_recommendationSources = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRecommendation' {Maybe [RecommendationSource]
recommendationSources :: Maybe [RecommendationSource]
$sel:recommendationSources:InstanceRecommendation' :: InstanceRecommendation -> Maybe [RecommendationSource]
recommendationSources} -> Maybe [RecommendationSource]
recommendationSources) (\s :: InstanceRecommendation
s@InstanceRecommendation' {} Maybe [RecommendationSource]
a -> InstanceRecommendation
s {$sel:recommendationSources:InstanceRecommendation' :: Maybe [RecommendationSource]
recommendationSources = Maybe [RecommendationSource]
a} :: InstanceRecommendation) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An array of objects that describe the utilization metrics of the
-- instance.
instanceRecommendation_utilizationMetrics :: Lens.Lens' InstanceRecommendation (Prelude.Maybe [UtilizationMetric])
instanceRecommendation_utilizationMetrics :: Lens' InstanceRecommendation (Maybe [UtilizationMetric])
instanceRecommendation_utilizationMetrics = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRecommendation' {Maybe [UtilizationMetric]
utilizationMetrics :: Maybe [UtilizationMetric]
$sel:utilizationMetrics:InstanceRecommendation' :: InstanceRecommendation -> Maybe [UtilizationMetric]
utilizationMetrics} -> Maybe [UtilizationMetric]
utilizationMetrics) (\s :: InstanceRecommendation
s@InstanceRecommendation' {} Maybe [UtilizationMetric]
a -> InstanceRecommendation
s {$sel:utilizationMetrics:InstanceRecommendation' :: Maybe [UtilizationMetric]
utilizationMetrics = Maybe [UtilizationMetric]
a} :: InstanceRecommendation) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Data.FromJSON InstanceRecommendation where
  parseJSON :: Value -> Parser InstanceRecommendation
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"InstanceRecommendation"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe CurrentPerformanceRisk
-> Maybe EffectiveRecommendationPreferences
-> Maybe Finding
-> Maybe [InstanceRecommendationFindingReasonCode]
-> Maybe [InferredWorkloadType]
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Double
-> Maybe [InstanceRecommendationOption]
-> Maybe [RecommendationSource]
-> Maybe [UtilizationMetric]
-> InstanceRecommendation
InstanceRecommendation'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"accountId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"currentInstanceType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"currentPerformanceRisk")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"effectiveRecommendationPreferences")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"finding")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"findingReasonCodes"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"inferredWorkloadTypes"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"instanceArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"instanceName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"lastRefreshTimestamp")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"lookBackPeriodInDays")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"recommendationOptions"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"recommendationSources"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"utilizationMetrics"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable InstanceRecommendation where
  hashWithSalt :: Int -> InstanceRecommendation -> Int
hashWithSalt Int
_salt InstanceRecommendation' {Maybe Double
Maybe [InferredWorkloadType]
Maybe [InstanceRecommendationFindingReasonCode]
Maybe [RecommendationSource]
Maybe [UtilizationMetric]
Maybe [InstanceRecommendationOption]
Maybe Text
Maybe POSIX
Maybe CurrentPerformanceRisk
Maybe Finding
Maybe EffectiveRecommendationPreferences
utilizationMetrics :: Maybe [UtilizationMetric]
recommendationSources :: Maybe [RecommendationSource]
recommendationOptions :: Maybe [InstanceRecommendationOption]
lookBackPeriodInDays :: Maybe Double
lastRefreshTimestamp :: Maybe POSIX
instanceName :: Maybe Text
instanceArn :: Maybe Text
inferredWorkloadTypes :: Maybe [InferredWorkloadType]
findingReasonCodes :: Maybe [InstanceRecommendationFindingReasonCode]
finding :: Maybe Finding
effectiveRecommendationPreferences :: Maybe EffectiveRecommendationPreferences
currentPerformanceRisk :: Maybe CurrentPerformanceRisk
currentInstanceType :: Maybe Text
accountId :: Maybe Text
$sel:utilizationMetrics:InstanceRecommendation' :: InstanceRecommendation -> Maybe [UtilizationMetric]
$sel:recommendationSources:InstanceRecommendation' :: InstanceRecommendation -> Maybe [RecommendationSource]
$sel:recommendationOptions:InstanceRecommendation' :: InstanceRecommendation -> Maybe [InstanceRecommendationOption]
$sel:lookBackPeriodInDays:InstanceRecommendation' :: InstanceRecommendation -> Maybe Double
$sel:lastRefreshTimestamp:InstanceRecommendation' :: InstanceRecommendation -> Maybe POSIX
$sel:instanceName:InstanceRecommendation' :: InstanceRecommendation -> Maybe Text
$sel:instanceArn:InstanceRecommendation' :: InstanceRecommendation -> Maybe Text
$sel:inferredWorkloadTypes:InstanceRecommendation' :: InstanceRecommendation -> Maybe [InferredWorkloadType]
$sel:findingReasonCodes:InstanceRecommendation' :: InstanceRecommendation
-> Maybe [InstanceRecommendationFindingReasonCode]
$sel:finding:InstanceRecommendation' :: InstanceRecommendation -> Maybe Finding
$sel:effectiveRecommendationPreferences:InstanceRecommendation' :: InstanceRecommendation -> Maybe EffectiveRecommendationPreferences
$sel:currentPerformanceRisk:InstanceRecommendation' :: InstanceRecommendation -> Maybe CurrentPerformanceRisk
$sel:currentInstanceType:InstanceRecommendation' :: InstanceRecommendation -> Maybe Text
$sel:accountId:InstanceRecommendation' :: InstanceRecommendation -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
accountId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
currentInstanceType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CurrentPerformanceRisk
currentPerformanceRisk
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EffectiveRecommendationPreferences
effectiveRecommendationPreferences
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Finding
finding
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [InstanceRecommendationFindingReasonCode]
findingReasonCodes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [InferredWorkloadType]
inferredWorkloadTypes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
instanceArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
instanceName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastRefreshTimestamp
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
lookBackPeriodInDays
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [InstanceRecommendationOption]
recommendationOptions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [RecommendationSource]
recommendationSources
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [UtilizationMetric]
utilizationMetrics

instance Prelude.NFData InstanceRecommendation where
  rnf :: InstanceRecommendation -> ()
rnf InstanceRecommendation' {Maybe Double
Maybe [InferredWorkloadType]
Maybe [InstanceRecommendationFindingReasonCode]
Maybe [RecommendationSource]
Maybe [UtilizationMetric]
Maybe [InstanceRecommendationOption]
Maybe Text
Maybe POSIX
Maybe CurrentPerformanceRisk
Maybe Finding
Maybe EffectiveRecommendationPreferences
utilizationMetrics :: Maybe [UtilizationMetric]
recommendationSources :: Maybe [RecommendationSource]
recommendationOptions :: Maybe [InstanceRecommendationOption]
lookBackPeriodInDays :: Maybe Double
lastRefreshTimestamp :: Maybe POSIX
instanceName :: Maybe Text
instanceArn :: Maybe Text
inferredWorkloadTypes :: Maybe [InferredWorkloadType]
findingReasonCodes :: Maybe [InstanceRecommendationFindingReasonCode]
finding :: Maybe Finding
effectiveRecommendationPreferences :: Maybe EffectiveRecommendationPreferences
currentPerformanceRisk :: Maybe CurrentPerformanceRisk
currentInstanceType :: Maybe Text
accountId :: Maybe Text
$sel:utilizationMetrics:InstanceRecommendation' :: InstanceRecommendation -> Maybe [UtilizationMetric]
$sel:recommendationSources:InstanceRecommendation' :: InstanceRecommendation -> Maybe [RecommendationSource]
$sel:recommendationOptions:InstanceRecommendation' :: InstanceRecommendation -> Maybe [InstanceRecommendationOption]
$sel:lookBackPeriodInDays:InstanceRecommendation' :: InstanceRecommendation -> Maybe Double
$sel:lastRefreshTimestamp:InstanceRecommendation' :: InstanceRecommendation -> Maybe POSIX
$sel:instanceName:InstanceRecommendation' :: InstanceRecommendation -> Maybe Text
$sel:instanceArn:InstanceRecommendation' :: InstanceRecommendation -> Maybe Text
$sel:inferredWorkloadTypes:InstanceRecommendation' :: InstanceRecommendation -> Maybe [InferredWorkloadType]
$sel:findingReasonCodes:InstanceRecommendation' :: InstanceRecommendation
-> Maybe [InstanceRecommendationFindingReasonCode]
$sel:finding:InstanceRecommendation' :: InstanceRecommendation -> Maybe Finding
$sel:effectiveRecommendationPreferences:InstanceRecommendation' :: InstanceRecommendation -> Maybe EffectiveRecommendationPreferences
$sel:currentPerformanceRisk:InstanceRecommendation' :: InstanceRecommendation -> Maybe CurrentPerformanceRisk
$sel:currentInstanceType:InstanceRecommendation' :: InstanceRecommendation -> Maybe Text
$sel:accountId:InstanceRecommendation' :: InstanceRecommendation -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
accountId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
currentInstanceType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CurrentPerformanceRisk
currentPerformanceRisk
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EffectiveRecommendationPreferences
effectiveRecommendationPreferences
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Finding
finding
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [InstanceRecommendationFindingReasonCode]
findingReasonCodes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [InferredWorkloadType]
inferredWorkloadTypes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
instanceArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
instanceName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastRefreshTimestamp
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
lookBackPeriodInDays
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [InstanceRecommendationOption]
recommendationOptions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [RecommendationSource]
recommendationSources
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [UtilizationMetric]
utilizationMetrics