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

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

-- |
-- Module      : Amazonka.SageMaker.CreateNotebookInstance
-- 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)
--
-- Creates an Amazon SageMaker notebook instance. A notebook instance is a
-- machine learning (ML) compute instance running on a Jupyter notebook.
--
-- In a @CreateNotebookInstance@ request, specify the type of ML compute
-- instance that you want to run. Amazon SageMaker launches the instance,
-- installs common libraries that you can use to explore datasets for model
-- training, and attaches an ML storage volume to the notebook instance.
--
-- Amazon SageMaker also provides a set of example notebooks. Each notebook
-- demonstrates how to use Amazon SageMaker with a specific algorithm or
-- with a machine learning framework.
--
-- After receiving the request, Amazon SageMaker does the following:
--
-- 1.  Creates a network interface in the Amazon SageMaker VPC.
--
-- 2.  (Option) If you specified @SubnetId@, Amazon SageMaker creates a
--     network interface in your own VPC, which is inferred from the subnet
--     ID that you provide in the input. When creating this network
--     interface, Amazon SageMaker attaches the security group that you
--     specified in the request to the network interface that it creates in
--     your VPC.
--
-- 3.  Launches an EC2 instance of the type specified in the request in the
--     Amazon SageMaker VPC. If you specified @SubnetId@ of your VPC,
--     Amazon SageMaker specifies both network interfaces when launching
--     this instance. This enables inbound traffic from your own VPC to the
--     notebook instance, assuming that the security groups allow it.
--
-- After creating the notebook instance, Amazon SageMaker returns its
-- Amazon Resource Name (ARN). You can\'t change the name of a notebook
-- instance after you create it.
--
-- After Amazon SageMaker creates the notebook instance, you can connect to
-- the Jupyter server and work in Jupyter notebooks. For example, you can
-- write code to explore a dataset that you can use for model training,
-- train a model, host models by creating Amazon SageMaker endpoints, and
-- validate hosted models.
--
-- For more information, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/how-it-works.html How It Works>.
module Amazonka.SageMaker.CreateNotebookInstance
  ( -- * Creating a Request
    CreateNotebookInstance (..),
    newCreateNotebookInstance,

    -- * Request Lenses
    createNotebookInstance_acceleratorTypes,
    createNotebookInstance_platformIdentifier,
    createNotebookInstance_securityGroupIds,
    createNotebookInstance_additionalCodeRepositories,
    createNotebookInstance_lifecycleConfigName,
    createNotebookInstance_subnetId,
    createNotebookInstance_defaultCodeRepository,
    createNotebookInstance_volumeSizeInGB,
    createNotebookInstance_kmsKeyId,
    createNotebookInstance_rootAccess,
    createNotebookInstance_directInternetAccess,
    createNotebookInstance_tags,
    createNotebookInstance_notebookInstanceName,
    createNotebookInstance_instanceType,
    createNotebookInstance_roleArn,

    -- * Destructuring the Response
    CreateNotebookInstanceResponse (..),
    newCreateNotebookInstanceResponse,

    -- * Response Lenses
    createNotebookInstanceResponse_notebookInstanceArn,
    createNotebookInstanceResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SageMaker.Types

-- | /See:/ 'newCreateNotebookInstance' smart constructor.
data CreateNotebookInstance = CreateNotebookInstance'
  { -- | A list of Elastic Inference (EI) instance types to associate with this
    -- notebook instance. Currently, only one instance type can be associated
    -- with a notebook instance. For more information, see
    -- <https://docs.aws.amazon.com/sagemaker/latest/dg/ei.html Using Elastic Inference in Amazon SageMaker>.
    CreateNotebookInstance -> Maybe [NotebookInstanceAcceleratorType]
acceleratorTypes :: Prelude.Maybe [NotebookInstanceAcceleratorType],
    -- | The platform identifier of the notebook instance runtime environment.
    CreateNotebookInstance -> Maybe Text
platformIdentifier :: Prelude.Maybe Prelude.Text,
    -- | The VPC security group IDs, in the form sg-xxxxxxxx. The security groups
    -- must be for the same VPC as specified in the subnet.
    CreateNotebookInstance -> Maybe [Text]
securityGroupIds :: Prelude.Maybe [Prelude.Text],
    -- | An array of up to three Git repositories to associate with the notebook
    -- instance. These can be either the names of Git repositories stored as
    -- resources in your account, or the URL of Git repositories in
    -- <https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html Amazon Web Services CodeCommit>
    -- or in any other Git repository. These repositories are cloned at the
    -- same level as the default repository of your notebook instance. For more
    -- information, see
    -- <https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-git-repo.html Associating Git Repositories with Amazon SageMaker Notebook Instances>.
    CreateNotebookInstance -> Maybe [Text]
additionalCodeRepositories :: Prelude.Maybe [Prelude.Text],
    -- | The name of a lifecycle configuration to associate with the notebook
    -- instance. For information about lifestyle configurations, see
    -- <https://docs.aws.amazon.com/sagemaker/latest/dg/notebook-lifecycle-config.html Step 2.1: (Optional) Customize a Notebook Instance>.
    CreateNotebookInstance -> Maybe Text
lifecycleConfigName :: Prelude.Maybe Prelude.Text,
    -- | The ID of the subnet in a VPC to which you would like to have a
    -- connectivity from your ML compute instance.
    CreateNotebookInstance -> Maybe Text
subnetId :: Prelude.Maybe Prelude.Text,
    -- | A Git repository to associate with the notebook instance as its default
    -- code repository. This can be either the name of a Git repository stored
    -- as a resource in your account, or the URL of a Git repository in
    -- <https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html Amazon Web Services CodeCommit>
    -- or in any other Git repository. When you open a notebook instance, it
    -- opens in the directory that contains this repository. For more
    -- information, see
    -- <https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-git-repo.html Associating Git Repositories with Amazon SageMaker Notebook Instances>.
    CreateNotebookInstance -> Maybe Text
defaultCodeRepository :: Prelude.Maybe Prelude.Text,
    -- | The size, in GB, of the ML storage volume to attach to the notebook
    -- instance. The default value is 5 GB.
    CreateNotebookInstance -> Maybe Natural
volumeSizeInGB :: Prelude.Maybe Prelude.Natural,
    -- | The Amazon Resource Name (ARN) of a Amazon Web Services Key Management
    -- Service key that Amazon SageMaker uses to encrypt data on the storage
    -- volume attached to your notebook instance. The KMS key you provide must
    -- be enabled. For information, see
    -- <https://docs.aws.amazon.com/kms/latest/developerguide/enabling-keys.html Enabling and Disabling Keys>
    -- in the /Amazon Web Services Key Management Service Developer Guide/.
    CreateNotebookInstance -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
    -- | Whether root access is enabled or disabled for users of the notebook
    -- instance. The default value is @Enabled@.
    --
    -- Lifecycle configurations need root access to be able to set up a
    -- notebook instance. Because of this, lifecycle configurations associated
    -- with a notebook instance always run with root access even if you disable
    -- root access for users.
    CreateNotebookInstance -> Maybe RootAccess
rootAccess :: Prelude.Maybe RootAccess,
    -- | Sets whether Amazon SageMaker provides internet access to the notebook
    -- instance. If you set this to @Disabled@ this notebook instance is able
    -- to access resources only in your VPC, and is not be able to connect to
    -- Amazon SageMaker training and endpoint services unless you configure a
    -- NAT Gateway in your VPC.
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/sagemaker/latest/dg/appendix-additional-considerations.html#appendix-notebook-and-internet-access Notebook Instances Are Internet-Enabled by Default>.
    -- You can set the value of this parameter to @Disabled@ only if you set a
    -- value for the @SubnetId@ parameter.
    CreateNotebookInstance -> Maybe DirectInternetAccess
directInternetAccess :: Prelude.Maybe DirectInternetAccess,
    -- | An array of key-value pairs. You can use tags to categorize your Amazon
    -- Web Services resources in different ways, for example, by purpose,
    -- owner, or environment. For more information, see
    -- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging Amazon Web Services Resources>.
    CreateNotebookInstance -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The name of the new notebook instance.
    CreateNotebookInstance -> Text
notebookInstanceName :: Prelude.Text,
    -- | The type of ML compute instance to launch for the notebook instance.
    CreateNotebookInstance -> InstanceType
instanceType :: InstanceType,
    -- | When you send any requests to Amazon Web Services resources from the
    -- notebook instance, Amazon SageMaker assumes this role to perform tasks
    -- on your behalf. You must grant this role necessary permissions so Amazon
    -- SageMaker can perform these tasks. The policy must allow the Amazon
    -- SageMaker service principal (sagemaker.amazonaws.com) permissions to
    -- assume this role. For more information, see
    -- <https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-roles.html Amazon SageMaker Roles>.
    --
    -- To be able to pass this role to Amazon SageMaker, the caller of this API
    -- must have the @iam:PassRole@ permission.
    CreateNotebookInstance -> Text
roleArn :: Prelude.Text
  }
  deriving (CreateNotebookInstance -> CreateNotebookInstance -> Bool
(CreateNotebookInstance -> CreateNotebookInstance -> Bool)
-> (CreateNotebookInstance -> CreateNotebookInstance -> Bool)
-> Eq CreateNotebookInstance
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateNotebookInstance -> CreateNotebookInstance -> Bool
$c/= :: CreateNotebookInstance -> CreateNotebookInstance -> Bool
== :: CreateNotebookInstance -> CreateNotebookInstance -> Bool
$c== :: CreateNotebookInstance -> CreateNotebookInstance -> Bool
Prelude.Eq, ReadPrec [CreateNotebookInstance]
ReadPrec CreateNotebookInstance
Int -> ReadS CreateNotebookInstance
ReadS [CreateNotebookInstance]
(Int -> ReadS CreateNotebookInstance)
-> ReadS [CreateNotebookInstance]
-> ReadPrec CreateNotebookInstance
-> ReadPrec [CreateNotebookInstance]
-> Read CreateNotebookInstance
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateNotebookInstance]
$creadListPrec :: ReadPrec [CreateNotebookInstance]
readPrec :: ReadPrec CreateNotebookInstance
$creadPrec :: ReadPrec CreateNotebookInstance
readList :: ReadS [CreateNotebookInstance]
$creadList :: ReadS [CreateNotebookInstance]
readsPrec :: Int -> ReadS CreateNotebookInstance
$creadsPrec :: Int -> ReadS CreateNotebookInstance
Prelude.Read, Int -> CreateNotebookInstance -> ShowS
[CreateNotebookInstance] -> ShowS
CreateNotebookInstance -> String
(Int -> CreateNotebookInstance -> ShowS)
-> (CreateNotebookInstance -> String)
-> ([CreateNotebookInstance] -> ShowS)
-> Show CreateNotebookInstance
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateNotebookInstance] -> ShowS
$cshowList :: [CreateNotebookInstance] -> ShowS
show :: CreateNotebookInstance -> String
$cshow :: CreateNotebookInstance -> String
showsPrec :: Int -> CreateNotebookInstance -> ShowS
$cshowsPrec :: Int -> CreateNotebookInstance -> ShowS
Prelude.Show, (forall x. CreateNotebookInstance -> Rep CreateNotebookInstance x)
-> (forall x.
    Rep CreateNotebookInstance x -> CreateNotebookInstance)
-> Generic CreateNotebookInstance
forall x. Rep CreateNotebookInstance x -> CreateNotebookInstance
forall x. CreateNotebookInstance -> Rep CreateNotebookInstance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateNotebookInstance x -> CreateNotebookInstance
$cfrom :: forall x. CreateNotebookInstance -> Rep CreateNotebookInstance x
Prelude.Generic)

-- |
-- Create a value of 'CreateNotebookInstance' 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:
--
-- 'acceleratorTypes', 'createNotebookInstance_acceleratorTypes' - A list of Elastic Inference (EI) instance types to associate with this
-- notebook instance. Currently, only one instance type can be associated
-- with a notebook instance. For more information, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/ei.html Using Elastic Inference in Amazon SageMaker>.
--
-- 'platformIdentifier', 'createNotebookInstance_platformIdentifier' - The platform identifier of the notebook instance runtime environment.
--
-- 'securityGroupIds', 'createNotebookInstance_securityGroupIds' - The VPC security group IDs, in the form sg-xxxxxxxx. The security groups
-- must be for the same VPC as specified in the subnet.
--
-- 'additionalCodeRepositories', 'createNotebookInstance_additionalCodeRepositories' - An array of up to three Git repositories to associate with the notebook
-- instance. These can be either the names of Git repositories stored as
-- resources in your account, or the URL of Git repositories in
-- <https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html Amazon Web Services CodeCommit>
-- or in any other Git repository. These repositories are cloned at the
-- same level as the default repository of your notebook instance. For more
-- information, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-git-repo.html Associating Git Repositories with Amazon SageMaker Notebook Instances>.
--
-- 'lifecycleConfigName', 'createNotebookInstance_lifecycleConfigName' - The name of a lifecycle configuration to associate with the notebook
-- instance. For information about lifestyle configurations, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/notebook-lifecycle-config.html Step 2.1: (Optional) Customize a Notebook Instance>.
--
-- 'subnetId', 'createNotebookInstance_subnetId' - The ID of the subnet in a VPC to which you would like to have a
-- connectivity from your ML compute instance.
--
-- 'defaultCodeRepository', 'createNotebookInstance_defaultCodeRepository' - A Git repository to associate with the notebook instance as its default
-- code repository. This can be either the name of a Git repository stored
-- as a resource in your account, or the URL of a Git repository in
-- <https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html Amazon Web Services CodeCommit>
-- or in any other Git repository. When you open a notebook instance, it
-- opens in the directory that contains this repository. For more
-- information, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-git-repo.html Associating Git Repositories with Amazon SageMaker Notebook Instances>.
--
-- 'volumeSizeInGB', 'createNotebookInstance_volumeSizeInGB' - The size, in GB, of the ML storage volume to attach to the notebook
-- instance. The default value is 5 GB.
--
-- 'kmsKeyId', 'createNotebookInstance_kmsKeyId' - The Amazon Resource Name (ARN) of a Amazon Web Services Key Management
-- Service key that Amazon SageMaker uses to encrypt data on the storage
-- volume attached to your notebook instance. The KMS key you provide must
-- be enabled. For information, see
-- <https://docs.aws.amazon.com/kms/latest/developerguide/enabling-keys.html Enabling and Disabling Keys>
-- in the /Amazon Web Services Key Management Service Developer Guide/.
--
-- 'rootAccess', 'createNotebookInstance_rootAccess' - Whether root access is enabled or disabled for users of the notebook
-- instance. The default value is @Enabled@.
--
-- Lifecycle configurations need root access to be able to set up a
-- notebook instance. Because of this, lifecycle configurations associated
-- with a notebook instance always run with root access even if you disable
-- root access for users.
--
-- 'directInternetAccess', 'createNotebookInstance_directInternetAccess' - Sets whether Amazon SageMaker provides internet access to the notebook
-- instance. If you set this to @Disabled@ this notebook instance is able
-- to access resources only in your VPC, and is not be able to connect to
-- Amazon SageMaker training and endpoint services unless you configure a
-- NAT Gateway in your VPC.
--
-- For more information, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/appendix-additional-considerations.html#appendix-notebook-and-internet-access Notebook Instances Are Internet-Enabled by Default>.
-- You can set the value of this parameter to @Disabled@ only if you set a
-- value for the @SubnetId@ parameter.
--
-- 'tags', 'createNotebookInstance_tags' - An array of key-value pairs. You can use tags to categorize your Amazon
-- Web Services resources in different ways, for example, by purpose,
-- owner, or environment. For more information, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging Amazon Web Services Resources>.
--
-- 'notebookInstanceName', 'createNotebookInstance_notebookInstanceName' - The name of the new notebook instance.
--
-- 'instanceType', 'createNotebookInstance_instanceType' - The type of ML compute instance to launch for the notebook instance.
--
-- 'roleArn', 'createNotebookInstance_roleArn' - When you send any requests to Amazon Web Services resources from the
-- notebook instance, Amazon SageMaker assumes this role to perform tasks
-- on your behalf. You must grant this role necessary permissions so Amazon
-- SageMaker can perform these tasks. The policy must allow the Amazon
-- SageMaker service principal (sagemaker.amazonaws.com) permissions to
-- assume this role. For more information, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-roles.html Amazon SageMaker Roles>.
--
-- To be able to pass this role to Amazon SageMaker, the caller of this API
-- must have the @iam:PassRole@ permission.
newCreateNotebookInstance ::
  -- | 'notebookInstanceName'
  Prelude.Text ->
  -- | 'instanceType'
  InstanceType ->
  -- | 'roleArn'
  Prelude.Text ->
  CreateNotebookInstance
newCreateNotebookInstance :: Text -> InstanceType -> Text -> CreateNotebookInstance
newCreateNotebookInstance
  Text
pNotebookInstanceName_
  InstanceType
pInstanceType_
  Text
pRoleArn_ =
    CreateNotebookInstance' :: Maybe [NotebookInstanceAcceleratorType]
-> Maybe Text
-> Maybe [Text]
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe RootAccess
-> Maybe DirectInternetAccess
-> Maybe [Tag]
-> Text
-> InstanceType
-> Text
-> CreateNotebookInstance
CreateNotebookInstance'
      { $sel:acceleratorTypes:CreateNotebookInstance' :: Maybe [NotebookInstanceAcceleratorType]
acceleratorTypes =
          Maybe [NotebookInstanceAcceleratorType]
forall a. Maybe a
Prelude.Nothing,
        $sel:platformIdentifier:CreateNotebookInstance' :: Maybe Text
platformIdentifier = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:securityGroupIds:CreateNotebookInstance' :: Maybe [Text]
securityGroupIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:additionalCodeRepositories:CreateNotebookInstance' :: Maybe [Text]
additionalCodeRepositories = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:lifecycleConfigName:CreateNotebookInstance' :: Maybe Text
lifecycleConfigName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:subnetId:CreateNotebookInstance' :: Maybe Text
subnetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:defaultCodeRepository:CreateNotebookInstance' :: Maybe Text
defaultCodeRepository = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:volumeSizeInGB:CreateNotebookInstance' :: Maybe Natural
volumeSizeInGB = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:kmsKeyId:CreateNotebookInstance' :: Maybe Text
kmsKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:rootAccess:CreateNotebookInstance' :: Maybe RootAccess
rootAccess = Maybe RootAccess
forall a. Maybe a
Prelude.Nothing,
        $sel:directInternetAccess:CreateNotebookInstance' :: Maybe DirectInternetAccess
directInternetAccess = Maybe DirectInternetAccess
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateNotebookInstance' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:notebookInstanceName:CreateNotebookInstance' :: Text
notebookInstanceName = Text
pNotebookInstanceName_,
        $sel:instanceType:CreateNotebookInstance' :: InstanceType
instanceType = InstanceType
pInstanceType_,
        $sel:roleArn:CreateNotebookInstance' :: Text
roleArn = Text
pRoleArn_
      }

-- | A list of Elastic Inference (EI) instance types to associate with this
-- notebook instance. Currently, only one instance type can be associated
-- with a notebook instance. For more information, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/ei.html Using Elastic Inference in Amazon SageMaker>.
createNotebookInstance_acceleratorTypes :: Lens.Lens' CreateNotebookInstance (Prelude.Maybe [NotebookInstanceAcceleratorType])
createNotebookInstance_acceleratorTypes :: (Maybe [NotebookInstanceAcceleratorType]
 -> f (Maybe [NotebookInstanceAcceleratorType]))
-> CreateNotebookInstance -> f CreateNotebookInstance
createNotebookInstance_acceleratorTypes = (CreateNotebookInstance -> Maybe [NotebookInstanceAcceleratorType])
-> (CreateNotebookInstance
    -> Maybe [NotebookInstanceAcceleratorType]
    -> CreateNotebookInstance)
-> Lens
     CreateNotebookInstance
     CreateNotebookInstance
     (Maybe [NotebookInstanceAcceleratorType])
     (Maybe [NotebookInstanceAcceleratorType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotebookInstance' {Maybe [NotebookInstanceAcceleratorType]
acceleratorTypes :: Maybe [NotebookInstanceAcceleratorType]
$sel:acceleratorTypes:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe [NotebookInstanceAcceleratorType]
acceleratorTypes} -> Maybe [NotebookInstanceAcceleratorType]
acceleratorTypes) (\s :: CreateNotebookInstance
s@CreateNotebookInstance' {} Maybe [NotebookInstanceAcceleratorType]
a -> CreateNotebookInstance
s {$sel:acceleratorTypes:CreateNotebookInstance' :: Maybe [NotebookInstanceAcceleratorType]
acceleratorTypes = Maybe [NotebookInstanceAcceleratorType]
a} :: CreateNotebookInstance) ((Maybe [NotebookInstanceAcceleratorType]
  -> f (Maybe [NotebookInstanceAcceleratorType]))
 -> CreateNotebookInstance -> f CreateNotebookInstance)
-> ((Maybe [NotebookInstanceAcceleratorType]
     -> f (Maybe [NotebookInstanceAcceleratorType]))
    -> Maybe [NotebookInstanceAcceleratorType]
    -> f (Maybe [NotebookInstanceAcceleratorType]))
-> (Maybe [NotebookInstanceAcceleratorType]
    -> f (Maybe [NotebookInstanceAcceleratorType]))
-> CreateNotebookInstance
-> f CreateNotebookInstance
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [NotebookInstanceAcceleratorType]
  [NotebookInstanceAcceleratorType]
  [NotebookInstanceAcceleratorType]
  [NotebookInstanceAcceleratorType]
-> Iso
     (Maybe [NotebookInstanceAcceleratorType])
     (Maybe [NotebookInstanceAcceleratorType])
     (Maybe [NotebookInstanceAcceleratorType])
     (Maybe [NotebookInstanceAcceleratorType])
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
  [NotebookInstanceAcceleratorType]
  [NotebookInstanceAcceleratorType]
  [NotebookInstanceAcceleratorType]
  [NotebookInstanceAcceleratorType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The platform identifier of the notebook instance runtime environment.
createNotebookInstance_platformIdentifier :: Lens.Lens' CreateNotebookInstance (Prelude.Maybe Prelude.Text)
createNotebookInstance_platformIdentifier :: (Maybe Text -> f (Maybe Text))
-> CreateNotebookInstance -> f CreateNotebookInstance
createNotebookInstance_platformIdentifier = (CreateNotebookInstance -> Maybe Text)
-> (CreateNotebookInstance -> Maybe Text -> CreateNotebookInstance)
-> Lens
     CreateNotebookInstance
     CreateNotebookInstance
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotebookInstance' {Maybe Text
platformIdentifier :: Maybe Text
$sel:platformIdentifier:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe Text
platformIdentifier} -> Maybe Text
platformIdentifier) (\s :: CreateNotebookInstance
s@CreateNotebookInstance' {} Maybe Text
a -> CreateNotebookInstance
s {$sel:platformIdentifier:CreateNotebookInstance' :: Maybe Text
platformIdentifier = Maybe Text
a} :: CreateNotebookInstance)

-- | The VPC security group IDs, in the form sg-xxxxxxxx. The security groups
-- must be for the same VPC as specified in the subnet.
createNotebookInstance_securityGroupIds :: Lens.Lens' CreateNotebookInstance (Prelude.Maybe [Prelude.Text])
createNotebookInstance_securityGroupIds :: (Maybe [Text] -> f (Maybe [Text]))
-> CreateNotebookInstance -> f CreateNotebookInstance
createNotebookInstance_securityGroupIds = (CreateNotebookInstance -> Maybe [Text])
-> (CreateNotebookInstance
    -> Maybe [Text] -> CreateNotebookInstance)
-> Lens
     CreateNotebookInstance
     CreateNotebookInstance
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotebookInstance' {Maybe [Text]
securityGroupIds :: Maybe [Text]
$sel:securityGroupIds:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe [Text]
securityGroupIds} -> Maybe [Text]
securityGroupIds) (\s :: CreateNotebookInstance
s@CreateNotebookInstance' {} Maybe [Text]
a -> CreateNotebookInstance
s {$sel:securityGroupIds:CreateNotebookInstance' :: Maybe [Text]
securityGroupIds = Maybe [Text]
a} :: CreateNotebookInstance) ((Maybe [Text] -> f (Maybe [Text]))
 -> CreateNotebookInstance -> f CreateNotebookInstance)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateNotebookInstance
-> f CreateNotebookInstance
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An array of up to three Git repositories to associate with the notebook
-- instance. These can be either the names of Git repositories stored as
-- resources in your account, or the URL of Git repositories in
-- <https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html Amazon Web Services CodeCommit>
-- or in any other Git repository. These repositories are cloned at the
-- same level as the default repository of your notebook instance. For more
-- information, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-git-repo.html Associating Git Repositories with Amazon SageMaker Notebook Instances>.
createNotebookInstance_additionalCodeRepositories :: Lens.Lens' CreateNotebookInstance (Prelude.Maybe [Prelude.Text])
createNotebookInstance_additionalCodeRepositories :: (Maybe [Text] -> f (Maybe [Text]))
-> CreateNotebookInstance -> f CreateNotebookInstance
createNotebookInstance_additionalCodeRepositories = (CreateNotebookInstance -> Maybe [Text])
-> (CreateNotebookInstance
    -> Maybe [Text] -> CreateNotebookInstance)
-> Lens
     CreateNotebookInstance
     CreateNotebookInstance
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotebookInstance' {Maybe [Text]
additionalCodeRepositories :: Maybe [Text]
$sel:additionalCodeRepositories:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe [Text]
additionalCodeRepositories} -> Maybe [Text]
additionalCodeRepositories) (\s :: CreateNotebookInstance
s@CreateNotebookInstance' {} Maybe [Text]
a -> CreateNotebookInstance
s {$sel:additionalCodeRepositories:CreateNotebookInstance' :: Maybe [Text]
additionalCodeRepositories = Maybe [Text]
a} :: CreateNotebookInstance) ((Maybe [Text] -> f (Maybe [Text]))
 -> CreateNotebookInstance -> f CreateNotebookInstance)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateNotebookInstance
-> f CreateNotebookInstance
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of a lifecycle configuration to associate with the notebook
-- instance. For information about lifestyle configurations, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/notebook-lifecycle-config.html Step 2.1: (Optional) Customize a Notebook Instance>.
createNotebookInstance_lifecycleConfigName :: Lens.Lens' CreateNotebookInstance (Prelude.Maybe Prelude.Text)
createNotebookInstance_lifecycleConfigName :: (Maybe Text -> f (Maybe Text))
-> CreateNotebookInstance -> f CreateNotebookInstance
createNotebookInstance_lifecycleConfigName = (CreateNotebookInstance -> Maybe Text)
-> (CreateNotebookInstance -> Maybe Text -> CreateNotebookInstance)
-> Lens
     CreateNotebookInstance
     CreateNotebookInstance
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotebookInstance' {Maybe Text
lifecycleConfigName :: Maybe Text
$sel:lifecycleConfigName:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe Text
lifecycleConfigName} -> Maybe Text
lifecycleConfigName) (\s :: CreateNotebookInstance
s@CreateNotebookInstance' {} Maybe Text
a -> CreateNotebookInstance
s {$sel:lifecycleConfigName:CreateNotebookInstance' :: Maybe Text
lifecycleConfigName = Maybe Text
a} :: CreateNotebookInstance)

-- | The ID of the subnet in a VPC to which you would like to have a
-- connectivity from your ML compute instance.
createNotebookInstance_subnetId :: Lens.Lens' CreateNotebookInstance (Prelude.Maybe Prelude.Text)
createNotebookInstance_subnetId :: (Maybe Text -> f (Maybe Text))
-> CreateNotebookInstance -> f CreateNotebookInstance
createNotebookInstance_subnetId = (CreateNotebookInstance -> Maybe Text)
-> (CreateNotebookInstance -> Maybe Text -> CreateNotebookInstance)
-> Lens
     CreateNotebookInstance
     CreateNotebookInstance
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotebookInstance' {Maybe Text
subnetId :: Maybe Text
$sel:subnetId:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe Text
subnetId} -> Maybe Text
subnetId) (\s :: CreateNotebookInstance
s@CreateNotebookInstance' {} Maybe Text
a -> CreateNotebookInstance
s {$sel:subnetId:CreateNotebookInstance' :: Maybe Text
subnetId = Maybe Text
a} :: CreateNotebookInstance)

-- | A Git repository to associate with the notebook instance as its default
-- code repository. This can be either the name of a Git repository stored
-- as a resource in your account, or the URL of a Git repository in
-- <https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html Amazon Web Services CodeCommit>
-- or in any other Git repository. When you open a notebook instance, it
-- opens in the directory that contains this repository. For more
-- information, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-git-repo.html Associating Git Repositories with Amazon SageMaker Notebook Instances>.
createNotebookInstance_defaultCodeRepository :: Lens.Lens' CreateNotebookInstance (Prelude.Maybe Prelude.Text)
createNotebookInstance_defaultCodeRepository :: (Maybe Text -> f (Maybe Text))
-> CreateNotebookInstance -> f CreateNotebookInstance
createNotebookInstance_defaultCodeRepository = (CreateNotebookInstance -> Maybe Text)
-> (CreateNotebookInstance -> Maybe Text -> CreateNotebookInstance)
-> Lens
     CreateNotebookInstance
     CreateNotebookInstance
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotebookInstance' {Maybe Text
defaultCodeRepository :: Maybe Text
$sel:defaultCodeRepository:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe Text
defaultCodeRepository} -> Maybe Text
defaultCodeRepository) (\s :: CreateNotebookInstance
s@CreateNotebookInstance' {} Maybe Text
a -> CreateNotebookInstance
s {$sel:defaultCodeRepository:CreateNotebookInstance' :: Maybe Text
defaultCodeRepository = Maybe Text
a} :: CreateNotebookInstance)

-- | The size, in GB, of the ML storage volume to attach to the notebook
-- instance. The default value is 5 GB.
createNotebookInstance_volumeSizeInGB :: Lens.Lens' CreateNotebookInstance (Prelude.Maybe Prelude.Natural)
createNotebookInstance_volumeSizeInGB :: (Maybe Natural -> f (Maybe Natural))
-> CreateNotebookInstance -> f CreateNotebookInstance
createNotebookInstance_volumeSizeInGB = (CreateNotebookInstance -> Maybe Natural)
-> (CreateNotebookInstance
    -> Maybe Natural -> CreateNotebookInstance)
-> Lens
     CreateNotebookInstance
     CreateNotebookInstance
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotebookInstance' {Maybe Natural
volumeSizeInGB :: Maybe Natural
$sel:volumeSizeInGB:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe Natural
volumeSizeInGB} -> Maybe Natural
volumeSizeInGB) (\s :: CreateNotebookInstance
s@CreateNotebookInstance' {} Maybe Natural
a -> CreateNotebookInstance
s {$sel:volumeSizeInGB:CreateNotebookInstance' :: Maybe Natural
volumeSizeInGB = Maybe Natural
a} :: CreateNotebookInstance)

-- | The Amazon Resource Name (ARN) of a Amazon Web Services Key Management
-- Service key that Amazon SageMaker uses to encrypt data on the storage
-- volume attached to your notebook instance. The KMS key you provide must
-- be enabled. For information, see
-- <https://docs.aws.amazon.com/kms/latest/developerguide/enabling-keys.html Enabling and Disabling Keys>
-- in the /Amazon Web Services Key Management Service Developer Guide/.
createNotebookInstance_kmsKeyId :: Lens.Lens' CreateNotebookInstance (Prelude.Maybe Prelude.Text)
createNotebookInstance_kmsKeyId :: (Maybe Text -> f (Maybe Text))
-> CreateNotebookInstance -> f CreateNotebookInstance
createNotebookInstance_kmsKeyId = (CreateNotebookInstance -> Maybe Text)
-> (CreateNotebookInstance -> Maybe Text -> CreateNotebookInstance)
-> Lens
     CreateNotebookInstance
     CreateNotebookInstance
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotebookInstance' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: CreateNotebookInstance
s@CreateNotebookInstance' {} Maybe Text
a -> CreateNotebookInstance
s {$sel:kmsKeyId:CreateNotebookInstance' :: Maybe Text
kmsKeyId = Maybe Text
a} :: CreateNotebookInstance)

-- | Whether root access is enabled or disabled for users of the notebook
-- instance. The default value is @Enabled@.
--
-- Lifecycle configurations need root access to be able to set up a
-- notebook instance. Because of this, lifecycle configurations associated
-- with a notebook instance always run with root access even if you disable
-- root access for users.
createNotebookInstance_rootAccess :: Lens.Lens' CreateNotebookInstance (Prelude.Maybe RootAccess)
createNotebookInstance_rootAccess :: (Maybe RootAccess -> f (Maybe RootAccess))
-> CreateNotebookInstance -> f CreateNotebookInstance
createNotebookInstance_rootAccess = (CreateNotebookInstance -> Maybe RootAccess)
-> (CreateNotebookInstance
    -> Maybe RootAccess -> CreateNotebookInstance)
-> Lens
     CreateNotebookInstance
     CreateNotebookInstance
     (Maybe RootAccess)
     (Maybe RootAccess)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotebookInstance' {Maybe RootAccess
rootAccess :: Maybe RootAccess
$sel:rootAccess:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe RootAccess
rootAccess} -> Maybe RootAccess
rootAccess) (\s :: CreateNotebookInstance
s@CreateNotebookInstance' {} Maybe RootAccess
a -> CreateNotebookInstance
s {$sel:rootAccess:CreateNotebookInstance' :: Maybe RootAccess
rootAccess = Maybe RootAccess
a} :: CreateNotebookInstance)

-- | Sets whether Amazon SageMaker provides internet access to the notebook
-- instance. If you set this to @Disabled@ this notebook instance is able
-- to access resources only in your VPC, and is not be able to connect to
-- Amazon SageMaker training and endpoint services unless you configure a
-- NAT Gateway in your VPC.
--
-- For more information, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/appendix-additional-considerations.html#appendix-notebook-and-internet-access Notebook Instances Are Internet-Enabled by Default>.
-- You can set the value of this parameter to @Disabled@ only if you set a
-- value for the @SubnetId@ parameter.
createNotebookInstance_directInternetAccess :: Lens.Lens' CreateNotebookInstance (Prelude.Maybe DirectInternetAccess)
createNotebookInstance_directInternetAccess :: (Maybe DirectInternetAccess -> f (Maybe DirectInternetAccess))
-> CreateNotebookInstance -> f CreateNotebookInstance
createNotebookInstance_directInternetAccess = (CreateNotebookInstance -> Maybe DirectInternetAccess)
-> (CreateNotebookInstance
    -> Maybe DirectInternetAccess -> CreateNotebookInstance)
-> Lens
     CreateNotebookInstance
     CreateNotebookInstance
     (Maybe DirectInternetAccess)
     (Maybe DirectInternetAccess)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotebookInstance' {Maybe DirectInternetAccess
directInternetAccess :: Maybe DirectInternetAccess
$sel:directInternetAccess:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe DirectInternetAccess
directInternetAccess} -> Maybe DirectInternetAccess
directInternetAccess) (\s :: CreateNotebookInstance
s@CreateNotebookInstance' {} Maybe DirectInternetAccess
a -> CreateNotebookInstance
s {$sel:directInternetAccess:CreateNotebookInstance' :: Maybe DirectInternetAccess
directInternetAccess = Maybe DirectInternetAccess
a} :: CreateNotebookInstance)

-- | An array of key-value pairs. You can use tags to categorize your Amazon
-- Web Services resources in different ways, for example, by purpose,
-- owner, or environment. For more information, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging Amazon Web Services Resources>.
createNotebookInstance_tags :: Lens.Lens' CreateNotebookInstance (Prelude.Maybe [Tag])
createNotebookInstance_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateNotebookInstance -> f CreateNotebookInstance
createNotebookInstance_tags = (CreateNotebookInstance -> Maybe [Tag])
-> (CreateNotebookInstance
    -> Maybe [Tag] -> CreateNotebookInstance)
-> Lens
     CreateNotebookInstance
     CreateNotebookInstance
     (Maybe [Tag])
     (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotebookInstance' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateNotebookInstance
s@CreateNotebookInstance' {} Maybe [Tag]
a -> CreateNotebookInstance
s {$sel:tags:CreateNotebookInstance' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateNotebookInstance) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateNotebookInstance -> f CreateNotebookInstance)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateNotebookInstance
-> f CreateNotebookInstance
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the new notebook instance.
createNotebookInstance_notebookInstanceName :: Lens.Lens' CreateNotebookInstance Prelude.Text
createNotebookInstance_notebookInstanceName :: (Text -> f Text)
-> CreateNotebookInstance -> f CreateNotebookInstance
createNotebookInstance_notebookInstanceName = (CreateNotebookInstance -> Text)
-> (CreateNotebookInstance -> Text -> CreateNotebookInstance)
-> Lens CreateNotebookInstance CreateNotebookInstance Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotebookInstance' {Text
notebookInstanceName :: Text
$sel:notebookInstanceName:CreateNotebookInstance' :: CreateNotebookInstance -> Text
notebookInstanceName} -> Text
notebookInstanceName) (\s :: CreateNotebookInstance
s@CreateNotebookInstance' {} Text
a -> CreateNotebookInstance
s {$sel:notebookInstanceName:CreateNotebookInstance' :: Text
notebookInstanceName = Text
a} :: CreateNotebookInstance)

-- | The type of ML compute instance to launch for the notebook instance.
createNotebookInstance_instanceType :: Lens.Lens' CreateNotebookInstance InstanceType
createNotebookInstance_instanceType :: (InstanceType -> f InstanceType)
-> CreateNotebookInstance -> f CreateNotebookInstance
createNotebookInstance_instanceType = (CreateNotebookInstance -> InstanceType)
-> (CreateNotebookInstance
    -> InstanceType -> CreateNotebookInstance)
-> Lens
     CreateNotebookInstance
     CreateNotebookInstance
     InstanceType
     InstanceType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotebookInstance' {InstanceType
instanceType :: InstanceType
$sel:instanceType:CreateNotebookInstance' :: CreateNotebookInstance -> InstanceType
instanceType} -> InstanceType
instanceType) (\s :: CreateNotebookInstance
s@CreateNotebookInstance' {} InstanceType
a -> CreateNotebookInstance
s {$sel:instanceType:CreateNotebookInstance' :: InstanceType
instanceType = InstanceType
a} :: CreateNotebookInstance)

-- | When you send any requests to Amazon Web Services resources from the
-- notebook instance, Amazon SageMaker assumes this role to perform tasks
-- on your behalf. You must grant this role necessary permissions so Amazon
-- SageMaker can perform these tasks. The policy must allow the Amazon
-- SageMaker service principal (sagemaker.amazonaws.com) permissions to
-- assume this role. For more information, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-roles.html Amazon SageMaker Roles>.
--
-- To be able to pass this role to Amazon SageMaker, the caller of this API
-- must have the @iam:PassRole@ permission.
createNotebookInstance_roleArn :: Lens.Lens' CreateNotebookInstance Prelude.Text
createNotebookInstance_roleArn :: (Text -> f Text)
-> CreateNotebookInstance -> f CreateNotebookInstance
createNotebookInstance_roleArn = (CreateNotebookInstance -> Text)
-> (CreateNotebookInstance -> Text -> CreateNotebookInstance)
-> Lens CreateNotebookInstance CreateNotebookInstance Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotebookInstance' {Text
roleArn :: Text
$sel:roleArn:CreateNotebookInstance' :: CreateNotebookInstance -> Text
roleArn} -> Text
roleArn) (\s :: CreateNotebookInstance
s@CreateNotebookInstance' {} Text
a -> CreateNotebookInstance
s {$sel:roleArn:CreateNotebookInstance' :: Text
roleArn = Text
a} :: CreateNotebookInstance)

instance Core.AWSRequest CreateNotebookInstance where
  type
    AWSResponse CreateNotebookInstance =
      CreateNotebookInstanceResponse
  request :: CreateNotebookInstance -> Request CreateNotebookInstance
request = Service -> CreateNotebookInstance -> Request CreateNotebookInstance
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateNotebookInstance
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateNotebookInstance)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateNotebookInstance))
-> Logger
-> Service
-> Proxy CreateNotebookInstance
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateNotebookInstance)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Int -> CreateNotebookInstanceResponse
CreateNotebookInstanceResponse'
            (Maybe Text -> Int -> CreateNotebookInstanceResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateNotebookInstanceResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NotebookInstanceArn")
            Either String (Int -> CreateNotebookInstanceResponse)
-> Either String Int
-> Either String CreateNotebookInstanceResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateNotebookInstance

instance Prelude.NFData CreateNotebookInstance

instance Core.ToHeaders CreateNotebookInstance where
  toHeaders :: CreateNotebookInstance -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateNotebookInstance -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"SageMaker.CreateNotebookInstance" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON CreateNotebookInstance where
  toJSON :: CreateNotebookInstance -> Value
toJSON CreateNotebookInstance' {Maybe Natural
Maybe [Text]
Maybe [NotebookInstanceAcceleratorType]
Maybe [Tag]
Maybe Text
Maybe DirectInternetAccess
Maybe RootAccess
Text
InstanceType
roleArn :: Text
instanceType :: InstanceType
notebookInstanceName :: Text
tags :: Maybe [Tag]
directInternetAccess :: Maybe DirectInternetAccess
rootAccess :: Maybe RootAccess
kmsKeyId :: Maybe Text
volumeSizeInGB :: Maybe Natural
defaultCodeRepository :: Maybe Text
subnetId :: Maybe Text
lifecycleConfigName :: Maybe Text
additionalCodeRepositories :: Maybe [Text]
securityGroupIds :: Maybe [Text]
platformIdentifier :: Maybe Text
acceleratorTypes :: Maybe [NotebookInstanceAcceleratorType]
$sel:roleArn:CreateNotebookInstance' :: CreateNotebookInstance -> Text
$sel:instanceType:CreateNotebookInstance' :: CreateNotebookInstance -> InstanceType
$sel:notebookInstanceName:CreateNotebookInstance' :: CreateNotebookInstance -> Text
$sel:tags:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe [Tag]
$sel:directInternetAccess:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe DirectInternetAccess
$sel:rootAccess:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe RootAccess
$sel:kmsKeyId:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe Text
$sel:volumeSizeInGB:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe Natural
$sel:defaultCodeRepository:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe Text
$sel:subnetId:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe Text
$sel:lifecycleConfigName:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe Text
$sel:additionalCodeRepositories:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe [Text]
$sel:securityGroupIds:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe [Text]
$sel:platformIdentifier:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe Text
$sel:acceleratorTypes:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe [NotebookInstanceAcceleratorType]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"AcceleratorTypes" Text -> [NotebookInstanceAcceleratorType] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([NotebookInstanceAcceleratorType] -> Pair)
-> Maybe [NotebookInstanceAcceleratorType] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [NotebookInstanceAcceleratorType]
acceleratorTypes,
            (Text
"PlatformIdentifier" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
platformIdentifier,
            (Text
"SecurityGroupIds" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
securityGroupIds,
            (Text
"AdditionalCodeRepositories" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
additionalCodeRepositories,
            (Text
"LifecycleConfigName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
lifecycleConfigName,
            (Text
"SubnetId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
subnetId,
            (Text
"DefaultCodeRepository" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
defaultCodeRepository,
            (Text
"VolumeSizeInGB" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
volumeSizeInGB,
            (Text
"KmsKeyId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
kmsKeyId,
            (Text
"RootAccess" Text -> RootAccess -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (RootAccess -> Pair) -> Maybe RootAccess -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RootAccess
rootAccess,
            (Text
"DirectInternetAccess" Text -> DirectInternetAccess -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (DirectInternetAccess -> Pair)
-> Maybe DirectInternetAccess -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DirectInternetAccess
directInternetAccess,
            (Text
"Tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"NotebookInstanceName"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
notebookInstanceName
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"InstanceType" Text -> InstanceType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= InstanceType
instanceType),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"RoleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
roleArn)
          ]
      )

instance Core.ToPath CreateNotebookInstance where
  toPath :: CreateNotebookInstance -> ByteString
toPath = ByteString -> CreateNotebookInstance -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery CreateNotebookInstance where
  toQuery :: CreateNotebookInstance -> QueryString
toQuery = QueryString -> CreateNotebookInstance -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreateNotebookInstanceResponse' smart constructor.
data CreateNotebookInstanceResponse = CreateNotebookInstanceResponse'
  { -- | The Amazon Resource Name (ARN) of the notebook instance.
    CreateNotebookInstanceResponse -> Maybe Text
notebookInstanceArn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateNotebookInstanceResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateNotebookInstanceResponse
-> CreateNotebookInstanceResponse -> Bool
(CreateNotebookInstanceResponse
 -> CreateNotebookInstanceResponse -> Bool)
-> (CreateNotebookInstanceResponse
    -> CreateNotebookInstanceResponse -> Bool)
-> Eq CreateNotebookInstanceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateNotebookInstanceResponse
-> CreateNotebookInstanceResponse -> Bool
$c/= :: CreateNotebookInstanceResponse
-> CreateNotebookInstanceResponse -> Bool
== :: CreateNotebookInstanceResponse
-> CreateNotebookInstanceResponse -> Bool
$c== :: CreateNotebookInstanceResponse
-> CreateNotebookInstanceResponse -> Bool
Prelude.Eq, ReadPrec [CreateNotebookInstanceResponse]
ReadPrec CreateNotebookInstanceResponse
Int -> ReadS CreateNotebookInstanceResponse
ReadS [CreateNotebookInstanceResponse]
(Int -> ReadS CreateNotebookInstanceResponse)
-> ReadS [CreateNotebookInstanceResponse]
-> ReadPrec CreateNotebookInstanceResponse
-> ReadPrec [CreateNotebookInstanceResponse]
-> Read CreateNotebookInstanceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateNotebookInstanceResponse]
$creadListPrec :: ReadPrec [CreateNotebookInstanceResponse]
readPrec :: ReadPrec CreateNotebookInstanceResponse
$creadPrec :: ReadPrec CreateNotebookInstanceResponse
readList :: ReadS [CreateNotebookInstanceResponse]
$creadList :: ReadS [CreateNotebookInstanceResponse]
readsPrec :: Int -> ReadS CreateNotebookInstanceResponse
$creadsPrec :: Int -> ReadS CreateNotebookInstanceResponse
Prelude.Read, Int -> CreateNotebookInstanceResponse -> ShowS
[CreateNotebookInstanceResponse] -> ShowS
CreateNotebookInstanceResponse -> String
(Int -> CreateNotebookInstanceResponse -> ShowS)
-> (CreateNotebookInstanceResponse -> String)
-> ([CreateNotebookInstanceResponse] -> ShowS)
-> Show CreateNotebookInstanceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateNotebookInstanceResponse] -> ShowS
$cshowList :: [CreateNotebookInstanceResponse] -> ShowS
show :: CreateNotebookInstanceResponse -> String
$cshow :: CreateNotebookInstanceResponse -> String
showsPrec :: Int -> CreateNotebookInstanceResponse -> ShowS
$cshowsPrec :: Int -> CreateNotebookInstanceResponse -> ShowS
Prelude.Show, (forall x.
 CreateNotebookInstanceResponse
 -> Rep CreateNotebookInstanceResponse x)
-> (forall x.
    Rep CreateNotebookInstanceResponse x
    -> CreateNotebookInstanceResponse)
-> Generic CreateNotebookInstanceResponse
forall x.
Rep CreateNotebookInstanceResponse x
-> CreateNotebookInstanceResponse
forall x.
CreateNotebookInstanceResponse
-> Rep CreateNotebookInstanceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateNotebookInstanceResponse x
-> CreateNotebookInstanceResponse
$cfrom :: forall x.
CreateNotebookInstanceResponse
-> Rep CreateNotebookInstanceResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateNotebookInstanceResponse' 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:
--
-- 'notebookInstanceArn', 'createNotebookInstanceResponse_notebookInstanceArn' - The Amazon Resource Name (ARN) of the notebook instance.
--
-- 'httpStatus', 'createNotebookInstanceResponse_httpStatus' - The response's http status code.
newCreateNotebookInstanceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateNotebookInstanceResponse
newCreateNotebookInstanceResponse :: Int -> CreateNotebookInstanceResponse
newCreateNotebookInstanceResponse Int
pHttpStatus_ =
  CreateNotebookInstanceResponse' :: Maybe Text -> Int -> CreateNotebookInstanceResponse
CreateNotebookInstanceResponse'
    { $sel:notebookInstanceArn:CreateNotebookInstanceResponse' :: Maybe Text
notebookInstanceArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateNotebookInstanceResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Amazon Resource Name (ARN) of the notebook instance.
createNotebookInstanceResponse_notebookInstanceArn :: Lens.Lens' CreateNotebookInstanceResponse (Prelude.Maybe Prelude.Text)
createNotebookInstanceResponse_notebookInstanceArn :: (Maybe Text -> f (Maybe Text))
-> CreateNotebookInstanceResponse
-> f CreateNotebookInstanceResponse
createNotebookInstanceResponse_notebookInstanceArn = (CreateNotebookInstanceResponse -> Maybe Text)
-> (CreateNotebookInstanceResponse
    -> Maybe Text -> CreateNotebookInstanceResponse)
-> Lens
     CreateNotebookInstanceResponse
     CreateNotebookInstanceResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotebookInstanceResponse' {Maybe Text
notebookInstanceArn :: Maybe Text
$sel:notebookInstanceArn:CreateNotebookInstanceResponse' :: CreateNotebookInstanceResponse -> Maybe Text
notebookInstanceArn} -> Maybe Text
notebookInstanceArn) (\s :: CreateNotebookInstanceResponse
s@CreateNotebookInstanceResponse' {} Maybe Text
a -> CreateNotebookInstanceResponse
s {$sel:notebookInstanceArn:CreateNotebookInstanceResponse' :: Maybe Text
notebookInstanceArn = Maybe Text
a} :: CreateNotebookInstanceResponse)

-- | The response's http status code.
createNotebookInstanceResponse_httpStatus :: Lens.Lens' CreateNotebookInstanceResponse Prelude.Int
createNotebookInstanceResponse_httpStatus :: (Int -> f Int)
-> CreateNotebookInstanceResponse
-> f CreateNotebookInstanceResponse
createNotebookInstanceResponse_httpStatus = (CreateNotebookInstanceResponse -> Int)
-> (CreateNotebookInstanceResponse
    -> Int -> CreateNotebookInstanceResponse)
-> Lens
     CreateNotebookInstanceResponse
     CreateNotebookInstanceResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotebookInstanceResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateNotebookInstanceResponse' :: CreateNotebookInstanceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateNotebookInstanceResponse
s@CreateNotebookInstanceResponse' {} Int
a -> CreateNotebookInstanceResponse
s {$sel:httpStatus:CreateNotebookInstanceResponse' :: Int
httpStatus = Int
a} :: CreateNotebookInstanceResponse)

instance
  Prelude.NFData
    CreateNotebookInstanceResponse