{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.CodeDeploy.CreateDeploymentGroup
(
createDeploymentGroup
, CreateDeploymentGroup
, cdgEc2TagSet
, cdgDeploymentConfigName
, cdgOnPremisesTagSet
, cdgEc2TagFilters
, cdgBlueGreenDeploymentConfiguration
, cdgLoadBalancerInfo
, cdgOnPremisesInstanceTagFilters
, cdgAlarmConfiguration
, cdgTriggerConfigurations
, cdgAutoScalingGroups
, cdgDeploymentStyle
, cdgAutoRollbackConfiguration
, cdgApplicationName
, cdgDeploymentGroupName
, cdgServiceRoleARN
, createDeploymentGroupResponse
, CreateDeploymentGroupResponse
, cdgrsDeploymentGroupId
, cdgrsResponseStatus
) where
import Network.AWS.CodeDeploy.Types
import Network.AWS.CodeDeploy.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data CreateDeploymentGroup = CreateDeploymentGroup'
{ _cdgEc2TagSet :: !(Maybe EC2TagSet)
, _cdgDeploymentConfigName :: !(Maybe Text)
, _cdgOnPremisesTagSet :: !(Maybe OnPremisesTagSet)
, _cdgEc2TagFilters :: !(Maybe [EC2TagFilter])
, _cdgBlueGreenDeploymentConfiguration :: !(Maybe BlueGreenDeploymentConfiguration)
, _cdgLoadBalancerInfo :: !(Maybe LoadBalancerInfo)
, _cdgOnPremisesInstanceTagFilters :: !(Maybe [TagFilter])
, _cdgAlarmConfiguration :: !(Maybe AlarmConfiguration)
, _cdgTriggerConfigurations :: !(Maybe [TriggerConfig])
, _cdgAutoScalingGroups :: !(Maybe [Text])
, _cdgDeploymentStyle :: !(Maybe DeploymentStyle)
, _cdgAutoRollbackConfiguration :: !(Maybe AutoRollbackConfiguration)
, _cdgApplicationName :: !Text
, _cdgDeploymentGroupName :: !Text
, _cdgServiceRoleARN :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createDeploymentGroup
:: Text
-> Text
-> Text
-> CreateDeploymentGroup
createDeploymentGroup pApplicationName_ pDeploymentGroupName_ pServiceRoleARN_ =
CreateDeploymentGroup'
{ _cdgEc2TagSet = Nothing
, _cdgDeploymentConfigName = Nothing
, _cdgOnPremisesTagSet = Nothing
, _cdgEc2TagFilters = Nothing
, _cdgBlueGreenDeploymentConfiguration = Nothing
, _cdgLoadBalancerInfo = Nothing
, _cdgOnPremisesInstanceTagFilters = Nothing
, _cdgAlarmConfiguration = Nothing
, _cdgTriggerConfigurations = Nothing
, _cdgAutoScalingGroups = Nothing
, _cdgDeploymentStyle = Nothing
, _cdgAutoRollbackConfiguration = Nothing
, _cdgApplicationName = pApplicationName_
, _cdgDeploymentGroupName = pDeploymentGroupName_
, _cdgServiceRoleARN = pServiceRoleARN_
}
cdgEc2TagSet :: Lens' CreateDeploymentGroup (Maybe EC2TagSet)
cdgEc2TagSet = lens _cdgEc2TagSet (\ s a -> s{_cdgEc2TagSet = a})
cdgDeploymentConfigName :: Lens' CreateDeploymentGroup (Maybe Text)
cdgDeploymentConfigName = lens _cdgDeploymentConfigName (\ s a -> s{_cdgDeploymentConfigName = a})
cdgOnPremisesTagSet :: Lens' CreateDeploymentGroup (Maybe OnPremisesTagSet)
cdgOnPremisesTagSet = lens _cdgOnPremisesTagSet (\ s a -> s{_cdgOnPremisesTagSet = a})
cdgEc2TagFilters :: Lens' CreateDeploymentGroup [EC2TagFilter]
cdgEc2TagFilters = lens _cdgEc2TagFilters (\ s a -> s{_cdgEc2TagFilters = a}) . _Default . _Coerce
cdgBlueGreenDeploymentConfiguration :: Lens' CreateDeploymentGroup (Maybe BlueGreenDeploymentConfiguration)
cdgBlueGreenDeploymentConfiguration = lens _cdgBlueGreenDeploymentConfiguration (\ s a -> s{_cdgBlueGreenDeploymentConfiguration = a})
cdgLoadBalancerInfo :: Lens' CreateDeploymentGroup (Maybe LoadBalancerInfo)
cdgLoadBalancerInfo = lens _cdgLoadBalancerInfo (\ s a -> s{_cdgLoadBalancerInfo = a})
cdgOnPremisesInstanceTagFilters :: Lens' CreateDeploymentGroup [TagFilter]
cdgOnPremisesInstanceTagFilters = lens _cdgOnPremisesInstanceTagFilters (\ s a -> s{_cdgOnPremisesInstanceTagFilters = a}) . _Default . _Coerce
cdgAlarmConfiguration :: Lens' CreateDeploymentGroup (Maybe AlarmConfiguration)
cdgAlarmConfiguration = lens _cdgAlarmConfiguration (\ s a -> s{_cdgAlarmConfiguration = a})
cdgTriggerConfigurations :: Lens' CreateDeploymentGroup [TriggerConfig]
cdgTriggerConfigurations = lens _cdgTriggerConfigurations (\ s a -> s{_cdgTriggerConfigurations = a}) . _Default . _Coerce
cdgAutoScalingGroups :: Lens' CreateDeploymentGroup [Text]
cdgAutoScalingGroups = lens _cdgAutoScalingGroups (\ s a -> s{_cdgAutoScalingGroups = a}) . _Default . _Coerce
cdgDeploymentStyle :: Lens' CreateDeploymentGroup (Maybe DeploymentStyle)
cdgDeploymentStyle = lens _cdgDeploymentStyle (\ s a -> s{_cdgDeploymentStyle = a})
cdgAutoRollbackConfiguration :: Lens' CreateDeploymentGroup (Maybe AutoRollbackConfiguration)
cdgAutoRollbackConfiguration = lens _cdgAutoRollbackConfiguration (\ s a -> s{_cdgAutoRollbackConfiguration = a})
cdgApplicationName :: Lens' CreateDeploymentGroup Text
cdgApplicationName = lens _cdgApplicationName (\ s a -> s{_cdgApplicationName = a})
cdgDeploymentGroupName :: Lens' CreateDeploymentGroup Text
cdgDeploymentGroupName = lens _cdgDeploymentGroupName (\ s a -> s{_cdgDeploymentGroupName = a})
cdgServiceRoleARN :: Lens' CreateDeploymentGroup Text
cdgServiceRoleARN = lens _cdgServiceRoleARN (\ s a -> s{_cdgServiceRoleARN = a})
instance AWSRequest CreateDeploymentGroup where
type Rs CreateDeploymentGroup =
CreateDeploymentGroupResponse
request = postJSON codeDeploy
response
= receiveJSON
(\ s h x ->
CreateDeploymentGroupResponse' <$>
(x .?> "deploymentGroupId") <*> (pure (fromEnum s)))
instance Hashable CreateDeploymentGroup where
instance NFData CreateDeploymentGroup where
instance ToHeaders CreateDeploymentGroup where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CodeDeploy_20141006.CreateDeploymentGroup" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON CreateDeploymentGroup where
toJSON CreateDeploymentGroup'{..}
= object
(catMaybes
[("ec2TagSet" .=) <$> _cdgEc2TagSet,
("deploymentConfigName" .=) <$>
_cdgDeploymentConfigName,
("onPremisesTagSet" .=) <$> _cdgOnPremisesTagSet,
("ec2TagFilters" .=) <$> _cdgEc2TagFilters,
("blueGreenDeploymentConfiguration" .=) <$>
_cdgBlueGreenDeploymentConfiguration,
("loadBalancerInfo" .=) <$> _cdgLoadBalancerInfo,
("onPremisesInstanceTagFilters" .=) <$>
_cdgOnPremisesInstanceTagFilters,
("alarmConfiguration" .=) <$> _cdgAlarmConfiguration,
("triggerConfigurations" .=) <$>
_cdgTriggerConfigurations,
("autoScalingGroups" .=) <$> _cdgAutoScalingGroups,
("deploymentStyle" .=) <$> _cdgDeploymentStyle,
("autoRollbackConfiguration" .=) <$>
_cdgAutoRollbackConfiguration,
Just ("applicationName" .= _cdgApplicationName),
Just
("deploymentGroupName" .= _cdgDeploymentGroupName),
Just ("serviceRoleArn" .= _cdgServiceRoleARN)])
instance ToPath CreateDeploymentGroup where
toPath = const "/"
instance ToQuery CreateDeploymentGroup where
toQuery = const mempty
data CreateDeploymentGroupResponse = CreateDeploymentGroupResponse'
{ _cdgrsDeploymentGroupId :: !(Maybe Text)
, _cdgrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createDeploymentGroupResponse
:: Int
-> CreateDeploymentGroupResponse
createDeploymentGroupResponse pResponseStatus_ =
CreateDeploymentGroupResponse'
{_cdgrsDeploymentGroupId = Nothing, _cdgrsResponseStatus = pResponseStatus_}
cdgrsDeploymentGroupId :: Lens' CreateDeploymentGroupResponse (Maybe Text)
cdgrsDeploymentGroupId = lens _cdgrsDeploymentGroupId (\ s a -> s{_cdgrsDeploymentGroupId = a})
cdgrsResponseStatus :: Lens' CreateDeploymentGroupResponse Int
cdgrsResponseStatus = lens _cdgrsResponseStatus (\ s a -> s{_cdgrsResponseStatus = a})
instance NFData CreateDeploymentGroupResponse where