{-# 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.EKS.Types.OutpostConfigRequest
-- 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.EKS.Types.OutpostConfigRequest where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EKS.Types.ControlPlanePlacementRequest
import qualified Amazonka.Prelude as Prelude

-- | The configuration of your local Amazon EKS cluster on an Amazon Web
-- Services Outpost. Before creating a cluster on an Outpost, review
-- <https://docs.aws.amazon.com/eks/latest/userguide/eks-outposts-local-cluster-create.html Creating a local cluster on an Outpost>
-- in the /Amazon EKS User Guide/. This API isn\'t available for Amazon EKS
-- clusters on the Amazon Web Services cloud.
--
-- /See:/ 'newOutpostConfigRequest' smart constructor.
data OutpostConfigRequest = OutpostConfigRequest'
  { -- | An object representing the placement configuration for all the control
    -- plane instances of your local Amazon EKS cluster on an Amazon Web
    -- Services Outpost. For more information, see
    -- <https://docs.aws.amazon.com/eks/latest/userguide/eks-outposts-capacity-considerations.html Capacity considerations>
    -- in the /Amazon EKS User Guide/.
    OutpostConfigRequest -> Maybe ControlPlanePlacementRequest
controlPlanePlacement :: Prelude.Maybe ControlPlanePlacementRequest,
    -- | The ARN of the Outpost that you want to use for your local Amazon EKS
    -- cluster on Outposts. Only a single Outpost ARN is supported.
    OutpostConfigRequest -> [Text]
outpostArns :: [Prelude.Text],
    -- | The Amazon EC2 instance type that you want to use for your local Amazon
    -- EKS cluster on Outposts. Choose an instance type based on the number of
    -- nodes that your cluster will have. For more information, see
    -- <https://docs.aws.amazon.com/eks/latest/userguide/eks-outposts-capacity-considerations.html Capacity considerations>
    -- in the /Amazon EKS User Guide/.
    --
    -- The instance type that you specify is used for all Kubernetes control
    -- plane instances. The instance type can\'t be changed after cluster
    -- creation. The control plane is not automatically scaled by Amazon EKS.
    OutpostConfigRequest -> Text
controlPlaneInstanceType :: Prelude.Text
  }
  deriving (OutpostConfigRequest -> OutpostConfigRequest -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OutpostConfigRequest -> OutpostConfigRequest -> Bool
$c/= :: OutpostConfigRequest -> OutpostConfigRequest -> Bool
== :: OutpostConfigRequest -> OutpostConfigRequest -> Bool
$c== :: OutpostConfigRequest -> OutpostConfigRequest -> Bool
Prelude.Eq, ReadPrec [OutpostConfigRequest]
ReadPrec OutpostConfigRequest
Int -> ReadS OutpostConfigRequest
ReadS [OutpostConfigRequest]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OutpostConfigRequest]
$creadListPrec :: ReadPrec [OutpostConfigRequest]
readPrec :: ReadPrec OutpostConfigRequest
$creadPrec :: ReadPrec OutpostConfigRequest
readList :: ReadS [OutpostConfigRequest]
$creadList :: ReadS [OutpostConfigRequest]
readsPrec :: Int -> ReadS OutpostConfigRequest
$creadsPrec :: Int -> ReadS OutpostConfigRequest
Prelude.Read, Int -> OutpostConfigRequest -> ShowS
[OutpostConfigRequest] -> ShowS
OutpostConfigRequest -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OutpostConfigRequest] -> ShowS
$cshowList :: [OutpostConfigRequest] -> ShowS
show :: OutpostConfigRequest -> String
$cshow :: OutpostConfigRequest -> String
showsPrec :: Int -> OutpostConfigRequest -> ShowS
$cshowsPrec :: Int -> OutpostConfigRequest -> ShowS
Prelude.Show, forall x. Rep OutpostConfigRequest x -> OutpostConfigRequest
forall x. OutpostConfigRequest -> Rep OutpostConfigRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OutpostConfigRequest x -> OutpostConfigRequest
$cfrom :: forall x. OutpostConfigRequest -> Rep OutpostConfigRequest x
Prelude.Generic)

-- |
-- Create a value of 'OutpostConfigRequest' 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:
--
-- 'controlPlanePlacement', 'outpostConfigRequest_controlPlanePlacement' - An object representing the placement configuration for all the control
-- plane instances of your local Amazon EKS cluster on an Amazon Web
-- Services Outpost. For more information, see
-- <https://docs.aws.amazon.com/eks/latest/userguide/eks-outposts-capacity-considerations.html Capacity considerations>
-- in the /Amazon EKS User Guide/.
--
-- 'outpostArns', 'outpostConfigRequest_outpostArns' - The ARN of the Outpost that you want to use for your local Amazon EKS
-- cluster on Outposts. Only a single Outpost ARN is supported.
--
-- 'controlPlaneInstanceType', 'outpostConfigRequest_controlPlaneInstanceType' - The Amazon EC2 instance type that you want to use for your local Amazon
-- EKS cluster on Outposts. Choose an instance type based on the number of
-- nodes that your cluster will have. For more information, see
-- <https://docs.aws.amazon.com/eks/latest/userguide/eks-outposts-capacity-considerations.html Capacity considerations>
-- in the /Amazon EKS User Guide/.
--
-- The instance type that you specify is used for all Kubernetes control
-- plane instances. The instance type can\'t be changed after cluster
-- creation. The control plane is not automatically scaled by Amazon EKS.
newOutpostConfigRequest ::
  -- | 'controlPlaneInstanceType'
  Prelude.Text ->
  OutpostConfigRequest
newOutpostConfigRequest :: Text -> OutpostConfigRequest
newOutpostConfigRequest Text
pControlPlaneInstanceType_ =
  OutpostConfigRequest'
    { $sel:controlPlanePlacement:OutpostConfigRequest' :: Maybe ControlPlanePlacementRequest
controlPlanePlacement =
        forall a. Maybe a
Prelude.Nothing,
      $sel:outpostArns:OutpostConfigRequest' :: [Text]
outpostArns = forall a. Monoid a => a
Prelude.mempty,
      $sel:controlPlaneInstanceType:OutpostConfigRequest' :: Text
controlPlaneInstanceType =
        Text
pControlPlaneInstanceType_
    }

-- | An object representing the placement configuration for all the control
-- plane instances of your local Amazon EKS cluster on an Amazon Web
-- Services Outpost. For more information, see
-- <https://docs.aws.amazon.com/eks/latest/userguide/eks-outposts-capacity-considerations.html Capacity considerations>
-- in the /Amazon EKS User Guide/.
outpostConfigRequest_controlPlanePlacement :: Lens.Lens' OutpostConfigRequest (Prelude.Maybe ControlPlanePlacementRequest)
outpostConfigRequest_controlPlanePlacement :: Lens' OutpostConfigRequest (Maybe ControlPlanePlacementRequest)
outpostConfigRequest_controlPlanePlacement = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OutpostConfigRequest' {Maybe ControlPlanePlacementRequest
controlPlanePlacement :: Maybe ControlPlanePlacementRequest
$sel:controlPlanePlacement:OutpostConfigRequest' :: OutpostConfigRequest -> Maybe ControlPlanePlacementRequest
controlPlanePlacement} -> Maybe ControlPlanePlacementRequest
controlPlanePlacement) (\s :: OutpostConfigRequest
s@OutpostConfigRequest' {} Maybe ControlPlanePlacementRequest
a -> OutpostConfigRequest
s {$sel:controlPlanePlacement:OutpostConfigRequest' :: Maybe ControlPlanePlacementRequest
controlPlanePlacement = Maybe ControlPlanePlacementRequest
a} :: OutpostConfigRequest)

-- | The ARN of the Outpost that you want to use for your local Amazon EKS
-- cluster on Outposts. Only a single Outpost ARN is supported.
outpostConfigRequest_outpostArns :: Lens.Lens' OutpostConfigRequest [Prelude.Text]
outpostConfigRequest_outpostArns :: Lens' OutpostConfigRequest [Text]
outpostConfigRequest_outpostArns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OutpostConfigRequest' {[Text]
outpostArns :: [Text]
$sel:outpostArns:OutpostConfigRequest' :: OutpostConfigRequest -> [Text]
outpostArns} -> [Text]
outpostArns) (\s :: OutpostConfigRequest
s@OutpostConfigRequest' {} [Text]
a -> OutpostConfigRequest
s {$sel:outpostArns:OutpostConfigRequest' :: [Text]
outpostArns = [Text]
a} :: OutpostConfigRequest) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon EC2 instance type that you want to use for your local Amazon
-- EKS cluster on Outposts. Choose an instance type based on the number of
-- nodes that your cluster will have. For more information, see
-- <https://docs.aws.amazon.com/eks/latest/userguide/eks-outposts-capacity-considerations.html Capacity considerations>
-- in the /Amazon EKS User Guide/.
--
-- The instance type that you specify is used for all Kubernetes control
-- plane instances. The instance type can\'t be changed after cluster
-- creation. The control plane is not automatically scaled by Amazon EKS.
outpostConfigRequest_controlPlaneInstanceType :: Lens.Lens' OutpostConfigRequest Prelude.Text
outpostConfigRequest_controlPlaneInstanceType :: Lens' OutpostConfigRequest Text
outpostConfigRequest_controlPlaneInstanceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OutpostConfigRequest' {Text
controlPlaneInstanceType :: Text
$sel:controlPlaneInstanceType:OutpostConfigRequest' :: OutpostConfigRequest -> Text
controlPlaneInstanceType} -> Text
controlPlaneInstanceType) (\s :: OutpostConfigRequest
s@OutpostConfigRequest' {} Text
a -> OutpostConfigRequest
s {$sel:controlPlaneInstanceType:OutpostConfigRequest' :: Text
controlPlaneInstanceType = Text
a} :: OutpostConfigRequest)

instance Prelude.Hashable OutpostConfigRequest where
  hashWithSalt :: Int -> OutpostConfigRequest -> Int
hashWithSalt Int
_salt OutpostConfigRequest' {[Text]
Maybe ControlPlanePlacementRequest
Text
controlPlaneInstanceType :: Text
outpostArns :: [Text]
controlPlanePlacement :: Maybe ControlPlanePlacementRequest
$sel:controlPlaneInstanceType:OutpostConfigRequest' :: OutpostConfigRequest -> Text
$sel:outpostArns:OutpostConfigRequest' :: OutpostConfigRequest -> [Text]
$sel:controlPlanePlacement:OutpostConfigRequest' :: OutpostConfigRequest -> Maybe ControlPlanePlacementRequest
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ControlPlanePlacementRequest
controlPlanePlacement
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
outpostArns
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
controlPlaneInstanceType

instance Prelude.NFData OutpostConfigRequest where
  rnf :: OutpostConfigRequest -> ()
rnf OutpostConfigRequest' {[Text]
Maybe ControlPlanePlacementRequest
Text
controlPlaneInstanceType :: Text
outpostArns :: [Text]
controlPlanePlacement :: Maybe ControlPlanePlacementRequest
$sel:controlPlaneInstanceType:OutpostConfigRequest' :: OutpostConfigRequest -> Text
$sel:outpostArns:OutpostConfigRequest' :: OutpostConfigRequest -> [Text]
$sel:controlPlanePlacement:OutpostConfigRequest' :: OutpostConfigRequest -> Maybe ControlPlanePlacementRequest
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ControlPlanePlacementRequest
controlPlanePlacement
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Text]
outpostArns
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
controlPlaneInstanceType

instance Data.ToJSON OutpostConfigRequest where
  toJSON :: OutpostConfigRequest -> Value
toJSON OutpostConfigRequest' {[Text]
Maybe ControlPlanePlacementRequest
Text
controlPlaneInstanceType :: Text
outpostArns :: [Text]
controlPlanePlacement :: Maybe ControlPlanePlacementRequest
$sel:controlPlaneInstanceType:OutpostConfigRequest' :: OutpostConfigRequest -> Text
$sel:outpostArns:OutpostConfigRequest' :: OutpostConfigRequest -> [Text]
$sel:controlPlanePlacement:OutpostConfigRequest' :: OutpostConfigRequest -> Maybe ControlPlanePlacementRequest
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"controlPlanePlacement" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ControlPlanePlacementRequest
controlPlanePlacement,
            forall a. a -> Maybe a
Prelude.Just (Key
"outpostArns" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [Text]
outpostArns),
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"controlPlaneInstanceType"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
controlPlaneInstanceType
              )
          ]
      )