module Network.AWS.OpsWorks.CreateLayer
(
CreateLayer
, createLayer
, clAttributes
, clAutoAssignElasticIps
, clAutoAssignPublicIps
, clCustomInstanceProfileArn
, clCustomRecipes
, clCustomSecurityGroupIds
, clEnableAutoHealing
, clInstallUpdatesOnBoot
, clLifecycleEventConfiguration
, clName
, clPackages
, clShortname
, clStackId
, clType
, clUseEbsOptimizedInstances
, clVolumeConfigurations
, CreateLayerResponse
, createLayerResponse
, clrLayerId
) where
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.OpsWorks.Types
import qualified GHC.Exts
data CreateLayer = CreateLayer
{ _clAttributes :: Map LayerAttributesKeys Text
, _clAutoAssignElasticIps :: Maybe Bool
, _clAutoAssignPublicIps :: Maybe Bool
, _clCustomInstanceProfileArn :: Maybe Text
, _clCustomRecipes :: Maybe Recipes
, _clCustomSecurityGroupIds :: List "CustomSecurityGroupIds" Text
, _clEnableAutoHealing :: Maybe Bool
, _clInstallUpdatesOnBoot :: Maybe Bool
, _clLifecycleEventConfiguration :: Maybe LifecycleEventConfiguration
, _clName :: Text
, _clPackages :: List "Packages" Text
, _clShortname :: Text
, _clStackId :: Text
, _clType :: LayerType
, _clUseEbsOptimizedInstances :: Maybe Bool
, _clVolumeConfigurations :: List "VolumeConfigurations" VolumeConfiguration
} deriving (Eq, Show)
createLayer :: Text
-> LayerType
-> Text
-> Text
-> CreateLayer
createLayer p1 p2 p3 p4 = CreateLayer
{ _clStackId = p1
, _clType = p2
, _clName = p3
, _clShortname = p4
, _clAttributes = mempty
, _clCustomInstanceProfileArn = Nothing
, _clCustomSecurityGroupIds = mempty
, _clPackages = mempty
, _clVolumeConfigurations = mempty
, _clEnableAutoHealing = Nothing
, _clAutoAssignElasticIps = Nothing
, _clAutoAssignPublicIps = Nothing
, _clCustomRecipes = Nothing
, _clInstallUpdatesOnBoot = Nothing
, _clUseEbsOptimizedInstances = Nothing
, _clLifecycleEventConfiguration = Nothing
}
clAttributes :: Lens' CreateLayer (HashMap LayerAttributesKeys Text)
clAttributes = lens _clAttributes (\s a -> s { _clAttributes = a }) . _Map
clAutoAssignElasticIps :: Lens' CreateLayer (Maybe Bool)
clAutoAssignElasticIps =
lens _clAutoAssignElasticIps (\s a -> s { _clAutoAssignElasticIps = a })
clAutoAssignPublicIps :: Lens' CreateLayer (Maybe Bool)
clAutoAssignPublicIps =
lens _clAutoAssignPublicIps (\s a -> s { _clAutoAssignPublicIps = a })
clCustomInstanceProfileArn :: Lens' CreateLayer (Maybe Text)
clCustomInstanceProfileArn =
lens _clCustomInstanceProfileArn
(\s a -> s { _clCustomInstanceProfileArn = a })
clCustomRecipes :: Lens' CreateLayer (Maybe Recipes)
clCustomRecipes = lens _clCustomRecipes (\s a -> s { _clCustomRecipes = a })
clCustomSecurityGroupIds :: Lens' CreateLayer [Text]
clCustomSecurityGroupIds =
lens _clCustomSecurityGroupIds
(\s a -> s { _clCustomSecurityGroupIds = a })
. _List
clEnableAutoHealing :: Lens' CreateLayer (Maybe Bool)
clEnableAutoHealing =
lens _clEnableAutoHealing (\s a -> s { _clEnableAutoHealing = a })
clInstallUpdatesOnBoot :: Lens' CreateLayer (Maybe Bool)
clInstallUpdatesOnBoot =
lens _clInstallUpdatesOnBoot (\s a -> s { _clInstallUpdatesOnBoot = a })
clLifecycleEventConfiguration :: Lens' CreateLayer (Maybe LifecycleEventConfiguration)
clLifecycleEventConfiguration =
lens _clLifecycleEventConfiguration
(\s a -> s { _clLifecycleEventConfiguration = a })
clName :: Lens' CreateLayer Text
clName = lens _clName (\s a -> s { _clName = a })
clPackages :: Lens' CreateLayer [Text]
clPackages = lens _clPackages (\s a -> s { _clPackages = a }) . _List
clShortname :: Lens' CreateLayer Text
clShortname = lens _clShortname (\s a -> s { _clShortname = a })
clStackId :: Lens' CreateLayer Text
clStackId = lens _clStackId (\s a -> s { _clStackId = a })
clType :: Lens' CreateLayer LayerType
clType = lens _clType (\s a -> s { _clType = a })
clUseEbsOptimizedInstances :: Lens' CreateLayer (Maybe Bool)
clUseEbsOptimizedInstances =
lens _clUseEbsOptimizedInstances
(\s a -> s { _clUseEbsOptimizedInstances = a })
clVolumeConfigurations :: Lens' CreateLayer [VolumeConfiguration]
clVolumeConfigurations =
lens _clVolumeConfigurations (\s a -> s { _clVolumeConfigurations = a })
. _List
newtype CreateLayerResponse = CreateLayerResponse
{ _clrLayerId :: Maybe Text
} deriving (Eq, Ord, Show, Monoid)
createLayerResponse :: CreateLayerResponse
createLayerResponse = CreateLayerResponse
{ _clrLayerId = Nothing
}
clrLayerId :: Lens' CreateLayerResponse (Maybe Text)
clrLayerId = lens _clrLayerId (\s a -> s { _clrLayerId = a })
instance ToPath CreateLayer where
toPath = const "/"
instance ToQuery CreateLayer where
toQuery = const mempty
instance ToHeaders CreateLayer
instance ToJSON CreateLayer where
toJSON CreateLayer{..} = object
[ "StackId" .= _clStackId
, "Type" .= _clType
, "Name" .= _clName
, "Shortname" .= _clShortname
, "Attributes" .= _clAttributes
, "CustomInstanceProfileArn" .= _clCustomInstanceProfileArn
, "CustomSecurityGroupIds" .= _clCustomSecurityGroupIds
, "Packages" .= _clPackages
, "VolumeConfigurations" .= _clVolumeConfigurations
, "EnableAutoHealing" .= _clEnableAutoHealing
, "AutoAssignElasticIps" .= _clAutoAssignElasticIps
, "AutoAssignPublicIps" .= _clAutoAssignPublicIps
, "CustomRecipes" .= _clCustomRecipes
, "InstallUpdatesOnBoot" .= _clInstallUpdatesOnBoot
, "UseEbsOptimizedInstances" .= _clUseEbsOptimizedInstances
, "LifecycleEventConfiguration" .= _clLifecycleEventConfiguration
]
instance AWSRequest CreateLayer where
type Sv CreateLayer = OpsWorks
type Rs CreateLayer = CreateLayerResponse
request = post "CreateLayer"
response = jsonResponse
instance FromJSON CreateLayerResponse where
parseJSON = withObject "CreateLayerResponse" $ \o -> CreateLayerResponse
<$> o .:? "LayerId"