{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates an 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. 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.
--
-- SageMaker also provides a set of example notebooks. Each notebook
-- demonstrates how to use SageMaker with a specific algorithm or with a
-- machine learning framework.
--
-- After receiving the request, SageMaker does the following:
--
-- 1.  Creates a network interface in the SageMaker VPC.
--
-- 2.  (Option) If you specified @SubnetId@, 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,
--     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
--     SageMaker VPC. If you specified @SubnetId@ of your VPC, 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, SageMaker returns its Amazon
-- Resource Name (ARN). You can\'t change the name of a notebook instance
-- after you create it.
--
-- After 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 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_additionalCodeRepositories,
    createNotebookInstance_defaultCodeRepository,
    createNotebookInstance_directInternetAccess,
    createNotebookInstance_instanceMetadataServiceConfiguration,
    createNotebookInstance_kmsKeyId,
    createNotebookInstance_lifecycleConfigName,
    createNotebookInstance_platformIdentifier,
    createNotebookInstance_rootAccess,
    createNotebookInstance_securityGroupIds,
    createNotebookInstance_subnetId,
    createNotebookInstance_tags,
    createNotebookInstance_volumeSizeInGB,
    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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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],
    -- | 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 SageMaker Notebook Instances>.
    CreateNotebookInstance -> Maybe [Text]
additionalCodeRepositories :: 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 SageMaker Notebook Instances>.
    CreateNotebookInstance -> Maybe Text
defaultCodeRepository :: Prelude.Maybe Prelude.Text,
    -- | Sets whether 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
    -- 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,
    -- | Information on the IMDS configuration of the notebook instance
    CreateNotebookInstance
-> Maybe InstanceMetadataServiceConfiguration
instanceMetadataServiceConfiguration :: Prelude.Maybe InstanceMetadataServiceConfiguration,
    -- | The Amazon Resource Name (ARN) of a Amazon Web Services Key Management
    -- Service key that 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,
    -- | 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 platform identifier of the notebook instance runtime environment.
    CreateNotebookInstance -> Maybe Text
platformIdentifier :: 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,
    -- | 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],
    -- | 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,
    -- | 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 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 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, SageMaker assumes this role to perform tasks on your
    -- behalf. You must grant this role necessary permissions so SageMaker can
    -- perform these tasks. The policy must allow the 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 SageMaker Roles>.
    --
    -- To be able to pass this role to SageMaker, the caller of this API must
    -- have the @iam:PassRole@ permission.
    CreateNotebookInstance -> Text
roleArn :: Prelude.Text
  }
  deriving (CreateNotebookInstance -> CreateNotebookInstance -> Bool
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]
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
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. 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>.
--
-- '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 SageMaker Notebook Instances>.
--
-- '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 SageMaker Notebook Instances>.
--
-- 'directInternetAccess', 'createNotebookInstance_directInternetAccess' - Sets whether 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
-- 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.
--
-- 'instanceMetadataServiceConfiguration', 'createNotebookInstance_instanceMetadataServiceConfiguration' - Information on the IMDS configuration of the notebook instance
--
-- 'kmsKeyId', 'createNotebookInstance_kmsKeyId' - The Amazon Resource Name (ARN) of a Amazon Web Services Key Management
-- Service key that 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/.
--
-- '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>.
--
-- 'platformIdentifier', 'createNotebookInstance_platformIdentifier' - The platform identifier of the notebook instance runtime environment.
--
-- '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.
--
-- '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.
--
-- '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.
--
-- '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>.
--
-- 'volumeSizeInGB', 'createNotebookInstance_volumeSizeInGB' - The size, in GB, of the ML storage volume to attach to the notebook
-- instance. The default value is 5 GB.
--
-- '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, SageMaker assumes this role to perform tasks on your
-- behalf. You must grant this role necessary permissions so SageMaker can
-- perform these tasks. The policy must allow the 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 SageMaker Roles>.
--
-- To be able to pass this role to 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'
      { $sel:acceleratorTypes:CreateNotebookInstance' :: Maybe [NotebookInstanceAcceleratorType]
acceleratorTypes =
          forall a. Maybe a
Prelude.Nothing,
        $sel:additionalCodeRepositories:CreateNotebookInstance' :: Maybe [Text]
additionalCodeRepositories = forall a. Maybe a
Prelude.Nothing,
        $sel:defaultCodeRepository:CreateNotebookInstance' :: Maybe Text
defaultCodeRepository = forall a. Maybe a
Prelude.Nothing,
        $sel:directInternetAccess:CreateNotebookInstance' :: Maybe DirectInternetAccess
directInternetAccess = forall a. Maybe a
Prelude.Nothing,
        $sel:instanceMetadataServiceConfiguration:CreateNotebookInstance' :: Maybe InstanceMetadataServiceConfiguration
instanceMetadataServiceConfiguration =
          forall a. Maybe a
Prelude.Nothing,
        $sel:kmsKeyId:CreateNotebookInstance' :: Maybe Text
kmsKeyId = forall a. Maybe a
Prelude.Nothing,
        $sel:lifecycleConfigName:CreateNotebookInstance' :: Maybe Text
lifecycleConfigName = forall a. Maybe a
Prelude.Nothing,
        $sel:platformIdentifier:CreateNotebookInstance' :: Maybe Text
platformIdentifier = forall a. Maybe a
Prelude.Nothing,
        $sel:rootAccess:CreateNotebookInstance' :: Maybe RootAccess
rootAccess = forall a. Maybe a
Prelude.Nothing,
        $sel:securityGroupIds:CreateNotebookInstance' :: Maybe [Text]
securityGroupIds = forall a. Maybe a
Prelude.Nothing,
        $sel:subnetId:CreateNotebookInstance' :: Maybe Text
subnetId = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateNotebookInstance' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:volumeSizeInGB:CreateNotebookInstance' :: Maybe Natural
volumeSizeInGB = 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 :: Lens'
  CreateNotebookInstance (Maybe [NotebookInstanceAcceleratorType])
createNotebookInstance_acceleratorTypes = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An array of 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 SageMaker Notebook Instances>.
createNotebookInstance_additionalCodeRepositories :: Lens.Lens' CreateNotebookInstance (Prelude.Maybe [Prelude.Text])
createNotebookInstance_additionalCodeRepositories :: Lens' CreateNotebookInstance (Maybe [Text])
createNotebookInstance_additionalCodeRepositories = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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 SageMaker Notebook Instances>.
createNotebookInstance_defaultCodeRepository :: Lens.Lens' CreateNotebookInstance (Prelude.Maybe Prelude.Text)
createNotebookInstance_defaultCodeRepository :: Lens' CreateNotebookInstance (Maybe Text)
createNotebookInstance_defaultCodeRepository = 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)

-- | Sets whether 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
-- 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 :: Lens' CreateNotebookInstance (Maybe DirectInternetAccess)
createNotebookInstance_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)

-- | Information on the IMDS configuration of the notebook instance
createNotebookInstance_instanceMetadataServiceConfiguration :: Lens.Lens' CreateNotebookInstance (Prelude.Maybe InstanceMetadataServiceConfiguration)
createNotebookInstance_instanceMetadataServiceConfiguration :: Lens'
  CreateNotebookInstance (Maybe InstanceMetadataServiceConfiguration)
createNotebookInstance_instanceMetadataServiceConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNotebookInstance' {Maybe InstanceMetadataServiceConfiguration
instanceMetadataServiceConfiguration :: Maybe InstanceMetadataServiceConfiguration
$sel:instanceMetadataServiceConfiguration:CreateNotebookInstance' :: CreateNotebookInstance
-> Maybe InstanceMetadataServiceConfiguration
instanceMetadataServiceConfiguration} -> Maybe InstanceMetadataServiceConfiguration
instanceMetadataServiceConfiguration) (\s :: CreateNotebookInstance
s@CreateNotebookInstance' {} Maybe InstanceMetadataServiceConfiguration
a -> CreateNotebookInstance
s {$sel:instanceMetadataServiceConfiguration:CreateNotebookInstance' :: Maybe InstanceMetadataServiceConfiguration
instanceMetadataServiceConfiguration = Maybe InstanceMetadataServiceConfiguration
a} :: CreateNotebookInstance)

-- | The Amazon Resource Name (ARN) of a Amazon Web Services Key Management
-- Service key that 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 :: Lens' CreateNotebookInstance (Maybe Text)
createNotebookInstance_kmsKeyId = 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)

-- | 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 :: Lens' CreateNotebookInstance (Maybe Text)
createNotebookInstance_lifecycleConfigName = 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 platform identifier of the notebook instance runtime environment.
createNotebookInstance_platformIdentifier :: Lens.Lens' CreateNotebookInstance (Prelude.Maybe Prelude.Text)
createNotebookInstance_platformIdentifier :: Lens' CreateNotebookInstance (Maybe Text)
createNotebookInstance_platformIdentifier = 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)

-- | 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 :: Lens' CreateNotebookInstance (Maybe RootAccess)
createNotebookInstance_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)

-- | 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 :: Lens' CreateNotebookInstance (Maybe [Text])
createNotebookInstance_securityGroupIds = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The 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 :: Lens' CreateNotebookInstance (Maybe Text)
createNotebookInstance_subnetId = 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)

-- | 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 :: Lens' CreateNotebookInstance (Maybe [Tag])
createNotebookInstance_tags = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The 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 :: Lens' CreateNotebookInstance (Maybe Natural)
createNotebookInstance_volumeSizeInGB = 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 name of the new notebook instance.
createNotebookInstance_notebookInstanceName :: Lens.Lens' CreateNotebookInstance Prelude.Text
createNotebookInstance_notebookInstanceName :: Lens' CreateNotebookInstance Text
createNotebookInstance_notebookInstanceName = 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 :: Lens' CreateNotebookInstance InstanceType
createNotebookInstance_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, SageMaker assumes this role to perform tasks on your
-- behalf. You must grant this role necessary permissions so SageMaker can
-- perform these tasks. The policy must allow the 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 SageMaker Roles>.
--
-- To be able to pass this role to SageMaker, the caller of this API must
-- have the @iam:PassRole@ permission.
createNotebookInstance_roleArn :: Lens.Lens' CreateNotebookInstance Prelude.Text
createNotebookInstance_roleArn :: Lens' CreateNotebookInstance Text
createNotebookInstance_roleArn = 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 :: (Service -> Service)
-> CreateNotebookInstance -> Request CreateNotebookInstance
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateNotebookInstance
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateNotebookInstance)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Int -> CreateNotebookInstanceResponse
CreateNotebookInstanceResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NotebookInstanceArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateNotebookInstance where
  hashWithSalt :: Int -> CreateNotebookInstance -> Int
hashWithSalt Int
_salt CreateNotebookInstance' {Maybe Natural
Maybe [Text]
Maybe [NotebookInstanceAcceleratorType]
Maybe [Tag]
Maybe Text
Maybe DirectInternetAccess
Maybe InstanceMetadataServiceConfiguration
Maybe RootAccess
Text
InstanceType
roleArn :: Text
instanceType :: InstanceType
notebookInstanceName :: Text
volumeSizeInGB :: Maybe Natural
tags :: Maybe [Tag]
subnetId :: Maybe Text
securityGroupIds :: Maybe [Text]
rootAccess :: Maybe RootAccess
platformIdentifier :: Maybe Text
lifecycleConfigName :: Maybe Text
kmsKeyId :: Maybe Text
instanceMetadataServiceConfiguration :: Maybe InstanceMetadataServiceConfiguration
directInternetAccess :: Maybe DirectInternetAccess
defaultCodeRepository :: Maybe Text
additionalCodeRepositories :: Maybe [Text]
acceleratorTypes :: Maybe [NotebookInstanceAcceleratorType]
$sel:roleArn:CreateNotebookInstance' :: CreateNotebookInstance -> Text
$sel:instanceType:CreateNotebookInstance' :: CreateNotebookInstance -> InstanceType
$sel:notebookInstanceName:CreateNotebookInstance' :: CreateNotebookInstance -> Text
$sel:volumeSizeInGB:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe Natural
$sel:tags:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe [Tag]
$sel:subnetId:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe Text
$sel:securityGroupIds:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe [Text]
$sel:rootAccess:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe RootAccess
$sel:platformIdentifier:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe Text
$sel:lifecycleConfigName:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe Text
$sel:kmsKeyId:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe Text
$sel:instanceMetadataServiceConfiguration:CreateNotebookInstance' :: CreateNotebookInstance
-> Maybe InstanceMetadataServiceConfiguration
$sel:directInternetAccess:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe DirectInternetAccess
$sel:defaultCodeRepository:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe Text
$sel:additionalCodeRepositories:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe [Text]
$sel:acceleratorTypes:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe [NotebookInstanceAcceleratorType]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [NotebookInstanceAcceleratorType]
acceleratorTypes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
additionalCodeRepositories
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
defaultCodeRepository
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DirectInternetAccess
directInternetAccess
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe InstanceMetadataServiceConfiguration
instanceMetadataServiceConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
kmsKeyId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
lifecycleConfigName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
platformIdentifier
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RootAccess
rootAccess
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
securityGroupIds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
subnetId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
volumeSizeInGB
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
notebookInstanceName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` InstanceType
instanceType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
roleArn

instance Prelude.NFData CreateNotebookInstance where
  rnf :: CreateNotebookInstance -> ()
rnf CreateNotebookInstance' {Maybe Natural
Maybe [Text]
Maybe [NotebookInstanceAcceleratorType]
Maybe [Tag]
Maybe Text
Maybe DirectInternetAccess
Maybe InstanceMetadataServiceConfiguration
Maybe RootAccess
Text
InstanceType
roleArn :: Text
instanceType :: InstanceType
notebookInstanceName :: Text
volumeSizeInGB :: Maybe Natural
tags :: Maybe [Tag]
subnetId :: Maybe Text
securityGroupIds :: Maybe [Text]
rootAccess :: Maybe RootAccess
platformIdentifier :: Maybe Text
lifecycleConfigName :: Maybe Text
kmsKeyId :: Maybe Text
instanceMetadataServiceConfiguration :: Maybe InstanceMetadataServiceConfiguration
directInternetAccess :: Maybe DirectInternetAccess
defaultCodeRepository :: Maybe Text
additionalCodeRepositories :: Maybe [Text]
acceleratorTypes :: Maybe [NotebookInstanceAcceleratorType]
$sel:roleArn:CreateNotebookInstance' :: CreateNotebookInstance -> Text
$sel:instanceType:CreateNotebookInstance' :: CreateNotebookInstance -> InstanceType
$sel:notebookInstanceName:CreateNotebookInstance' :: CreateNotebookInstance -> Text
$sel:volumeSizeInGB:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe Natural
$sel:tags:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe [Tag]
$sel:subnetId:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe Text
$sel:securityGroupIds:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe [Text]
$sel:rootAccess:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe RootAccess
$sel:platformIdentifier:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe Text
$sel:lifecycleConfigName:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe Text
$sel:kmsKeyId:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe Text
$sel:instanceMetadataServiceConfiguration:CreateNotebookInstance' :: CreateNotebookInstance
-> Maybe InstanceMetadataServiceConfiguration
$sel:directInternetAccess:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe DirectInternetAccess
$sel:defaultCodeRepository:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe Text
$sel:additionalCodeRepositories:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe [Text]
$sel:acceleratorTypes:CreateNotebookInstance' :: CreateNotebookInstance -> Maybe [NotebookInstanceAcceleratorType]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [NotebookInstanceAcceleratorType]
acceleratorTypes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
additionalCodeRepositories
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
defaultCodeRepository
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DirectInternetAccess
directInternetAccess
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe InstanceMetadataServiceConfiguration
instanceMetadataServiceConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
kmsKeyId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
lifecycleConfigName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
platformIdentifier
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RootAccess
rootAccess
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
securityGroupIds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
subnetId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
volumeSizeInGB
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
notebookInstanceName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf InstanceType
instanceType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
roleArn

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

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

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

instance Data.ToQuery CreateNotebookInstance where
  toQuery :: CreateNotebookInstance -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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.
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'
    { $sel:notebookInstanceArn:CreateNotebookInstanceResponse' :: Maybe Text
notebookInstanceArn =
        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 :: Lens' CreateNotebookInstanceResponse (Maybe Text)
createNotebookInstanceResponse_notebookInstanceArn = 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 :: Lens' CreateNotebookInstanceResponse Int
createNotebookInstanceResponse_httpStatus = 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
  where
  rnf :: CreateNotebookInstanceResponse -> ()
rnf CreateNotebookInstanceResponse' {Int
Maybe Text
httpStatus :: Int
notebookInstanceArn :: Maybe Text
$sel:httpStatus:CreateNotebookInstanceResponse' :: CreateNotebookInstanceResponse -> Int
$sel:notebookInstanceArn:CreateNotebookInstanceResponse' :: CreateNotebookInstanceResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
notebookInstanceArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus