{-# 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.OpsWorksCM.CreateServer
-- 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 and immedately starts a new server. The server is ready to use
-- when it is in the @HEALTHY@ state. By default, you can create a maximum
-- of 10 servers.
--
-- This operation is asynchronous.
--
-- A @LimitExceededException@ is thrown when you have created the maximum
-- number of servers (10). A @ResourceAlreadyExistsException@ is thrown
-- when a server with the same name already exists in the account. A
-- @ResourceNotFoundException@ is thrown when you specify a backup ID that
-- is not valid or is for a backup that does not exist. A
-- @ValidationException@ is thrown when parameters of the request are not
-- valid.
--
-- If you do not specify a security group by adding the @SecurityGroupIds@
-- parameter, AWS OpsWorks creates a new security group.
--
-- /Chef Automate:/ The default security group opens the Chef server to the
-- world on TCP port 443. If a KeyName is present, AWS OpsWorks enables SSH
-- access. SSH is also open to the world on TCP port 22.
--
-- /Puppet Enterprise:/ The default security group opens TCP ports 22, 443,
-- 4433, 8140, 8142, 8143, and 8170. If a KeyName is present, AWS OpsWorks
-- enables SSH access. SSH is also open to the world on TCP port 22.
--
-- By default, your server is accessible from any IP address. We recommend
-- that you update your security group rules to allow access from known IP
-- addresses and address ranges only. To edit security group rules, open
-- Security Groups in the navigation pane of the EC2 management console.
--
-- To specify your own domain for a server, and provide your own
-- self-signed or CA-signed certificate and private key, specify values for
-- @CustomDomain@, @CustomCertificate@, and @CustomPrivateKey@.
module Amazonka.OpsWorksCM.CreateServer
  ( -- * Creating a Request
    CreateServer (..),
    newCreateServer,

    -- * Request Lenses
    createServer_engineVersion,
    createServer_disableAutomatedBackup,
    createServer_securityGroupIds,
    createServer_associatePublicIpAddress,
    createServer_subnetIds,
    createServer_keyPair,
    createServer_backupId,
    createServer_customDomain,
    createServer_customPrivateKey,
    createServer_engineModel,
    createServer_engineAttributes,
    createServer_preferredMaintenanceWindow,
    createServer_preferredBackupWindow,
    createServer_customCertificate,
    createServer_tags,
    createServer_backupRetentionCount,
    createServer_engine,
    createServer_serverName,
    createServer_instanceProfileArn,
    createServer_instanceType,
    createServer_serviceRoleArn,

    -- * Destructuring the Response
    CreateServerResponse (..),
    newCreateServerResponse,

    -- * Response Lenses
    createServerResponse_server,
    createServerResponse_httpStatus,
  )
where

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

-- | /See:/ 'newCreateServer' smart constructor.
data CreateServer = CreateServer'
  { -- | The major release version of the engine that you want to use. For a Chef
    -- server, the valid value for EngineVersion is currently @2@. For a Puppet
    -- server, valid values are @2019@ or @2017@.
    CreateServer -> Maybe Text
engineVersion :: Prelude.Maybe Prelude.Text,
    -- | Enable or disable scheduled backups. Valid values are @true@ or @false@.
    -- The default value is @true@.
    CreateServer -> Maybe Bool
disableAutomatedBackup :: Prelude.Maybe Prelude.Bool,
    -- | A list of security group IDs to attach to the Amazon EC2 instance. If
    -- you add this parameter, the specified security groups must be within the
    -- VPC that is specified by @SubnetIds@.
    --
    -- If you do not specify this parameter, AWS OpsWorks CM creates one new
    -- security group that uses TCP ports 22 and 443, open to 0.0.0.0\/0
    -- (everyone).
    CreateServer -> Maybe [Text]
securityGroupIds :: Prelude.Maybe [Prelude.Text],
    -- | Associate a public IP address with a server that you are launching.
    -- Valid values are @true@ or @false@. The default value is @true@.
    CreateServer -> Maybe Bool
associatePublicIpAddress :: Prelude.Maybe Prelude.Bool,
    -- | The IDs of subnets in which to launch the server EC2 instance.
    --
    -- Amazon EC2-Classic customers: This field is required. All servers must
    -- run within a VPC. The VPC must have \"Auto Assign Public IP\" enabled.
    --
    -- EC2-VPC customers: This field is optional. If you do not specify subnet
    -- IDs, your EC2 instances are created in a default subnet that is selected
    -- by Amazon EC2. If you specify subnet IDs, the VPC must have \"Auto
    -- Assign Public IP\" enabled.
    --
    -- For more information about supported Amazon EC2 platforms, see
    -- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-supported-platforms.html Supported Platforms>.
    CreateServer -> Maybe [Text]
subnetIds :: Prelude.Maybe [Prelude.Text],
    -- | The Amazon EC2 key pair to set for the instance. This parameter is
    -- optional; if desired, you may specify this parameter to connect to your
    -- instances by using SSH.
    CreateServer -> Maybe Text
keyPair :: Prelude.Maybe Prelude.Text,
    -- | If you specify this field, AWS OpsWorks CM creates the server by using
    -- the backup represented by BackupId.
    CreateServer -> Maybe Text
backupId :: Prelude.Maybe Prelude.Text,
    -- | An optional public endpoint of a server, such as
    -- @https:\/\/aws.my-company.com@. To access the server, create a CNAME DNS
    -- record in your preferred DNS service that points the custom domain to
    -- the endpoint that is generated when the server is created (the value of
    -- the CreateServer Endpoint attribute). You cannot access the server by
    -- using the generated @Endpoint@ value if the server is using a custom
    -- domain. If you specify a custom domain, you must also specify values for
    -- @CustomCertificate@ and @CustomPrivateKey@.
    CreateServer -> Maybe Text
customDomain :: Prelude.Maybe Prelude.Text,
    -- | A private key in PEM format for connecting to the server by using HTTPS.
    -- The private key must not be encrypted; it cannot be protected by a
    -- password or passphrase. If you specify a custom private key, you must
    -- also specify values for @CustomDomain@ and @CustomCertificate@.
    CreateServer -> Maybe (Sensitive Text)
customPrivateKey :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The engine model of the server. Valid values in this release include
    -- @Monolithic@ for Puppet and @Single@ for Chef.
    CreateServer -> Maybe Text
engineModel :: Prelude.Maybe Prelude.Text,
    -- | Optional engine attributes on a specified server.
    --
    -- __Attributes accepted in a Chef createServer request:__
    --
    -- -   @CHEF_AUTOMATE_PIVOTAL_KEY@: A base64-encoded RSA public key. The
    --     corresponding private key is required to access the Chef API. When
    --     no CHEF_AUTOMATE_PIVOTAL_KEY is set, a private key is generated and
    --     returned in the response.
    --
    -- -   @CHEF_AUTOMATE_ADMIN_PASSWORD@: The password for the administrative
    --     user in the Chef Automate web-based dashboard. The password length
    --     is a minimum of eight characters, and a maximum of 32. The password
    --     can contain letters, numbers, and special characters
    --     (!\/\@#$%^&+=_). The password must contain at least one lower case
    --     letter, one upper case letter, one number, and one special
    --     character. When no CHEF_AUTOMATE_ADMIN_PASSWORD is set, one is
    --     generated and returned in the response.
    --
    -- __Attributes accepted in a Puppet createServer request:__
    --
    -- -   @PUPPET_ADMIN_PASSWORD@: To work with the Puppet Enterprise console,
    --     a password must use ASCII characters.
    --
    -- -   @PUPPET_R10K_REMOTE@: The r10k remote is the URL of your control
    --     repository (for example,
    --     ssh:\/\/git\@your.git-repo.com:user\/control-repo.git). Specifying
    --     an r10k remote opens TCP port 8170.
    --
    -- -   @PUPPET_R10K_PRIVATE_KEY@: If you are using a private Git
    --     repository, add PUPPET_R10K_PRIVATE_KEY to specify a PEM-encoded
    --     private SSH key.
    CreateServer -> Maybe [EngineAttribute]
engineAttributes :: Prelude.Maybe [EngineAttribute],
    -- | The start time for a one-hour period each week during which AWS OpsWorks
    -- CM performs maintenance on the instance. Valid values must be specified
    -- in the following format: @DDD:HH:MM@. @MM@ must be specified as @00@.
    -- The specified time is in coordinated universal time (UTC). The default
    -- value is a random one-hour period on Tuesday, Wednesday, or Friday. See
    -- @TimeWindowDefinition@ for more information.
    --
    -- __Example:__ @Mon:08:00@, which represents a start time of every Monday
    -- at 08:00 UTC. (8:00 a.m.)
    CreateServer -> Maybe Text
preferredMaintenanceWindow :: Prelude.Maybe Prelude.Text,
    -- | The start time for a one-hour period during which AWS OpsWorks CM backs
    -- up application-level data on your server if automated backups are
    -- enabled. Valid values must be specified in one of the following formats:
    --
    -- -   @HH:MM@ for daily backups
    --
    -- -   @DDD:HH:MM@ for weekly backups
    --
    -- @MM@ must be specified as @00@. The specified time is in coordinated
    -- universal time (UTC). The default value is a random, daily start time.
    --
    -- __Example:__ @08:00@, which represents a daily start time of 08:00 UTC.
    --
    -- __Example:__ @Mon:08:00@, which represents a start time of every Monday
    -- at 08:00 UTC. (8:00 a.m.)
    CreateServer -> Maybe Text
preferredBackupWindow :: Prelude.Maybe Prelude.Text,
    -- | A PEM-formatted HTTPS certificate. The value can be be a single,
    -- self-signed certificate, or a certificate chain. If you specify a custom
    -- certificate, you must also specify values for @CustomDomain@ and
    -- @CustomPrivateKey@. The following are requirements for the
    -- @CustomCertificate@ value:
    --
    -- -   You can provide either a self-signed, custom certificate, or the
    --     full certificate chain.
    --
    -- -   The certificate must be a valid X509 certificate, or a certificate
    --     chain in PEM format.
    --
    -- -   The certificate must be valid at the time of upload. A certificate
    --     can\'t be used before its validity period begins (the certificate\'s
    --     @NotBefore@ date), or after it expires (the certificate\'s
    --     @NotAfter@ date).
    --
    -- -   The certificate’s common name or subject alternative names (SANs),
    --     if present, must match the value of @CustomDomain@.
    --
    -- -   The certificate must match the value of @CustomPrivateKey@.
    CreateServer -> Maybe Text
customCertificate :: Prelude.Maybe Prelude.Text,
    -- | A map that contains tag keys and tag values to attach to an AWS OpsWorks
    -- for Chef Automate or AWS OpsWorks for Puppet Enterprise server.
    --
    -- -   The key cannot be empty.
    --
    -- -   The key can be a maximum of 127 characters, and can contain only
    --     Unicode letters, numbers, or separators, or the following special
    --     characters: @+ - = . _ : \/ \@@
    --
    -- -   The value can be a maximum 255 characters, and contain only Unicode
    --     letters, numbers, or separators, or the following special
    --     characters: @+ - = . _ : \/ \@@
    --
    -- -   Leading and trailing white spaces are trimmed from both the key and
    --     value.
    --
    -- -   A maximum of 50 user-applied tags is allowed for any AWS OpsWorks-CM
    --     server.
    CreateServer -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The number of automated backups that you want to keep. Whenever a new
    -- backup is created, AWS OpsWorks CM deletes the oldest backups if this
    -- number is exceeded. The default value is @1@.
    CreateServer -> Maybe Natural
backupRetentionCount :: Prelude.Maybe Prelude.Natural,
    -- | The configuration management engine to use. Valid values include
    -- @ChefAutomate@ and @Puppet@.
    CreateServer -> Text
engine :: Prelude.Text,
    -- | The name of the server. The server name must be unique within your AWS
    -- account, within each region. Server names must start with a letter; then
    -- letters, numbers, or hyphens (-) are allowed, up to a maximum of 40
    -- characters.
    CreateServer -> Text
serverName :: Prelude.Text,
    -- | The ARN of the instance profile that your Amazon EC2 instances use.
    -- Although the AWS OpsWorks console typically creates the instance profile
    -- for you, if you are using API commands instead, run the
    -- service-role-creation.yaml AWS CloudFormation template, located at
    -- https:\/\/s3.amazonaws.com\/opsworks-cm-us-east-1-prod-default-assets\/misc\/opsworks-cm-roles.yaml.
    -- This template creates a CloudFormation stack that includes the instance
    -- profile you need.
    CreateServer -> Text
instanceProfileArn :: Prelude.Text,
    -- | The Amazon EC2 instance type to use. For example, @m5.large@.
    CreateServer -> Text
instanceType :: Prelude.Text,
    -- | The service role that the AWS OpsWorks CM service backend uses to work
    -- with your account. Although the AWS OpsWorks management console
    -- typically creates the service role for you, if you are using the AWS CLI
    -- or API commands, run the service-role-creation.yaml AWS CloudFormation
    -- template, located at
    -- https:\/\/s3.amazonaws.com\/opsworks-cm-us-east-1-prod-default-assets\/misc\/opsworks-cm-roles.yaml.
    -- This template creates a CloudFormation stack that includes the service
    -- role and instance profile that you need.
    CreateServer -> Text
serviceRoleArn :: Prelude.Text
  }
  deriving (CreateServer -> CreateServer -> Bool
(CreateServer -> CreateServer -> Bool)
-> (CreateServer -> CreateServer -> Bool) -> Eq CreateServer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateServer -> CreateServer -> Bool
$c/= :: CreateServer -> CreateServer -> Bool
== :: CreateServer -> CreateServer -> Bool
$c== :: CreateServer -> CreateServer -> Bool
Prelude.Eq, Int -> CreateServer -> ShowS
[CreateServer] -> ShowS
CreateServer -> String
(Int -> CreateServer -> ShowS)
-> (CreateServer -> String)
-> ([CreateServer] -> ShowS)
-> Show CreateServer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateServer] -> ShowS
$cshowList :: [CreateServer] -> ShowS
show :: CreateServer -> String
$cshow :: CreateServer -> String
showsPrec :: Int -> CreateServer -> ShowS
$cshowsPrec :: Int -> CreateServer -> ShowS
Prelude.Show, (forall x. CreateServer -> Rep CreateServer x)
-> (forall x. Rep CreateServer x -> CreateServer)
-> Generic CreateServer
forall x. Rep CreateServer x -> CreateServer
forall x. CreateServer -> Rep CreateServer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateServer x -> CreateServer
$cfrom :: forall x. CreateServer -> Rep CreateServer x
Prelude.Generic)

-- |
-- Create a value of 'CreateServer' 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:
--
-- 'engineVersion', 'createServer_engineVersion' - The major release version of the engine that you want to use. For a Chef
-- server, the valid value for EngineVersion is currently @2@. For a Puppet
-- server, valid values are @2019@ or @2017@.
--
-- 'disableAutomatedBackup', 'createServer_disableAutomatedBackup' - Enable or disable scheduled backups. Valid values are @true@ or @false@.
-- The default value is @true@.
--
-- 'securityGroupIds', 'createServer_securityGroupIds' - A list of security group IDs to attach to the Amazon EC2 instance. If
-- you add this parameter, the specified security groups must be within the
-- VPC that is specified by @SubnetIds@.
--
-- If you do not specify this parameter, AWS OpsWorks CM creates one new
-- security group that uses TCP ports 22 and 443, open to 0.0.0.0\/0
-- (everyone).
--
-- 'associatePublicIpAddress', 'createServer_associatePublicIpAddress' - Associate a public IP address with a server that you are launching.
-- Valid values are @true@ or @false@. The default value is @true@.
--
-- 'subnetIds', 'createServer_subnetIds' - The IDs of subnets in which to launch the server EC2 instance.
--
-- Amazon EC2-Classic customers: This field is required. All servers must
-- run within a VPC. The VPC must have \"Auto Assign Public IP\" enabled.
--
-- EC2-VPC customers: This field is optional. If you do not specify subnet
-- IDs, your EC2 instances are created in a default subnet that is selected
-- by Amazon EC2. If you specify subnet IDs, the VPC must have \"Auto
-- Assign Public IP\" enabled.
--
-- For more information about supported Amazon EC2 platforms, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-supported-platforms.html Supported Platforms>.
--
-- 'keyPair', 'createServer_keyPair' - The Amazon EC2 key pair to set for the instance. This parameter is
-- optional; if desired, you may specify this parameter to connect to your
-- instances by using SSH.
--
-- 'backupId', 'createServer_backupId' - If you specify this field, AWS OpsWorks CM creates the server by using
-- the backup represented by BackupId.
--
-- 'customDomain', 'createServer_customDomain' - An optional public endpoint of a server, such as
-- @https:\/\/aws.my-company.com@. To access the server, create a CNAME DNS
-- record in your preferred DNS service that points the custom domain to
-- the endpoint that is generated when the server is created (the value of
-- the CreateServer Endpoint attribute). You cannot access the server by
-- using the generated @Endpoint@ value if the server is using a custom
-- domain. If you specify a custom domain, you must also specify values for
-- @CustomCertificate@ and @CustomPrivateKey@.
--
-- 'customPrivateKey', 'createServer_customPrivateKey' - A private key in PEM format for connecting to the server by using HTTPS.
-- The private key must not be encrypted; it cannot be protected by a
-- password or passphrase. If you specify a custom private key, you must
-- also specify values for @CustomDomain@ and @CustomCertificate@.
--
-- 'engineModel', 'createServer_engineModel' - The engine model of the server. Valid values in this release include
-- @Monolithic@ for Puppet and @Single@ for Chef.
--
-- 'engineAttributes', 'createServer_engineAttributes' - Optional engine attributes on a specified server.
--
-- __Attributes accepted in a Chef createServer request:__
--
-- -   @CHEF_AUTOMATE_PIVOTAL_KEY@: A base64-encoded RSA public key. The
--     corresponding private key is required to access the Chef API. When
--     no CHEF_AUTOMATE_PIVOTAL_KEY is set, a private key is generated and
--     returned in the response.
--
-- -   @CHEF_AUTOMATE_ADMIN_PASSWORD@: The password for the administrative
--     user in the Chef Automate web-based dashboard. The password length
--     is a minimum of eight characters, and a maximum of 32. The password
--     can contain letters, numbers, and special characters
--     (!\/\@#$%^&+=_). The password must contain at least one lower case
--     letter, one upper case letter, one number, and one special
--     character. When no CHEF_AUTOMATE_ADMIN_PASSWORD is set, one is
--     generated and returned in the response.
--
-- __Attributes accepted in a Puppet createServer request:__
--
-- -   @PUPPET_ADMIN_PASSWORD@: To work with the Puppet Enterprise console,
--     a password must use ASCII characters.
--
-- -   @PUPPET_R10K_REMOTE@: The r10k remote is the URL of your control
--     repository (for example,
--     ssh:\/\/git\@your.git-repo.com:user\/control-repo.git). Specifying
--     an r10k remote opens TCP port 8170.
--
-- -   @PUPPET_R10K_PRIVATE_KEY@: If you are using a private Git
--     repository, add PUPPET_R10K_PRIVATE_KEY to specify a PEM-encoded
--     private SSH key.
--
-- 'preferredMaintenanceWindow', 'createServer_preferredMaintenanceWindow' - The start time for a one-hour period each week during which AWS OpsWorks
-- CM performs maintenance on the instance. Valid values must be specified
-- in the following format: @DDD:HH:MM@. @MM@ must be specified as @00@.
-- The specified time is in coordinated universal time (UTC). The default
-- value is a random one-hour period on Tuesday, Wednesday, or Friday. See
-- @TimeWindowDefinition@ for more information.
--
-- __Example:__ @Mon:08:00@, which represents a start time of every Monday
-- at 08:00 UTC. (8:00 a.m.)
--
-- 'preferredBackupWindow', 'createServer_preferredBackupWindow' - The start time for a one-hour period during which AWS OpsWorks CM backs
-- up application-level data on your server if automated backups are
-- enabled. Valid values must be specified in one of the following formats:
--
-- -   @HH:MM@ for daily backups
--
-- -   @DDD:HH:MM@ for weekly backups
--
-- @MM@ must be specified as @00@. The specified time is in coordinated
-- universal time (UTC). The default value is a random, daily start time.
--
-- __Example:__ @08:00@, which represents a daily start time of 08:00 UTC.
--
-- __Example:__ @Mon:08:00@, which represents a start time of every Monday
-- at 08:00 UTC. (8:00 a.m.)
--
-- 'customCertificate', 'createServer_customCertificate' - A PEM-formatted HTTPS certificate. The value can be be a single,
-- self-signed certificate, or a certificate chain. If you specify a custom
-- certificate, you must also specify values for @CustomDomain@ and
-- @CustomPrivateKey@. The following are requirements for the
-- @CustomCertificate@ value:
--
-- -   You can provide either a self-signed, custom certificate, or the
--     full certificate chain.
--
-- -   The certificate must be a valid X509 certificate, or a certificate
--     chain in PEM format.
--
-- -   The certificate must be valid at the time of upload. A certificate
--     can\'t be used before its validity period begins (the certificate\'s
--     @NotBefore@ date), or after it expires (the certificate\'s
--     @NotAfter@ date).
--
-- -   The certificate’s common name or subject alternative names (SANs),
--     if present, must match the value of @CustomDomain@.
--
-- -   The certificate must match the value of @CustomPrivateKey@.
--
-- 'tags', 'createServer_tags' - A map that contains tag keys and tag values to attach to an AWS OpsWorks
-- for Chef Automate or AWS OpsWorks for Puppet Enterprise server.
--
-- -   The key cannot be empty.
--
-- -   The key can be a maximum of 127 characters, and can contain only
--     Unicode letters, numbers, or separators, or the following special
--     characters: @+ - = . _ : \/ \@@
--
-- -   The value can be a maximum 255 characters, and contain only Unicode
--     letters, numbers, or separators, or the following special
--     characters: @+ - = . _ : \/ \@@
--
-- -   Leading and trailing white spaces are trimmed from both the key and
--     value.
--
-- -   A maximum of 50 user-applied tags is allowed for any AWS OpsWorks-CM
--     server.
--
-- 'backupRetentionCount', 'createServer_backupRetentionCount' - The number of automated backups that you want to keep. Whenever a new
-- backup is created, AWS OpsWorks CM deletes the oldest backups if this
-- number is exceeded. The default value is @1@.
--
-- 'engine', 'createServer_engine' - The configuration management engine to use. Valid values include
-- @ChefAutomate@ and @Puppet@.
--
-- 'serverName', 'createServer_serverName' - The name of the server. The server name must be unique within your AWS
-- account, within each region. Server names must start with a letter; then
-- letters, numbers, or hyphens (-) are allowed, up to a maximum of 40
-- characters.
--
-- 'instanceProfileArn', 'createServer_instanceProfileArn' - The ARN of the instance profile that your Amazon EC2 instances use.
-- Although the AWS OpsWorks console typically creates the instance profile
-- for you, if you are using API commands instead, run the
-- service-role-creation.yaml AWS CloudFormation template, located at
-- https:\/\/s3.amazonaws.com\/opsworks-cm-us-east-1-prod-default-assets\/misc\/opsworks-cm-roles.yaml.
-- This template creates a CloudFormation stack that includes the instance
-- profile you need.
--
-- 'instanceType', 'createServer_instanceType' - The Amazon EC2 instance type to use. For example, @m5.large@.
--
-- 'serviceRoleArn', 'createServer_serviceRoleArn' - The service role that the AWS OpsWorks CM service backend uses to work
-- with your account. Although the AWS OpsWorks management console
-- typically creates the service role for you, if you are using the AWS CLI
-- or API commands, run the service-role-creation.yaml AWS CloudFormation
-- template, located at
-- https:\/\/s3.amazonaws.com\/opsworks-cm-us-east-1-prod-default-assets\/misc\/opsworks-cm-roles.yaml.
-- This template creates a CloudFormation stack that includes the service
-- role and instance profile that you need.
newCreateServer ::
  -- | 'engine'
  Prelude.Text ->
  -- | 'serverName'
  Prelude.Text ->
  -- | 'instanceProfileArn'
  Prelude.Text ->
  -- | 'instanceType'
  Prelude.Text ->
  -- | 'serviceRoleArn'
  Prelude.Text ->
  CreateServer
newCreateServer :: Text -> Text -> Text -> Text -> Text -> CreateServer
newCreateServer
  Text
pEngine_
  Text
pServerName_
  Text
pInstanceProfileArn_
  Text
pInstanceType_
  Text
pServiceRoleArn_ =
    CreateServer' :: Maybe Text
-> Maybe Bool
-> Maybe [Text]
-> Maybe Bool
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe [EngineAttribute]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Maybe Natural
-> Text
-> Text
-> Text
-> Text
-> Text
-> CreateServer
CreateServer'
      { $sel:engineVersion:CreateServer' :: Maybe Text
engineVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:disableAutomatedBackup:CreateServer' :: Maybe Bool
disableAutomatedBackup = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:securityGroupIds:CreateServer' :: Maybe [Text]
securityGroupIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:associatePublicIpAddress:CreateServer' :: Maybe Bool
associatePublicIpAddress = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:subnetIds:CreateServer' :: Maybe [Text]
subnetIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:keyPair:CreateServer' :: Maybe Text
keyPair = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:backupId:CreateServer' :: Maybe Text
backupId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:customDomain:CreateServer' :: Maybe Text
customDomain = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:customPrivateKey:CreateServer' :: Maybe (Sensitive Text)
customPrivateKey = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:engineModel:CreateServer' :: Maybe Text
engineModel = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:engineAttributes:CreateServer' :: Maybe [EngineAttribute]
engineAttributes = Maybe [EngineAttribute]
forall a. Maybe a
Prelude.Nothing,
        $sel:preferredMaintenanceWindow:CreateServer' :: Maybe Text
preferredMaintenanceWindow = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:preferredBackupWindow:CreateServer' :: Maybe Text
preferredBackupWindow = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:customCertificate:CreateServer' :: Maybe Text
customCertificate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateServer' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:backupRetentionCount:CreateServer' :: Maybe Natural
backupRetentionCount = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:engine:CreateServer' :: Text
engine = Text
pEngine_,
        $sel:serverName:CreateServer' :: Text
serverName = Text
pServerName_,
        $sel:instanceProfileArn:CreateServer' :: Text
instanceProfileArn = Text
pInstanceProfileArn_,
        $sel:instanceType:CreateServer' :: Text
instanceType = Text
pInstanceType_,
        $sel:serviceRoleArn:CreateServer' :: Text
serviceRoleArn = Text
pServiceRoleArn_
      }

-- | The major release version of the engine that you want to use. For a Chef
-- server, the valid value for EngineVersion is currently @2@. For a Puppet
-- server, valid values are @2019@ or @2017@.
createServer_engineVersion :: Lens.Lens' CreateServer (Prelude.Maybe Prelude.Text)
createServer_engineVersion :: (Maybe Text -> f (Maybe Text)) -> CreateServer -> f CreateServer
createServer_engineVersion = (CreateServer -> Maybe Text)
-> (CreateServer -> Maybe Text -> CreateServer)
-> Lens CreateServer CreateServer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServer' {Maybe Text
engineVersion :: Maybe Text
$sel:engineVersion:CreateServer' :: CreateServer -> Maybe Text
engineVersion} -> Maybe Text
engineVersion) (\s :: CreateServer
s@CreateServer' {} Maybe Text
a -> CreateServer
s {$sel:engineVersion:CreateServer' :: Maybe Text
engineVersion = Maybe Text
a} :: CreateServer)

-- | Enable or disable scheduled backups. Valid values are @true@ or @false@.
-- The default value is @true@.
createServer_disableAutomatedBackup :: Lens.Lens' CreateServer (Prelude.Maybe Prelude.Bool)
createServer_disableAutomatedBackup :: (Maybe Bool -> f (Maybe Bool)) -> CreateServer -> f CreateServer
createServer_disableAutomatedBackup = (CreateServer -> Maybe Bool)
-> (CreateServer -> Maybe Bool -> CreateServer)
-> Lens CreateServer CreateServer (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServer' {Maybe Bool
disableAutomatedBackup :: Maybe Bool
$sel:disableAutomatedBackup:CreateServer' :: CreateServer -> Maybe Bool
disableAutomatedBackup} -> Maybe Bool
disableAutomatedBackup) (\s :: CreateServer
s@CreateServer' {} Maybe Bool
a -> CreateServer
s {$sel:disableAutomatedBackup:CreateServer' :: Maybe Bool
disableAutomatedBackup = Maybe Bool
a} :: CreateServer)

-- | A list of security group IDs to attach to the Amazon EC2 instance. If
-- you add this parameter, the specified security groups must be within the
-- VPC that is specified by @SubnetIds@.
--
-- If you do not specify this parameter, AWS OpsWorks CM creates one new
-- security group that uses TCP ports 22 and 443, open to 0.0.0.0\/0
-- (everyone).
createServer_securityGroupIds :: Lens.Lens' CreateServer (Prelude.Maybe [Prelude.Text])
createServer_securityGroupIds :: (Maybe [Text] -> f (Maybe [Text]))
-> CreateServer -> f CreateServer
createServer_securityGroupIds = (CreateServer -> Maybe [Text])
-> (CreateServer -> Maybe [Text] -> CreateServer)
-> Lens CreateServer CreateServer (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServer' {Maybe [Text]
securityGroupIds :: Maybe [Text]
$sel:securityGroupIds:CreateServer' :: CreateServer -> Maybe [Text]
securityGroupIds} -> Maybe [Text]
securityGroupIds) (\s :: CreateServer
s@CreateServer' {} Maybe [Text]
a -> CreateServer
s {$sel:securityGroupIds:CreateServer' :: Maybe [Text]
securityGroupIds = Maybe [Text]
a} :: CreateServer) ((Maybe [Text] -> f (Maybe [Text]))
 -> CreateServer -> f CreateServer)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateServer
-> f CreateServer
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

-- | Associate a public IP address with a server that you are launching.
-- Valid values are @true@ or @false@. The default value is @true@.
createServer_associatePublicIpAddress :: Lens.Lens' CreateServer (Prelude.Maybe Prelude.Bool)
createServer_associatePublicIpAddress :: (Maybe Bool -> f (Maybe Bool)) -> CreateServer -> f CreateServer
createServer_associatePublicIpAddress = (CreateServer -> Maybe Bool)
-> (CreateServer -> Maybe Bool -> CreateServer)
-> Lens CreateServer CreateServer (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServer' {Maybe Bool
associatePublicIpAddress :: Maybe Bool
$sel:associatePublicIpAddress:CreateServer' :: CreateServer -> Maybe Bool
associatePublicIpAddress} -> Maybe Bool
associatePublicIpAddress) (\s :: CreateServer
s@CreateServer' {} Maybe Bool
a -> CreateServer
s {$sel:associatePublicIpAddress:CreateServer' :: Maybe Bool
associatePublicIpAddress = Maybe Bool
a} :: CreateServer)

-- | The IDs of subnets in which to launch the server EC2 instance.
--
-- Amazon EC2-Classic customers: This field is required. All servers must
-- run within a VPC. The VPC must have \"Auto Assign Public IP\" enabled.
--
-- EC2-VPC customers: This field is optional. If you do not specify subnet
-- IDs, your EC2 instances are created in a default subnet that is selected
-- by Amazon EC2. If you specify subnet IDs, the VPC must have \"Auto
-- Assign Public IP\" enabled.
--
-- For more information about supported Amazon EC2 platforms, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-supported-platforms.html Supported Platforms>.
createServer_subnetIds :: Lens.Lens' CreateServer (Prelude.Maybe [Prelude.Text])
createServer_subnetIds :: (Maybe [Text] -> f (Maybe [Text]))
-> CreateServer -> f CreateServer
createServer_subnetIds = (CreateServer -> Maybe [Text])
-> (CreateServer -> Maybe [Text] -> CreateServer)
-> Lens CreateServer CreateServer (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServer' {Maybe [Text]
subnetIds :: Maybe [Text]
$sel:subnetIds:CreateServer' :: CreateServer -> Maybe [Text]
subnetIds} -> Maybe [Text]
subnetIds) (\s :: CreateServer
s@CreateServer' {} Maybe [Text]
a -> CreateServer
s {$sel:subnetIds:CreateServer' :: Maybe [Text]
subnetIds = Maybe [Text]
a} :: CreateServer) ((Maybe [Text] -> f (Maybe [Text]))
 -> CreateServer -> f CreateServer)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateServer
-> f CreateServer
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 Amazon EC2 key pair to set for the instance. This parameter is
-- optional; if desired, you may specify this parameter to connect to your
-- instances by using SSH.
createServer_keyPair :: Lens.Lens' CreateServer (Prelude.Maybe Prelude.Text)
createServer_keyPair :: (Maybe Text -> f (Maybe Text)) -> CreateServer -> f CreateServer
createServer_keyPair = (CreateServer -> Maybe Text)
-> (CreateServer -> Maybe Text -> CreateServer)
-> Lens CreateServer CreateServer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServer' {Maybe Text
keyPair :: Maybe Text
$sel:keyPair:CreateServer' :: CreateServer -> Maybe Text
keyPair} -> Maybe Text
keyPair) (\s :: CreateServer
s@CreateServer' {} Maybe Text
a -> CreateServer
s {$sel:keyPair:CreateServer' :: Maybe Text
keyPair = Maybe Text
a} :: CreateServer)

-- | If you specify this field, AWS OpsWorks CM creates the server by using
-- the backup represented by BackupId.
createServer_backupId :: Lens.Lens' CreateServer (Prelude.Maybe Prelude.Text)
createServer_backupId :: (Maybe Text -> f (Maybe Text)) -> CreateServer -> f CreateServer
createServer_backupId = (CreateServer -> Maybe Text)
-> (CreateServer -> Maybe Text -> CreateServer)
-> Lens CreateServer CreateServer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServer' {Maybe Text
backupId :: Maybe Text
$sel:backupId:CreateServer' :: CreateServer -> Maybe Text
backupId} -> Maybe Text
backupId) (\s :: CreateServer
s@CreateServer' {} Maybe Text
a -> CreateServer
s {$sel:backupId:CreateServer' :: Maybe Text
backupId = Maybe Text
a} :: CreateServer)

-- | An optional public endpoint of a server, such as
-- @https:\/\/aws.my-company.com@. To access the server, create a CNAME DNS
-- record in your preferred DNS service that points the custom domain to
-- the endpoint that is generated when the server is created (the value of
-- the CreateServer Endpoint attribute). You cannot access the server by
-- using the generated @Endpoint@ value if the server is using a custom
-- domain. If you specify a custom domain, you must also specify values for
-- @CustomCertificate@ and @CustomPrivateKey@.
createServer_customDomain :: Lens.Lens' CreateServer (Prelude.Maybe Prelude.Text)
createServer_customDomain :: (Maybe Text -> f (Maybe Text)) -> CreateServer -> f CreateServer
createServer_customDomain = (CreateServer -> Maybe Text)
-> (CreateServer -> Maybe Text -> CreateServer)
-> Lens CreateServer CreateServer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServer' {Maybe Text
customDomain :: Maybe Text
$sel:customDomain:CreateServer' :: CreateServer -> Maybe Text
customDomain} -> Maybe Text
customDomain) (\s :: CreateServer
s@CreateServer' {} Maybe Text
a -> CreateServer
s {$sel:customDomain:CreateServer' :: Maybe Text
customDomain = Maybe Text
a} :: CreateServer)

-- | A private key in PEM format for connecting to the server by using HTTPS.
-- The private key must not be encrypted; it cannot be protected by a
-- password or passphrase. If you specify a custom private key, you must
-- also specify values for @CustomDomain@ and @CustomCertificate@.
createServer_customPrivateKey :: Lens.Lens' CreateServer (Prelude.Maybe Prelude.Text)
createServer_customPrivateKey :: (Maybe Text -> f (Maybe Text)) -> CreateServer -> f CreateServer
createServer_customPrivateKey = (CreateServer -> Maybe (Sensitive Text))
-> (CreateServer -> Maybe (Sensitive Text) -> CreateServer)
-> Lens
     CreateServer
     CreateServer
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServer' {Maybe (Sensitive Text)
customPrivateKey :: Maybe (Sensitive Text)
$sel:customPrivateKey:CreateServer' :: CreateServer -> Maybe (Sensitive Text)
customPrivateKey} -> Maybe (Sensitive Text)
customPrivateKey) (\s :: CreateServer
s@CreateServer' {} Maybe (Sensitive Text)
a -> CreateServer
s {$sel:customPrivateKey:CreateServer' :: Maybe (Sensitive Text)
customPrivateKey = Maybe (Sensitive Text)
a} :: CreateServer) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> CreateServer -> f CreateServer)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> CreateServer
-> f CreateServer
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive 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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The engine model of the server. Valid values in this release include
-- @Monolithic@ for Puppet and @Single@ for Chef.
createServer_engineModel :: Lens.Lens' CreateServer (Prelude.Maybe Prelude.Text)
createServer_engineModel :: (Maybe Text -> f (Maybe Text)) -> CreateServer -> f CreateServer
createServer_engineModel = (CreateServer -> Maybe Text)
-> (CreateServer -> Maybe Text -> CreateServer)
-> Lens CreateServer CreateServer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServer' {Maybe Text
engineModel :: Maybe Text
$sel:engineModel:CreateServer' :: CreateServer -> Maybe Text
engineModel} -> Maybe Text
engineModel) (\s :: CreateServer
s@CreateServer' {} Maybe Text
a -> CreateServer
s {$sel:engineModel:CreateServer' :: Maybe Text
engineModel = Maybe Text
a} :: CreateServer)

-- | Optional engine attributes on a specified server.
--
-- __Attributes accepted in a Chef createServer request:__
--
-- -   @CHEF_AUTOMATE_PIVOTAL_KEY@: A base64-encoded RSA public key. The
--     corresponding private key is required to access the Chef API. When
--     no CHEF_AUTOMATE_PIVOTAL_KEY is set, a private key is generated and
--     returned in the response.
--
-- -   @CHEF_AUTOMATE_ADMIN_PASSWORD@: The password for the administrative
--     user in the Chef Automate web-based dashboard. The password length
--     is a minimum of eight characters, and a maximum of 32. The password
--     can contain letters, numbers, and special characters
--     (!\/\@#$%^&+=_). The password must contain at least one lower case
--     letter, one upper case letter, one number, and one special
--     character. When no CHEF_AUTOMATE_ADMIN_PASSWORD is set, one is
--     generated and returned in the response.
--
-- __Attributes accepted in a Puppet createServer request:__
--
-- -   @PUPPET_ADMIN_PASSWORD@: To work with the Puppet Enterprise console,
--     a password must use ASCII characters.
--
-- -   @PUPPET_R10K_REMOTE@: The r10k remote is the URL of your control
--     repository (for example,
--     ssh:\/\/git\@your.git-repo.com:user\/control-repo.git). Specifying
--     an r10k remote opens TCP port 8170.
--
-- -   @PUPPET_R10K_PRIVATE_KEY@: If you are using a private Git
--     repository, add PUPPET_R10K_PRIVATE_KEY to specify a PEM-encoded
--     private SSH key.
createServer_engineAttributes :: Lens.Lens' CreateServer (Prelude.Maybe [EngineAttribute])
createServer_engineAttributes :: (Maybe [EngineAttribute] -> f (Maybe [EngineAttribute]))
-> CreateServer -> f CreateServer
createServer_engineAttributes = (CreateServer -> Maybe [EngineAttribute])
-> (CreateServer -> Maybe [EngineAttribute] -> CreateServer)
-> Lens
     CreateServer
     CreateServer
     (Maybe [EngineAttribute])
     (Maybe [EngineAttribute])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServer' {Maybe [EngineAttribute]
engineAttributes :: Maybe [EngineAttribute]
$sel:engineAttributes:CreateServer' :: CreateServer -> Maybe [EngineAttribute]
engineAttributes} -> Maybe [EngineAttribute]
engineAttributes) (\s :: CreateServer
s@CreateServer' {} Maybe [EngineAttribute]
a -> CreateServer
s {$sel:engineAttributes:CreateServer' :: Maybe [EngineAttribute]
engineAttributes = Maybe [EngineAttribute]
a} :: CreateServer) ((Maybe [EngineAttribute] -> f (Maybe [EngineAttribute]))
 -> CreateServer -> f CreateServer)
-> ((Maybe [EngineAttribute] -> f (Maybe [EngineAttribute]))
    -> Maybe [EngineAttribute] -> f (Maybe [EngineAttribute]))
-> (Maybe [EngineAttribute] -> f (Maybe [EngineAttribute]))
-> CreateServer
-> f CreateServer
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [EngineAttribute]
  [EngineAttribute]
  [EngineAttribute]
  [EngineAttribute]
-> Iso
     (Maybe [EngineAttribute])
     (Maybe [EngineAttribute])
     (Maybe [EngineAttribute])
     (Maybe [EngineAttribute])
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
  [EngineAttribute]
  [EngineAttribute]
  [EngineAttribute]
  [EngineAttribute]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The start time for a one-hour period each week during which AWS OpsWorks
-- CM performs maintenance on the instance. Valid values must be specified
-- in the following format: @DDD:HH:MM@. @MM@ must be specified as @00@.
-- The specified time is in coordinated universal time (UTC). The default
-- value is a random one-hour period on Tuesday, Wednesday, or Friday. See
-- @TimeWindowDefinition@ for more information.
--
-- __Example:__ @Mon:08:00@, which represents a start time of every Monday
-- at 08:00 UTC. (8:00 a.m.)
createServer_preferredMaintenanceWindow :: Lens.Lens' CreateServer (Prelude.Maybe Prelude.Text)
createServer_preferredMaintenanceWindow :: (Maybe Text -> f (Maybe Text)) -> CreateServer -> f CreateServer
createServer_preferredMaintenanceWindow = (CreateServer -> Maybe Text)
-> (CreateServer -> Maybe Text -> CreateServer)
-> Lens CreateServer CreateServer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServer' {Maybe Text
preferredMaintenanceWindow :: Maybe Text
$sel:preferredMaintenanceWindow:CreateServer' :: CreateServer -> Maybe Text
preferredMaintenanceWindow} -> Maybe Text
preferredMaintenanceWindow) (\s :: CreateServer
s@CreateServer' {} Maybe Text
a -> CreateServer
s {$sel:preferredMaintenanceWindow:CreateServer' :: Maybe Text
preferredMaintenanceWindow = Maybe Text
a} :: CreateServer)

-- | The start time for a one-hour period during which AWS OpsWorks CM backs
-- up application-level data on your server if automated backups are
-- enabled. Valid values must be specified in one of the following formats:
--
-- -   @HH:MM@ for daily backups
--
-- -   @DDD:HH:MM@ for weekly backups
--
-- @MM@ must be specified as @00@. The specified time is in coordinated
-- universal time (UTC). The default value is a random, daily start time.
--
-- __Example:__ @08:00@, which represents a daily start time of 08:00 UTC.
--
-- __Example:__ @Mon:08:00@, which represents a start time of every Monday
-- at 08:00 UTC. (8:00 a.m.)
createServer_preferredBackupWindow :: Lens.Lens' CreateServer (Prelude.Maybe Prelude.Text)
createServer_preferredBackupWindow :: (Maybe Text -> f (Maybe Text)) -> CreateServer -> f CreateServer
createServer_preferredBackupWindow = (CreateServer -> Maybe Text)
-> (CreateServer -> Maybe Text -> CreateServer)
-> Lens CreateServer CreateServer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServer' {Maybe Text
preferredBackupWindow :: Maybe Text
$sel:preferredBackupWindow:CreateServer' :: CreateServer -> Maybe Text
preferredBackupWindow} -> Maybe Text
preferredBackupWindow) (\s :: CreateServer
s@CreateServer' {} Maybe Text
a -> CreateServer
s {$sel:preferredBackupWindow:CreateServer' :: Maybe Text
preferredBackupWindow = Maybe Text
a} :: CreateServer)

-- | A PEM-formatted HTTPS certificate. The value can be be a single,
-- self-signed certificate, or a certificate chain. If you specify a custom
-- certificate, you must also specify values for @CustomDomain@ and
-- @CustomPrivateKey@. The following are requirements for the
-- @CustomCertificate@ value:
--
-- -   You can provide either a self-signed, custom certificate, or the
--     full certificate chain.
--
-- -   The certificate must be a valid X509 certificate, or a certificate
--     chain in PEM format.
--
-- -   The certificate must be valid at the time of upload. A certificate
--     can\'t be used before its validity period begins (the certificate\'s
--     @NotBefore@ date), or after it expires (the certificate\'s
--     @NotAfter@ date).
--
-- -   The certificate’s common name or subject alternative names (SANs),
--     if present, must match the value of @CustomDomain@.
--
-- -   The certificate must match the value of @CustomPrivateKey@.
createServer_customCertificate :: Lens.Lens' CreateServer (Prelude.Maybe Prelude.Text)
createServer_customCertificate :: (Maybe Text -> f (Maybe Text)) -> CreateServer -> f CreateServer
createServer_customCertificate = (CreateServer -> Maybe Text)
-> (CreateServer -> Maybe Text -> CreateServer)
-> Lens CreateServer CreateServer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServer' {Maybe Text
customCertificate :: Maybe Text
$sel:customCertificate:CreateServer' :: CreateServer -> Maybe Text
customCertificate} -> Maybe Text
customCertificate) (\s :: CreateServer
s@CreateServer' {} Maybe Text
a -> CreateServer
s {$sel:customCertificate:CreateServer' :: Maybe Text
customCertificate = Maybe Text
a} :: CreateServer)

-- | A map that contains tag keys and tag values to attach to an AWS OpsWorks
-- for Chef Automate or AWS OpsWorks for Puppet Enterprise server.
--
-- -   The key cannot be empty.
--
-- -   The key can be a maximum of 127 characters, and can contain only
--     Unicode letters, numbers, or separators, or the following special
--     characters: @+ - = . _ : \/ \@@
--
-- -   The value can be a maximum 255 characters, and contain only Unicode
--     letters, numbers, or separators, or the following special
--     characters: @+ - = . _ : \/ \@@
--
-- -   Leading and trailing white spaces are trimmed from both the key and
--     value.
--
-- -   A maximum of 50 user-applied tags is allowed for any AWS OpsWorks-CM
--     server.
createServer_tags :: Lens.Lens' CreateServer (Prelude.Maybe [Tag])
createServer_tags :: (Maybe [Tag] -> f (Maybe [Tag])) -> CreateServer -> f CreateServer
createServer_tags = (CreateServer -> Maybe [Tag])
-> (CreateServer -> Maybe [Tag] -> CreateServer)
-> Lens CreateServer CreateServer (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServer' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateServer' :: CreateServer -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateServer
s@CreateServer' {} Maybe [Tag]
a -> CreateServer
s {$sel:tags:CreateServer' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateServer) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateServer -> f CreateServer)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateServer
-> f CreateServer
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 number of automated backups that you want to keep. Whenever a new
-- backup is created, AWS OpsWorks CM deletes the oldest backups if this
-- number is exceeded. The default value is @1@.
createServer_backupRetentionCount :: Lens.Lens' CreateServer (Prelude.Maybe Prelude.Natural)
createServer_backupRetentionCount :: (Maybe Natural -> f (Maybe Natural))
-> CreateServer -> f CreateServer
createServer_backupRetentionCount = (CreateServer -> Maybe Natural)
-> (CreateServer -> Maybe Natural -> CreateServer)
-> Lens CreateServer CreateServer (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServer' {Maybe Natural
backupRetentionCount :: Maybe Natural
$sel:backupRetentionCount:CreateServer' :: CreateServer -> Maybe Natural
backupRetentionCount} -> Maybe Natural
backupRetentionCount) (\s :: CreateServer
s@CreateServer' {} Maybe Natural
a -> CreateServer
s {$sel:backupRetentionCount:CreateServer' :: Maybe Natural
backupRetentionCount = Maybe Natural
a} :: CreateServer)

-- | The configuration management engine to use. Valid values include
-- @ChefAutomate@ and @Puppet@.
createServer_engine :: Lens.Lens' CreateServer Prelude.Text
createServer_engine :: (Text -> f Text) -> CreateServer -> f CreateServer
createServer_engine = (CreateServer -> Text)
-> (CreateServer -> Text -> CreateServer)
-> Lens CreateServer CreateServer Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServer' {Text
engine :: Text
$sel:engine:CreateServer' :: CreateServer -> Text
engine} -> Text
engine) (\s :: CreateServer
s@CreateServer' {} Text
a -> CreateServer
s {$sel:engine:CreateServer' :: Text
engine = Text
a} :: CreateServer)

-- | The name of the server. The server name must be unique within your AWS
-- account, within each region. Server names must start with a letter; then
-- letters, numbers, or hyphens (-) are allowed, up to a maximum of 40
-- characters.
createServer_serverName :: Lens.Lens' CreateServer Prelude.Text
createServer_serverName :: (Text -> f Text) -> CreateServer -> f CreateServer
createServer_serverName = (CreateServer -> Text)
-> (CreateServer -> Text -> CreateServer)
-> Lens CreateServer CreateServer Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServer' {Text
serverName :: Text
$sel:serverName:CreateServer' :: CreateServer -> Text
serverName} -> Text
serverName) (\s :: CreateServer
s@CreateServer' {} Text
a -> CreateServer
s {$sel:serverName:CreateServer' :: Text
serverName = Text
a} :: CreateServer)

-- | The ARN of the instance profile that your Amazon EC2 instances use.
-- Although the AWS OpsWorks console typically creates the instance profile
-- for you, if you are using API commands instead, run the
-- service-role-creation.yaml AWS CloudFormation template, located at
-- https:\/\/s3.amazonaws.com\/opsworks-cm-us-east-1-prod-default-assets\/misc\/opsworks-cm-roles.yaml.
-- This template creates a CloudFormation stack that includes the instance
-- profile you need.
createServer_instanceProfileArn :: Lens.Lens' CreateServer Prelude.Text
createServer_instanceProfileArn :: (Text -> f Text) -> CreateServer -> f CreateServer
createServer_instanceProfileArn = (CreateServer -> Text)
-> (CreateServer -> Text -> CreateServer)
-> Lens CreateServer CreateServer Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServer' {Text
instanceProfileArn :: Text
$sel:instanceProfileArn:CreateServer' :: CreateServer -> Text
instanceProfileArn} -> Text
instanceProfileArn) (\s :: CreateServer
s@CreateServer' {} Text
a -> CreateServer
s {$sel:instanceProfileArn:CreateServer' :: Text
instanceProfileArn = Text
a} :: CreateServer)

-- | The Amazon EC2 instance type to use. For example, @m5.large@.
createServer_instanceType :: Lens.Lens' CreateServer Prelude.Text
createServer_instanceType :: (Text -> f Text) -> CreateServer -> f CreateServer
createServer_instanceType = (CreateServer -> Text)
-> (CreateServer -> Text -> CreateServer)
-> Lens CreateServer CreateServer Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServer' {Text
instanceType :: Text
$sel:instanceType:CreateServer' :: CreateServer -> Text
instanceType} -> Text
instanceType) (\s :: CreateServer
s@CreateServer' {} Text
a -> CreateServer
s {$sel:instanceType:CreateServer' :: Text
instanceType = Text
a} :: CreateServer)

-- | The service role that the AWS OpsWorks CM service backend uses to work
-- with your account. Although the AWS OpsWorks management console
-- typically creates the service role for you, if you are using the AWS CLI
-- or API commands, run the service-role-creation.yaml AWS CloudFormation
-- template, located at
-- https:\/\/s3.amazonaws.com\/opsworks-cm-us-east-1-prod-default-assets\/misc\/opsworks-cm-roles.yaml.
-- This template creates a CloudFormation stack that includes the service
-- role and instance profile that you need.
createServer_serviceRoleArn :: Lens.Lens' CreateServer Prelude.Text
createServer_serviceRoleArn :: (Text -> f Text) -> CreateServer -> f CreateServer
createServer_serviceRoleArn = (CreateServer -> Text)
-> (CreateServer -> Text -> CreateServer)
-> Lens CreateServer CreateServer Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServer' {Text
serviceRoleArn :: Text
$sel:serviceRoleArn:CreateServer' :: CreateServer -> Text
serviceRoleArn} -> Text
serviceRoleArn) (\s :: CreateServer
s@CreateServer' {} Text
a -> CreateServer
s {$sel:serviceRoleArn:CreateServer' :: Text
serviceRoleArn = Text
a} :: CreateServer)

instance Core.AWSRequest CreateServer where
  type AWSResponse CreateServer = CreateServerResponse
  request :: CreateServer -> Request CreateServer
request = Service -> CreateServer -> Request CreateServer
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateServer
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateServer)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateServer))
-> Logger
-> Service
-> Proxy CreateServer
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateServer)))
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 Server -> Int -> CreateServerResponse
CreateServerResponse'
            (Maybe Server -> Int -> CreateServerResponse)
-> Either String (Maybe Server)
-> Either String (Int -> CreateServerResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Server)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Server")
            Either String (Int -> CreateServerResponse)
-> Either String Int -> Either String CreateServerResponse
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 CreateServer

instance Prelude.NFData CreateServer

instance Core.ToHeaders CreateServer where
  toHeaders :: CreateServer -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateServer -> 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
"OpsWorksCM_V2016_11_01.CreateServer" ::
                          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 CreateServer where
  toJSON :: CreateServer -> Value
toJSON CreateServer' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [EngineAttribute]
Maybe [Tag]
Maybe Text
Maybe (Sensitive Text)
Text
serviceRoleArn :: Text
instanceType :: Text
instanceProfileArn :: Text
serverName :: Text
engine :: Text
backupRetentionCount :: Maybe Natural
tags :: Maybe [Tag]
customCertificate :: Maybe Text
preferredBackupWindow :: Maybe Text
preferredMaintenanceWindow :: Maybe Text
engineAttributes :: Maybe [EngineAttribute]
engineModel :: Maybe Text
customPrivateKey :: Maybe (Sensitive Text)
customDomain :: Maybe Text
backupId :: Maybe Text
keyPair :: Maybe Text
subnetIds :: Maybe [Text]
associatePublicIpAddress :: Maybe Bool
securityGroupIds :: Maybe [Text]
disableAutomatedBackup :: Maybe Bool
engineVersion :: Maybe Text
$sel:serviceRoleArn:CreateServer' :: CreateServer -> Text
$sel:instanceType:CreateServer' :: CreateServer -> Text
$sel:instanceProfileArn:CreateServer' :: CreateServer -> Text
$sel:serverName:CreateServer' :: CreateServer -> Text
$sel:engine:CreateServer' :: CreateServer -> Text
$sel:backupRetentionCount:CreateServer' :: CreateServer -> Maybe Natural
$sel:tags:CreateServer' :: CreateServer -> Maybe [Tag]
$sel:customCertificate:CreateServer' :: CreateServer -> Maybe Text
$sel:preferredBackupWindow:CreateServer' :: CreateServer -> Maybe Text
$sel:preferredMaintenanceWindow:CreateServer' :: CreateServer -> Maybe Text
$sel:engineAttributes:CreateServer' :: CreateServer -> Maybe [EngineAttribute]
$sel:engineModel:CreateServer' :: CreateServer -> Maybe Text
$sel:customPrivateKey:CreateServer' :: CreateServer -> Maybe (Sensitive Text)
$sel:customDomain:CreateServer' :: CreateServer -> Maybe Text
$sel:backupId:CreateServer' :: CreateServer -> Maybe Text
$sel:keyPair:CreateServer' :: CreateServer -> Maybe Text
$sel:subnetIds:CreateServer' :: CreateServer -> Maybe [Text]
$sel:associatePublicIpAddress:CreateServer' :: CreateServer -> Maybe Bool
$sel:securityGroupIds:CreateServer' :: CreateServer -> Maybe [Text]
$sel:disableAutomatedBackup:CreateServer' :: CreateServer -> Maybe Bool
$sel:engineVersion:CreateServer' :: CreateServer -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"EngineVersion" 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
engineVersion,
            (Text
"DisableAutomatedBackup" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
disableAutomatedBackup,
            (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
"AssociatePublicIpAddress" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
associatePublicIpAddress,
            (Text
"SubnetIds" 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]
subnetIds,
            (Text
"KeyPair" 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
keyPair,
            (Text
"BackupId" 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
backupId,
            (Text
"CustomDomain" 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
customDomain,
            (Text
"CustomPrivateKey" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
customPrivateKey,
            (Text
"EngineModel" 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
engineModel,
            (Text
"EngineAttributes" Text -> [EngineAttribute] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([EngineAttribute] -> Pair)
-> Maybe [EngineAttribute] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [EngineAttribute]
engineAttributes,
            (Text
"PreferredMaintenanceWindow" 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
preferredMaintenanceWindow,
            (Text
"PreferredBackupWindow" 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
preferredBackupWindow,
            (Text
"CustomCertificate" 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
customCertificate,
            (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,
            (Text
"BackupRetentionCount" 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
backupRetentionCount,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Engine" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
engine),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ServerName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
serverName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"InstanceProfileArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
instanceProfileArn),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"InstanceType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
instanceType),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ServiceRoleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
serviceRoleArn)
          ]
      )

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

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

-- | /See:/ 'newCreateServerResponse' smart constructor.
data CreateServerResponse = CreateServerResponse'
  { -- | The server that is created by the request.
    CreateServerResponse -> Maybe Server
server :: Prelude.Maybe Server,
    -- | The response's http status code.
    CreateServerResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateServerResponse -> CreateServerResponse -> Bool
(CreateServerResponse -> CreateServerResponse -> Bool)
-> (CreateServerResponse -> CreateServerResponse -> Bool)
-> Eq CreateServerResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateServerResponse -> CreateServerResponse -> Bool
$c/= :: CreateServerResponse -> CreateServerResponse -> Bool
== :: CreateServerResponse -> CreateServerResponse -> Bool
$c== :: CreateServerResponse -> CreateServerResponse -> Bool
Prelude.Eq, Int -> CreateServerResponse -> ShowS
[CreateServerResponse] -> ShowS
CreateServerResponse -> String
(Int -> CreateServerResponse -> ShowS)
-> (CreateServerResponse -> String)
-> ([CreateServerResponse] -> ShowS)
-> Show CreateServerResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateServerResponse] -> ShowS
$cshowList :: [CreateServerResponse] -> ShowS
show :: CreateServerResponse -> String
$cshow :: CreateServerResponse -> String
showsPrec :: Int -> CreateServerResponse -> ShowS
$cshowsPrec :: Int -> CreateServerResponse -> ShowS
Prelude.Show, (forall x. CreateServerResponse -> Rep CreateServerResponse x)
-> (forall x. Rep CreateServerResponse x -> CreateServerResponse)
-> Generic CreateServerResponse
forall x. Rep CreateServerResponse x -> CreateServerResponse
forall x. CreateServerResponse -> Rep CreateServerResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateServerResponse x -> CreateServerResponse
$cfrom :: forall x. CreateServerResponse -> Rep CreateServerResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateServerResponse' 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:
--
-- 'server', 'createServerResponse_server' - The server that is created by the request.
--
-- 'httpStatus', 'createServerResponse_httpStatus' - The response's http status code.
newCreateServerResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateServerResponse
newCreateServerResponse :: Int -> CreateServerResponse
newCreateServerResponse Int
pHttpStatus_ =
  CreateServerResponse' :: Maybe Server -> Int -> CreateServerResponse
CreateServerResponse'
    { $sel:server:CreateServerResponse' :: Maybe Server
server = Maybe Server
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateServerResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The server that is created by the request.
createServerResponse_server :: Lens.Lens' CreateServerResponse (Prelude.Maybe Server)
createServerResponse_server :: (Maybe Server -> f (Maybe Server))
-> CreateServerResponse -> f CreateServerResponse
createServerResponse_server = (CreateServerResponse -> Maybe Server)
-> (CreateServerResponse -> Maybe Server -> CreateServerResponse)
-> Lens
     CreateServerResponse
     CreateServerResponse
     (Maybe Server)
     (Maybe Server)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServerResponse' {Maybe Server
server :: Maybe Server
$sel:server:CreateServerResponse' :: CreateServerResponse -> Maybe Server
server} -> Maybe Server
server) (\s :: CreateServerResponse
s@CreateServerResponse' {} Maybe Server
a -> CreateServerResponse
s {$sel:server:CreateServerResponse' :: Maybe Server
server = Maybe Server
a} :: CreateServerResponse)

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

instance Prelude.NFData CreateServerResponse