{-# 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.InstanceRecommendationOption
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.ComputeOptimizer.Types.InstanceRecommendationOption where

import Amazonka.ComputeOptimizer.Types.PlatformDifference
import Amazonka.ComputeOptimizer.Types.UtilizationMetric
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Describes a recommendation option for an Amazon EC2 instance.
--
-- /See:/ 'newInstanceRecommendationOption' smart constructor.
data InstanceRecommendationOption = InstanceRecommendationOption'
  { -- | Describes the configuration differences between the current instance and
    -- the recommended instance type. You should consider the configuration
    -- differences before migrating your workloads from the current instance to
    -- the recommended instance type. The
    -- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-resize.html Change the instance type guide for Linux>
    -- and
    -- <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2-instance-resize.html Change the instance type guide for Windows>
    -- provide general guidance for getting started with an instance migration.
    --
    -- Platform differences include:
    --
    -- -   __@Hypervisor@__ — The hypervisor of the recommended instance type
    --     is different than that of the current instance. For example, the
    --     recommended instance type uses a Nitro hypervisor and the current
    --     instance uses a Xen hypervisor. The differences that you should
    --     consider between these hypervisors are covered in the
    --     <http://aws.amazon.com/ec2/faqs/#Nitro_Hypervisor Nitro Hypervisor>
    --     section of the Amazon EC2 frequently asked questions. For more
    --     information, see
    --     <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances Instances built on the Nitro System>
    --     in the /Amazon EC2 User Guide for Linux/, or
    --     <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/instance-types.html#ec2-nitro-instances Instances built on the Nitro System>
    --     in the /Amazon EC2 User Guide for Windows/.
    --
    -- -   __@NetworkInterface@__ — The network interface of the recommended
    --     instance type is different than that of the current instance. For
    --     example, the recommended instance type supports enhanced networking
    --     and the current instance might not. To enable enhanced networking
    --     for the recommended instance type, you must install the Elastic
    --     Network Adapter (ENA) driver or the Intel 82599 Virtual Function
    --     driver. For more information, see
    --     <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#instance-networking-storage Networking and storage features>
    --     and
    --     <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/enhanced-networking.html Enhanced networking on Linux>
    --     in the /Amazon EC2 User Guide for Linux/, or
    --     <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/instance-types.html#instance-networking-storage Networking and storage features>
    --     and
    --     <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/enhanced-networking.html Enhanced networking on Windows>
    --     in the /Amazon EC2 User Guide for Windows/.
    --
    -- -   __@StorageInterface@__ — The storage interface of the recommended
    --     instance type is different than that of the current instance. For
    --     example, the recommended instance type uses an NVMe storage
    --     interface and the current instance does not. To access NVMe volumes
    --     for the recommended instance type, you will need to install or
    --     upgrade the NVMe driver. For more information, see
    --     <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#instance-networking-storage Networking and storage features>
    --     and
    --     <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nvme-ebs-volumes.html Amazon EBS and NVMe on Linux instances>
    --     in the /Amazon EC2 User Guide for Linux/, or
    --     <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/instance-types.html#instance-networking-storage Networking and storage features>
    --     and
    --     <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/nvme-ebs-volumes.html Amazon EBS and NVMe on Windows instances>
    --     in the /Amazon EC2 User Guide for Windows/.
    --
    -- -   __@InstanceStoreAvailability@__ — The recommended instance type does
    --     not support instance store volumes and the current instance does.
    --     Before migrating, you might need to back up the data on your
    --     instance store volumes if you want to preserve them. For more
    --     information, see
    --     <https://aws.amazon.com/premiumsupport/knowledge-center/back-up-instance-store-ebs/ How do I back up an instance store volume on my Amazon EC2 instance to Amazon EBS?>
    --     in the /Amazon Web Services Premium Support Knowledge Base/. For
    --     more information, see
    --     <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#instance-networking-storage Networking and storage features>
    --     and
    --     <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html Amazon EC2 instance store>
    --     in the /Amazon EC2 User Guide for Linux/, or see
    --     <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/instance-types.html#instance-networking-storage Networking and storage features>
    --     and
    --     <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/InstanceStorage.html Amazon EC2 instance store>
    --     in the /Amazon EC2 User Guide for Windows/.
    --
    -- -   __@VirtualizationType@__ — The recommended instance type uses the
    --     hardware virtual machine (HVM) virtualization type and the current
    --     instance uses the paravirtual (PV) virtualization type. For more
    --     information about the differences between these virtualization
    --     types, see
    --     <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/virtualization_types.html Linux AMI virtualization types>
    --     in the /Amazon EC2 User Guide for Linux/, or
    --     <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/windows-ami-version-history.html#virtualization-types Windows AMI virtualization types>
    --     in the /Amazon EC2 User Guide for Windows/.
    --
    -- -   __@Architecture@__ — The CPU architecture between the recommended
    --     instance type and the current instance is different. For example,
    --     the recommended instance type might use an Arm CPU architecture and
    --     the current instance type might use a different one, such as x86.
    --     Before migrating, you should consider recompiling the software on
    --     your instance for the new architecture. Alternatively, you might
    --     switch to an Amazon Machine Image (AMI) that supports the new
    --     architecture. For more information about the CPU architecture for
    --     each instance type, see
    --     <http://aws.amazon.com/ec2/instance-types/ Amazon EC2 Instance Types>.
    InstanceRecommendationOption -> Maybe [PlatformDifference]
platformDifferences :: Prelude.Maybe [PlatformDifference],
    -- | The performance risk of the instance recommendation option.
    --
    -- Performance risk indicates the likelihood of the recommended instance
    -- type not meeting the resource needs of your workload. Compute Optimizer
    -- calculates an individual performance risk score for each specification
    -- of the recommended instance, including CPU, memory, EBS throughput, EBS
    -- IOPS, disk throughput, disk IOPS, network throughput, and network PPS.
    -- The performance risk of the recommended instance is calculated as the
    -- maximum performance risk score across the analyzed resource
    -- specifications.
    --
    -- The value ranges from @0@ - @4@, with @0@ meaning that the recommended
    -- resource is predicted to always provide enough hardware capability. The
    -- higher the performance risk is, the more likely you should validate
    -- whether the recommendation will meet the performance requirements of
    -- your workload before migrating your resource.
    InstanceRecommendationOption -> Maybe Double
performanceRisk :: Prelude.Maybe Prelude.Double,
    -- | An array of objects that describe the projected utilization metrics of
    -- the instance recommendation option.
    --
    -- The @Cpu@ and @Memory@ metrics are the only projected utilization
    -- metrics returned. Additionally, the @Memory@ metric is returned 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 CloudWatch Agent>.
    InstanceRecommendationOption -> Maybe [UtilizationMetric]
projectedUtilizationMetrics :: Prelude.Maybe [UtilizationMetric],
    -- | The instance type of the instance recommendation.
    InstanceRecommendationOption -> Maybe Text
instanceType :: Prelude.Maybe Prelude.Text,
    -- | The rank of the instance recommendation option.
    --
    -- The top recommendation option is ranked as @1@.
    InstanceRecommendationOption -> Maybe Int
rank :: Prelude.Maybe Prelude.Int
  }
  deriving (InstanceRecommendationOption
-> InstanceRecommendationOption -> Bool
(InstanceRecommendationOption
 -> InstanceRecommendationOption -> Bool)
-> (InstanceRecommendationOption
    -> InstanceRecommendationOption -> Bool)
-> Eq InstanceRecommendationOption
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstanceRecommendationOption
-> InstanceRecommendationOption -> Bool
$c/= :: InstanceRecommendationOption
-> InstanceRecommendationOption -> Bool
== :: InstanceRecommendationOption
-> InstanceRecommendationOption -> Bool
$c== :: InstanceRecommendationOption
-> InstanceRecommendationOption -> Bool
Prelude.Eq, ReadPrec [InstanceRecommendationOption]
ReadPrec InstanceRecommendationOption
Int -> ReadS InstanceRecommendationOption
ReadS [InstanceRecommendationOption]
(Int -> ReadS InstanceRecommendationOption)
-> ReadS [InstanceRecommendationOption]
-> ReadPrec InstanceRecommendationOption
-> ReadPrec [InstanceRecommendationOption]
-> Read InstanceRecommendationOption
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstanceRecommendationOption]
$creadListPrec :: ReadPrec [InstanceRecommendationOption]
readPrec :: ReadPrec InstanceRecommendationOption
$creadPrec :: ReadPrec InstanceRecommendationOption
readList :: ReadS [InstanceRecommendationOption]
$creadList :: ReadS [InstanceRecommendationOption]
readsPrec :: Int -> ReadS InstanceRecommendationOption
$creadsPrec :: Int -> ReadS InstanceRecommendationOption
Prelude.Read, Int -> InstanceRecommendationOption -> ShowS
[InstanceRecommendationOption] -> ShowS
InstanceRecommendationOption -> String
(Int -> InstanceRecommendationOption -> ShowS)
-> (InstanceRecommendationOption -> String)
-> ([InstanceRecommendationOption] -> ShowS)
-> Show InstanceRecommendationOption
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstanceRecommendationOption] -> ShowS
$cshowList :: [InstanceRecommendationOption] -> ShowS
show :: InstanceRecommendationOption -> String
$cshow :: InstanceRecommendationOption -> String
showsPrec :: Int -> InstanceRecommendationOption -> ShowS
$cshowsPrec :: Int -> InstanceRecommendationOption -> ShowS
Prelude.Show, (forall x.
 InstanceRecommendationOption -> Rep InstanceRecommendationOption x)
-> (forall x.
    Rep InstanceRecommendationOption x -> InstanceRecommendationOption)
-> Generic InstanceRecommendationOption
forall x.
Rep InstanceRecommendationOption x -> InstanceRecommendationOption
forall x.
InstanceRecommendationOption -> Rep InstanceRecommendationOption x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep InstanceRecommendationOption x -> InstanceRecommendationOption
$cfrom :: forall x.
InstanceRecommendationOption -> Rep InstanceRecommendationOption x
Prelude.Generic)

-- |
-- Create a value of 'InstanceRecommendationOption' 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:
--
-- 'platformDifferences', 'instanceRecommendationOption_platformDifferences' - Describes the configuration differences between the current instance and
-- the recommended instance type. You should consider the configuration
-- differences before migrating your workloads from the current instance to
-- the recommended instance type. The
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-resize.html Change the instance type guide for Linux>
-- and
-- <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2-instance-resize.html Change the instance type guide for Windows>
-- provide general guidance for getting started with an instance migration.
--
-- Platform differences include:
--
-- -   __@Hypervisor@__ — The hypervisor of the recommended instance type
--     is different than that of the current instance. For example, the
--     recommended instance type uses a Nitro hypervisor and the current
--     instance uses a Xen hypervisor. The differences that you should
--     consider between these hypervisors are covered in the
--     <http://aws.amazon.com/ec2/faqs/#Nitro_Hypervisor Nitro Hypervisor>
--     section of the Amazon EC2 frequently asked questions. For more
--     information, see
--     <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances Instances built on the Nitro System>
--     in the /Amazon EC2 User Guide for Linux/, or
--     <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/instance-types.html#ec2-nitro-instances Instances built on the Nitro System>
--     in the /Amazon EC2 User Guide for Windows/.
--
-- -   __@NetworkInterface@__ — The network interface of the recommended
--     instance type is different than that of the current instance. For
--     example, the recommended instance type supports enhanced networking
--     and the current instance might not. To enable enhanced networking
--     for the recommended instance type, you must install the Elastic
--     Network Adapter (ENA) driver or the Intel 82599 Virtual Function
--     driver. For more information, see
--     <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#instance-networking-storage Networking and storage features>
--     and
--     <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/enhanced-networking.html Enhanced networking on Linux>
--     in the /Amazon EC2 User Guide for Linux/, or
--     <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/instance-types.html#instance-networking-storage Networking and storage features>
--     and
--     <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/enhanced-networking.html Enhanced networking on Windows>
--     in the /Amazon EC2 User Guide for Windows/.
--
-- -   __@StorageInterface@__ — The storage interface of the recommended
--     instance type is different than that of the current instance. For
--     example, the recommended instance type uses an NVMe storage
--     interface and the current instance does not. To access NVMe volumes
--     for the recommended instance type, you will need to install or
--     upgrade the NVMe driver. For more information, see
--     <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#instance-networking-storage Networking and storage features>
--     and
--     <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nvme-ebs-volumes.html Amazon EBS and NVMe on Linux instances>
--     in the /Amazon EC2 User Guide for Linux/, or
--     <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/instance-types.html#instance-networking-storage Networking and storage features>
--     and
--     <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/nvme-ebs-volumes.html Amazon EBS and NVMe on Windows instances>
--     in the /Amazon EC2 User Guide for Windows/.
--
-- -   __@InstanceStoreAvailability@__ — The recommended instance type does
--     not support instance store volumes and the current instance does.
--     Before migrating, you might need to back up the data on your
--     instance store volumes if you want to preserve them. For more
--     information, see
--     <https://aws.amazon.com/premiumsupport/knowledge-center/back-up-instance-store-ebs/ How do I back up an instance store volume on my Amazon EC2 instance to Amazon EBS?>
--     in the /Amazon Web Services Premium Support Knowledge Base/. For
--     more information, see
--     <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#instance-networking-storage Networking and storage features>
--     and
--     <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html Amazon EC2 instance store>
--     in the /Amazon EC2 User Guide for Linux/, or see
--     <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/instance-types.html#instance-networking-storage Networking and storage features>
--     and
--     <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/InstanceStorage.html Amazon EC2 instance store>
--     in the /Amazon EC2 User Guide for Windows/.
--
-- -   __@VirtualizationType@__ — The recommended instance type uses the
--     hardware virtual machine (HVM) virtualization type and the current
--     instance uses the paravirtual (PV) virtualization type. For more
--     information about the differences between these virtualization
--     types, see
--     <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/virtualization_types.html Linux AMI virtualization types>
--     in the /Amazon EC2 User Guide for Linux/, or
--     <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/windows-ami-version-history.html#virtualization-types Windows AMI virtualization types>
--     in the /Amazon EC2 User Guide for Windows/.
--
-- -   __@Architecture@__ — The CPU architecture between the recommended
--     instance type and the current instance is different. For example,
--     the recommended instance type might use an Arm CPU architecture and
--     the current instance type might use a different one, such as x86.
--     Before migrating, you should consider recompiling the software on
--     your instance for the new architecture. Alternatively, you might
--     switch to an Amazon Machine Image (AMI) that supports the new
--     architecture. For more information about the CPU architecture for
--     each instance type, see
--     <http://aws.amazon.com/ec2/instance-types/ Amazon EC2 Instance Types>.
--
-- 'performanceRisk', 'instanceRecommendationOption_performanceRisk' - The performance risk of the instance recommendation option.
--
-- Performance risk indicates the likelihood of the recommended instance
-- type not meeting the resource needs of your workload. Compute Optimizer
-- calculates an individual performance risk score for each specification
-- of the recommended instance, including CPU, memory, EBS throughput, EBS
-- IOPS, disk throughput, disk IOPS, network throughput, and network PPS.
-- The performance risk of the recommended instance is calculated as the
-- maximum performance risk score across the analyzed resource
-- specifications.
--
-- The value ranges from @0@ - @4@, with @0@ meaning that the recommended
-- resource is predicted to always provide enough hardware capability. The
-- higher the performance risk is, the more likely you should validate
-- whether the recommendation will meet the performance requirements of
-- your workload before migrating your resource.
--
-- 'projectedUtilizationMetrics', 'instanceRecommendationOption_projectedUtilizationMetrics' - An array of objects that describe the projected utilization metrics of
-- the instance recommendation option.
--
-- The @Cpu@ and @Memory@ metrics are the only projected utilization
-- metrics returned. Additionally, the @Memory@ metric is returned 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 CloudWatch Agent>.
--
-- 'instanceType', 'instanceRecommendationOption_instanceType' - The instance type of the instance recommendation.
--
-- 'rank', 'instanceRecommendationOption_rank' - The rank of the instance recommendation option.
--
-- The top recommendation option is ranked as @1@.
newInstanceRecommendationOption ::
  InstanceRecommendationOption
newInstanceRecommendationOption :: InstanceRecommendationOption
newInstanceRecommendationOption =
  InstanceRecommendationOption' :: Maybe [PlatformDifference]
-> Maybe Double
-> Maybe [UtilizationMetric]
-> Maybe Text
-> Maybe Int
-> InstanceRecommendationOption
InstanceRecommendationOption'
    { $sel:platformDifferences:InstanceRecommendationOption' :: Maybe [PlatformDifference]
platformDifferences =
        Maybe [PlatformDifference]
forall a. Maybe a
Prelude.Nothing,
      $sel:performanceRisk:InstanceRecommendationOption' :: Maybe Double
performanceRisk = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:projectedUtilizationMetrics:InstanceRecommendationOption' :: Maybe [UtilizationMetric]
projectedUtilizationMetrics = Maybe [UtilizationMetric]
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceType:InstanceRecommendationOption' :: Maybe Text
instanceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:rank:InstanceRecommendationOption' :: Maybe Int
rank = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | Describes the configuration differences between the current instance and
-- the recommended instance type. You should consider the configuration
-- differences before migrating your workloads from the current instance to
-- the recommended instance type. The
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-resize.html Change the instance type guide for Linux>
-- and
-- <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2-instance-resize.html Change the instance type guide for Windows>
-- provide general guidance for getting started with an instance migration.
--
-- Platform differences include:
--
-- -   __@Hypervisor@__ — The hypervisor of the recommended instance type
--     is different than that of the current instance. For example, the
--     recommended instance type uses a Nitro hypervisor and the current
--     instance uses a Xen hypervisor. The differences that you should
--     consider between these hypervisors are covered in the
--     <http://aws.amazon.com/ec2/faqs/#Nitro_Hypervisor Nitro Hypervisor>
--     section of the Amazon EC2 frequently asked questions. For more
--     information, see
--     <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances Instances built on the Nitro System>
--     in the /Amazon EC2 User Guide for Linux/, or
--     <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/instance-types.html#ec2-nitro-instances Instances built on the Nitro System>
--     in the /Amazon EC2 User Guide for Windows/.
--
-- -   __@NetworkInterface@__ — The network interface of the recommended
--     instance type is different than that of the current instance. For
--     example, the recommended instance type supports enhanced networking
--     and the current instance might not. To enable enhanced networking
--     for the recommended instance type, you must install the Elastic
--     Network Adapter (ENA) driver or the Intel 82599 Virtual Function
--     driver. For more information, see
--     <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#instance-networking-storage Networking and storage features>
--     and
--     <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/enhanced-networking.html Enhanced networking on Linux>
--     in the /Amazon EC2 User Guide for Linux/, or
--     <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/instance-types.html#instance-networking-storage Networking and storage features>
--     and
--     <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/enhanced-networking.html Enhanced networking on Windows>
--     in the /Amazon EC2 User Guide for Windows/.
--
-- -   __@StorageInterface@__ — The storage interface of the recommended
--     instance type is different than that of the current instance. For
--     example, the recommended instance type uses an NVMe storage
--     interface and the current instance does not. To access NVMe volumes
--     for the recommended instance type, you will need to install or
--     upgrade the NVMe driver. For more information, see
--     <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#instance-networking-storage Networking and storage features>
--     and
--     <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nvme-ebs-volumes.html Amazon EBS and NVMe on Linux instances>
--     in the /Amazon EC2 User Guide for Linux/, or
--     <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/instance-types.html#instance-networking-storage Networking and storage features>
--     and
--     <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/nvme-ebs-volumes.html Amazon EBS and NVMe on Windows instances>
--     in the /Amazon EC2 User Guide for Windows/.
--
-- -   __@InstanceStoreAvailability@__ — The recommended instance type does
--     not support instance store volumes and the current instance does.
--     Before migrating, you might need to back up the data on your
--     instance store volumes if you want to preserve them. For more
--     information, see
--     <https://aws.amazon.com/premiumsupport/knowledge-center/back-up-instance-store-ebs/ How do I back up an instance store volume on my Amazon EC2 instance to Amazon EBS?>
--     in the /Amazon Web Services Premium Support Knowledge Base/. For
--     more information, see
--     <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#instance-networking-storage Networking and storage features>
--     and
--     <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html Amazon EC2 instance store>
--     in the /Amazon EC2 User Guide for Linux/, or see
--     <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/instance-types.html#instance-networking-storage Networking and storage features>
--     and
--     <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/InstanceStorage.html Amazon EC2 instance store>
--     in the /Amazon EC2 User Guide for Windows/.
--
-- -   __@VirtualizationType@__ — The recommended instance type uses the
--     hardware virtual machine (HVM) virtualization type and the current
--     instance uses the paravirtual (PV) virtualization type. For more
--     information about the differences between these virtualization
--     types, see
--     <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/virtualization_types.html Linux AMI virtualization types>
--     in the /Amazon EC2 User Guide for Linux/, or
--     <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/windows-ami-version-history.html#virtualization-types Windows AMI virtualization types>
--     in the /Amazon EC2 User Guide for Windows/.
--
-- -   __@Architecture@__ — The CPU architecture between the recommended
--     instance type and the current instance is different. For example,
--     the recommended instance type might use an Arm CPU architecture and
--     the current instance type might use a different one, such as x86.
--     Before migrating, you should consider recompiling the software on
--     your instance for the new architecture. Alternatively, you might
--     switch to an Amazon Machine Image (AMI) that supports the new
--     architecture. For more information about the CPU architecture for
--     each instance type, see
--     <http://aws.amazon.com/ec2/instance-types/ Amazon EC2 Instance Types>.
instanceRecommendationOption_platformDifferences :: Lens.Lens' InstanceRecommendationOption (Prelude.Maybe [PlatformDifference])
instanceRecommendationOption_platformDifferences :: (Maybe [PlatformDifference] -> f (Maybe [PlatformDifference]))
-> InstanceRecommendationOption -> f InstanceRecommendationOption
instanceRecommendationOption_platformDifferences = (InstanceRecommendationOption -> Maybe [PlatformDifference])
-> (InstanceRecommendationOption
    -> Maybe [PlatformDifference] -> InstanceRecommendationOption)
-> Lens
     InstanceRecommendationOption
     InstanceRecommendationOption
     (Maybe [PlatformDifference])
     (Maybe [PlatformDifference])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRecommendationOption' {Maybe [PlatformDifference]
platformDifferences :: Maybe [PlatformDifference]
$sel:platformDifferences:InstanceRecommendationOption' :: InstanceRecommendationOption -> Maybe [PlatformDifference]
platformDifferences} -> Maybe [PlatformDifference]
platformDifferences) (\s :: InstanceRecommendationOption
s@InstanceRecommendationOption' {} Maybe [PlatformDifference]
a -> InstanceRecommendationOption
s {$sel:platformDifferences:InstanceRecommendationOption' :: Maybe [PlatformDifference]
platformDifferences = Maybe [PlatformDifference]
a} :: InstanceRecommendationOption) ((Maybe [PlatformDifference] -> f (Maybe [PlatformDifference]))
 -> InstanceRecommendationOption -> f InstanceRecommendationOption)
-> ((Maybe [PlatformDifference] -> f (Maybe [PlatformDifference]))
    -> Maybe [PlatformDifference] -> f (Maybe [PlatformDifference]))
-> (Maybe [PlatformDifference] -> f (Maybe [PlatformDifference]))
-> InstanceRecommendationOption
-> f InstanceRecommendationOption
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [PlatformDifference]
  [PlatformDifference]
  [PlatformDifference]
  [PlatformDifference]
-> Iso
     (Maybe [PlatformDifference])
     (Maybe [PlatformDifference])
     (Maybe [PlatformDifference])
     (Maybe [PlatformDifference])
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 AnIso
  [PlatformDifference]
  [PlatformDifference]
  [PlatformDifference]
  [PlatformDifference]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The performance risk of the instance recommendation option.
--
-- Performance risk indicates the likelihood of the recommended instance
-- type not meeting the resource needs of your workload. Compute Optimizer
-- calculates an individual performance risk score for each specification
-- of the recommended instance, including CPU, memory, EBS throughput, EBS
-- IOPS, disk throughput, disk IOPS, network throughput, and network PPS.
-- The performance risk of the recommended instance is calculated as the
-- maximum performance risk score across the analyzed resource
-- specifications.
--
-- The value ranges from @0@ - @4@, with @0@ meaning that the recommended
-- resource is predicted to always provide enough hardware capability. The
-- higher the performance risk is, the more likely you should validate
-- whether the recommendation will meet the performance requirements of
-- your workload before migrating your resource.
instanceRecommendationOption_performanceRisk :: Lens.Lens' InstanceRecommendationOption (Prelude.Maybe Prelude.Double)
instanceRecommendationOption_performanceRisk :: (Maybe Double -> f (Maybe Double))
-> InstanceRecommendationOption -> f InstanceRecommendationOption
instanceRecommendationOption_performanceRisk = (InstanceRecommendationOption -> Maybe Double)
-> (InstanceRecommendationOption
    -> Maybe Double -> InstanceRecommendationOption)
-> Lens
     InstanceRecommendationOption
     InstanceRecommendationOption
     (Maybe Double)
     (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRecommendationOption' {Maybe Double
performanceRisk :: Maybe Double
$sel:performanceRisk:InstanceRecommendationOption' :: InstanceRecommendationOption -> Maybe Double
performanceRisk} -> Maybe Double
performanceRisk) (\s :: InstanceRecommendationOption
s@InstanceRecommendationOption' {} Maybe Double
a -> InstanceRecommendationOption
s {$sel:performanceRisk:InstanceRecommendationOption' :: Maybe Double
performanceRisk = Maybe Double
a} :: InstanceRecommendationOption)

-- | An array of objects that describe the projected utilization metrics of
-- the instance recommendation option.
--
-- The @Cpu@ and @Memory@ metrics are the only projected utilization
-- metrics returned. Additionally, the @Memory@ metric is returned 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 CloudWatch Agent>.
instanceRecommendationOption_projectedUtilizationMetrics :: Lens.Lens' InstanceRecommendationOption (Prelude.Maybe [UtilizationMetric])
instanceRecommendationOption_projectedUtilizationMetrics :: (Maybe [UtilizationMetric] -> f (Maybe [UtilizationMetric]))
-> InstanceRecommendationOption -> f InstanceRecommendationOption
instanceRecommendationOption_projectedUtilizationMetrics = (InstanceRecommendationOption -> Maybe [UtilizationMetric])
-> (InstanceRecommendationOption
    -> Maybe [UtilizationMetric] -> InstanceRecommendationOption)
-> Lens
     InstanceRecommendationOption
     InstanceRecommendationOption
     (Maybe [UtilizationMetric])
     (Maybe [UtilizationMetric])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRecommendationOption' {Maybe [UtilizationMetric]
projectedUtilizationMetrics :: Maybe [UtilizationMetric]
$sel:projectedUtilizationMetrics:InstanceRecommendationOption' :: InstanceRecommendationOption -> Maybe [UtilizationMetric]
projectedUtilizationMetrics} -> Maybe [UtilizationMetric]
projectedUtilizationMetrics) (\s :: InstanceRecommendationOption
s@InstanceRecommendationOption' {} Maybe [UtilizationMetric]
a -> InstanceRecommendationOption
s {$sel:projectedUtilizationMetrics:InstanceRecommendationOption' :: Maybe [UtilizationMetric]
projectedUtilizationMetrics = Maybe [UtilizationMetric]
a} :: InstanceRecommendationOption) ((Maybe [UtilizationMetric] -> f (Maybe [UtilizationMetric]))
 -> InstanceRecommendationOption -> f InstanceRecommendationOption)
-> ((Maybe [UtilizationMetric] -> f (Maybe [UtilizationMetric]))
    -> Maybe [UtilizationMetric] -> f (Maybe [UtilizationMetric]))
-> (Maybe [UtilizationMetric] -> f (Maybe [UtilizationMetric]))
-> InstanceRecommendationOption
-> f InstanceRecommendationOption
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [UtilizationMetric]
  [UtilizationMetric]
  [UtilizationMetric]
  [UtilizationMetric]
-> Iso
     (Maybe [UtilizationMetric])
     (Maybe [UtilizationMetric])
     (Maybe [UtilizationMetric])
     (Maybe [UtilizationMetric])
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 AnIso
  [UtilizationMetric]
  [UtilizationMetric]
  [UtilizationMetric]
  [UtilizationMetric]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The instance type of the instance recommendation.
instanceRecommendationOption_instanceType :: Lens.Lens' InstanceRecommendationOption (Prelude.Maybe Prelude.Text)
instanceRecommendationOption_instanceType :: (Maybe Text -> f (Maybe Text))
-> InstanceRecommendationOption -> f InstanceRecommendationOption
instanceRecommendationOption_instanceType = (InstanceRecommendationOption -> Maybe Text)
-> (InstanceRecommendationOption
    -> Maybe Text -> InstanceRecommendationOption)
-> Lens
     InstanceRecommendationOption
     InstanceRecommendationOption
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRecommendationOption' {Maybe Text
instanceType :: Maybe Text
$sel:instanceType:InstanceRecommendationOption' :: InstanceRecommendationOption -> Maybe Text
instanceType} -> Maybe Text
instanceType) (\s :: InstanceRecommendationOption
s@InstanceRecommendationOption' {} Maybe Text
a -> InstanceRecommendationOption
s {$sel:instanceType:InstanceRecommendationOption' :: Maybe Text
instanceType = Maybe Text
a} :: InstanceRecommendationOption)

-- | The rank of the instance recommendation option.
--
-- The top recommendation option is ranked as @1@.
instanceRecommendationOption_rank :: Lens.Lens' InstanceRecommendationOption (Prelude.Maybe Prelude.Int)
instanceRecommendationOption_rank :: (Maybe Int -> f (Maybe Int))
-> InstanceRecommendationOption -> f InstanceRecommendationOption
instanceRecommendationOption_rank = (InstanceRecommendationOption -> Maybe Int)
-> (InstanceRecommendationOption
    -> Maybe Int -> InstanceRecommendationOption)
-> Lens
     InstanceRecommendationOption
     InstanceRecommendationOption
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceRecommendationOption' {Maybe Int
rank :: Maybe Int
$sel:rank:InstanceRecommendationOption' :: InstanceRecommendationOption -> Maybe Int
rank} -> Maybe Int
rank) (\s :: InstanceRecommendationOption
s@InstanceRecommendationOption' {} Maybe Int
a -> InstanceRecommendationOption
s {$sel:rank:InstanceRecommendationOption' :: Maybe Int
rank = Maybe Int
a} :: InstanceRecommendationOption)

instance Core.FromJSON InstanceRecommendationOption where
  parseJSON :: Value -> Parser InstanceRecommendationOption
parseJSON =
    String
-> (Object -> Parser InstanceRecommendationOption)
-> Value
-> Parser InstanceRecommendationOption
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"InstanceRecommendationOption"
      ( \Object
x ->
          Maybe [PlatformDifference]
-> Maybe Double
-> Maybe [UtilizationMetric]
-> Maybe Text
-> Maybe Int
-> InstanceRecommendationOption
InstanceRecommendationOption'
            (Maybe [PlatformDifference]
 -> Maybe Double
 -> Maybe [UtilizationMetric]
 -> Maybe Text
 -> Maybe Int
 -> InstanceRecommendationOption)
-> Parser (Maybe [PlatformDifference])
-> Parser
     (Maybe Double
      -> Maybe [UtilizationMetric]
      -> Maybe Text
      -> Maybe Int
      -> InstanceRecommendationOption)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Parser (Maybe (Maybe [PlatformDifference]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"platformDifferences"
                            Parser (Maybe (Maybe [PlatformDifference]))
-> Maybe [PlatformDifference]
-> Parser (Maybe [PlatformDifference])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [PlatformDifference]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe Double
   -> Maybe [UtilizationMetric]
   -> Maybe Text
   -> Maybe Int
   -> InstanceRecommendationOption)
-> Parser (Maybe Double)
-> Parser
     (Maybe [UtilizationMetric]
      -> Maybe Text -> Maybe Int -> InstanceRecommendationOption)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"performanceRisk")
            Parser
  (Maybe [UtilizationMetric]
   -> Maybe Text -> Maybe Int -> InstanceRecommendationOption)
-> Parser (Maybe [UtilizationMetric])
-> Parser (Maybe Text -> Maybe Int -> InstanceRecommendationOption)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [UtilizationMetric]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"projectedUtilizationMetrics"
                            Parser (Maybe (Maybe [UtilizationMetric]))
-> Maybe [UtilizationMetric] -> Parser (Maybe [UtilizationMetric])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [UtilizationMetric]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser (Maybe Text -> Maybe Int -> InstanceRecommendationOption)
-> Parser (Maybe Text)
-> Parser (Maybe Int -> InstanceRecommendationOption)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"instanceType")
            Parser (Maybe Int -> InstanceRecommendationOption)
-> Parser (Maybe Int) -> Parser InstanceRecommendationOption
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"rank")
      )

instance
  Prelude.Hashable
    InstanceRecommendationOption

instance Prelude.NFData InstanceRecommendationOption