module Network.AWS.OpsWorks.CreateLayer
(
createLayer
, CreateLayer
, clCustomInstanceProfileARN
, clCustomSecurityGroupIds
, clInstallUpdatesOnBoot
, clLifecycleEventConfiguration
, clCustomRecipes
, clCustomJSON
, clVolumeConfigurations
, clEnableAutoHealing
, clPackages
, clAttributes
, clAutoAssignPublicIPs
, clUseEBSOptimizedInstances
, clAutoAssignElasticIPs
, clStackId
, clType
, clName
, clShortname
, createLayerResponse
, CreateLayerResponse
, clrsLayerId
, clrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.OpsWorks.Types
import Network.AWS.OpsWorks.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data CreateLayer = CreateLayer'
{ _clCustomInstanceProfileARN :: !(Maybe Text)
, _clCustomSecurityGroupIds :: !(Maybe [Text])
, _clInstallUpdatesOnBoot :: !(Maybe Bool)
, _clLifecycleEventConfiguration :: !(Maybe LifecycleEventConfiguration)
, _clCustomRecipes :: !(Maybe Recipes)
, _clCustomJSON :: !(Maybe Text)
, _clVolumeConfigurations :: !(Maybe [VolumeConfiguration])
, _clEnableAutoHealing :: !(Maybe Bool)
, _clPackages :: !(Maybe [Text])
, _clAttributes :: !(Maybe (Map LayerAttributesKeys Text))
, _clAutoAssignPublicIPs :: !(Maybe Bool)
, _clUseEBSOptimizedInstances :: !(Maybe Bool)
, _clAutoAssignElasticIPs :: !(Maybe Bool)
, _clStackId :: !Text
, _clType :: !LayerType
, _clName :: !Text
, _clShortname :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createLayer
:: Text
-> LayerType
-> Text
-> Text
-> CreateLayer
createLayer pStackId_ pType_ pName_ pShortname_ =
CreateLayer'
{ _clCustomInstanceProfileARN = Nothing
, _clCustomSecurityGroupIds = Nothing
, _clInstallUpdatesOnBoot = Nothing
, _clLifecycleEventConfiguration = Nothing
, _clCustomRecipes = Nothing
, _clCustomJSON = Nothing
, _clVolumeConfigurations = Nothing
, _clEnableAutoHealing = Nothing
, _clPackages = Nothing
, _clAttributes = Nothing
, _clAutoAssignPublicIPs = Nothing
, _clUseEBSOptimizedInstances = Nothing
, _clAutoAssignElasticIPs = Nothing
, _clStackId = pStackId_
, _clType = pType_
, _clName = pName_
, _clShortname = pShortname_
}
clCustomInstanceProfileARN :: Lens' CreateLayer (Maybe Text)
clCustomInstanceProfileARN = lens _clCustomInstanceProfileARN (\ s a -> s{_clCustomInstanceProfileARN = a});
clCustomSecurityGroupIds :: Lens' CreateLayer [Text]
clCustomSecurityGroupIds = lens _clCustomSecurityGroupIds (\ s a -> s{_clCustomSecurityGroupIds = a}) . _Default . _Coerce;
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});
clCustomRecipes :: Lens' CreateLayer (Maybe Recipes)
clCustomRecipes = lens _clCustomRecipes (\ s a -> s{_clCustomRecipes = a});
clCustomJSON :: Lens' CreateLayer (Maybe Text)
clCustomJSON = lens _clCustomJSON (\ s a -> s{_clCustomJSON = a});
clVolumeConfigurations :: Lens' CreateLayer [VolumeConfiguration]
clVolumeConfigurations = lens _clVolumeConfigurations (\ s a -> s{_clVolumeConfigurations = a}) . _Default . _Coerce;
clEnableAutoHealing :: Lens' CreateLayer (Maybe Bool)
clEnableAutoHealing = lens _clEnableAutoHealing (\ s a -> s{_clEnableAutoHealing = a});
clPackages :: Lens' CreateLayer [Text]
clPackages = lens _clPackages (\ s a -> s{_clPackages = a}) . _Default . _Coerce;
clAttributes :: Lens' CreateLayer (HashMap LayerAttributesKeys Text)
clAttributes = lens _clAttributes (\ s a -> s{_clAttributes = a}) . _Default . _Map;
clAutoAssignPublicIPs :: Lens' CreateLayer (Maybe Bool)
clAutoAssignPublicIPs = lens _clAutoAssignPublicIPs (\ s a -> s{_clAutoAssignPublicIPs = a});
clUseEBSOptimizedInstances :: Lens' CreateLayer (Maybe Bool)
clUseEBSOptimizedInstances = lens _clUseEBSOptimizedInstances (\ s a -> s{_clUseEBSOptimizedInstances = a});
clAutoAssignElasticIPs :: Lens' CreateLayer (Maybe Bool)
clAutoAssignElasticIPs = lens _clAutoAssignElasticIPs (\ s a -> s{_clAutoAssignElasticIPs = 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});
clName :: Lens' CreateLayer Text
clName = lens _clName (\ s a -> s{_clName = a});
clShortname :: Lens' CreateLayer Text
clShortname = lens _clShortname (\ s a -> s{_clShortname = a});
instance AWSRequest CreateLayer where
type Rs CreateLayer = CreateLayerResponse
request = postJSON opsWorks
response
= receiveJSON
(\ s h x ->
CreateLayerResponse' <$>
(x .?> "LayerId") <*> (pure (fromEnum s)))
instance ToHeaders CreateLayer where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("OpsWorks_20130218.CreateLayer" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON CreateLayer where
toJSON CreateLayer'{..}
= object
(catMaybes
[("CustomInstanceProfileArn" .=) <$>
_clCustomInstanceProfileARN,
("CustomSecurityGroupIds" .=) <$>
_clCustomSecurityGroupIds,
("InstallUpdatesOnBoot" .=) <$>
_clInstallUpdatesOnBoot,
("LifecycleEventConfiguration" .=) <$>
_clLifecycleEventConfiguration,
("CustomRecipes" .=) <$> _clCustomRecipes,
("CustomJson" .=) <$> _clCustomJSON,
("VolumeConfigurations" .=) <$>
_clVolumeConfigurations,
("EnableAutoHealing" .=) <$> _clEnableAutoHealing,
("Packages" .=) <$> _clPackages,
("Attributes" .=) <$> _clAttributes,
("AutoAssignPublicIps" .=) <$>
_clAutoAssignPublicIPs,
("UseEbsOptimizedInstances" .=) <$>
_clUseEBSOptimizedInstances,
("AutoAssignElasticIps" .=) <$>
_clAutoAssignElasticIPs,
Just ("StackId" .= _clStackId),
Just ("Type" .= _clType), Just ("Name" .= _clName),
Just ("Shortname" .= _clShortname)])
instance ToPath CreateLayer where
toPath = const "/"
instance ToQuery CreateLayer where
toQuery = const mempty
data CreateLayerResponse = CreateLayerResponse'
{ _clrsLayerId :: !(Maybe Text)
, _clrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createLayerResponse
:: Int
-> CreateLayerResponse
createLayerResponse pResponseStatus_ =
CreateLayerResponse'
{ _clrsLayerId = Nothing
, _clrsResponseStatus = pResponseStatus_
}
clrsLayerId :: Lens' CreateLayerResponse (Maybe Text)
clrsLayerId = lens _clrsLayerId (\ s a -> s{_clrsLayerId = a});
clrsResponseStatus :: Lens' CreateLayerResponse Int
clrsResponseStatus = lens _clrsResponseStatus (\ s a -> s{_clrsResponseStatus = a});