module Network.AWS.RDS.CreateDBCluster
(
createDBCluster
, CreateDBCluster
, cdcEngineVersion
, cdcDBClusterIdentifier
, cdcMasterUserPassword
, cdcMasterUsername
, cdcDBSubnetGroupName
, cdcEngine
, cdcPreferredMaintenanceWindow
, cdcCharacterSetName
, cdcAvailabilityZones
, cdcPreferredBackupWindow
, cdcBackupRetentionPeriod
, cdcDatabaseName
, cdcVPCSecurityGroupIds
, cdcDBClusterParameterGroupName
, cdcOptionGroupName
, cdcTags
, cdcPort
, createDBClusterResponse
, CreateDBClusterResponse
, cdcrsDBCluster
, cdcrsStatus
) where
import Network.AWS.Prelude
import Network.AWS.RDS.Types
import Network.AWS.RDS.Types.Product
import Network.AWS.Request
import Network.AWS.Response
data CreateDBCluster = CreateDBCluster'
{ _cdcEngineVersion :: !(Maybe Text)
, _cdcDBClusterIdentifier :: !(Maybe Text)
, _cdcMasterUserPassword :: !(Maybe Text)
, _cdcMasterUsername :: !(Maybe Text)
, _cdcDBSubnetGroupName :: !(Maybe Text)
, _cdcEngine :: !(Maybe Text)
, _cdcPreferredMaintenanceWindow :: !(Maybe Text)
, _cdcCharacterSetName :: !(Maybe Text)
, _cdcAvailabilityZones :: !(Maybe [Text])
, _cdcPreferredBackupWindow :: !(Maybe Text)
, _cdcBackupRetentionPeriod :: !(Maybe Int)
, _cdcDatabaseName :: !(Maybe Text)
, _cdcVPCSecurityGroupIds :: !(Maybe [Text])
, _cdcDBClusterParameterGroupName :: !(Maybe Text)
, _cdcOptionGroupName :: !(Maybe Text)
, _cdcTags :: !(Maybe [Tag])
, _cdcPort :: !(Maybe Int)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createDBCluster
:: CreateDBCluster
createDBCluster =
CreateDBCluster'
{ _cdcEngineVersion = Nothing
, _cdcDBClusterIdentifier = Nothing
, _cdcMasterUserPassword = Nothing
, _cdcMasterUsername = Nothing
, _cdcDBSubnetGroupName = Nothing
, _cdcEngine = Nothing
, _cdcPreferredMaintenanceWindow = Nothing
, _cdcCharacterSetName = Nothing
, _cdcAvailabilityZones = Nothing
, _cdcPreferredBackupWindow = Nothing
, _cdcBackupRetentionPeriod = Nothing
, _cdcDatabaseName = Nothing
, _cdcVPCSecurityGroupIds = Nothing
, _cdcDBClusterParameterGroupName = Nothing
, _cdcOptionGroupName = Nothing
, _cdcTags = Nothing
, _cdcPort = Nothing
}
cdcEngineVersion :: Lens' CreateDBCluster (Maybe Text)
cdcEngineVersion = lens _cdcEngineVersion (\ s a -> s{_cdcEngineVersion = a});
cdcDBClusterIdentifier :: Lens' CreateDBCluster (Maybe Text)
cdcDBClusterIdentifier = lens _cdcDBClusterIdentifier (\ s a -> s{_cdcDBClusterIdentifier = a});
cdcMasterUserPassword :: Lens' CreateDBCluster (Maybe Text)
cdcMasterUserPassword = lens _cdcMasterUserPassword (\ s a -> s{_cdcMasterUserPassword = a});
cdcMasterUsername :: Lens' CreateDBCluster (Maybe Text)
cdcMasterUsername = lens _cdcMasterUsername (\ s a -> s{_cdcMasterUsername = a});
cdcDBSubnetGroupName :: Lens' CreateDBCluster (Maybe Text)
cdcDBSubnetGroupName = lens _cdcDBSubnetGroupName (\ s a -> s{_cdcDBSubnetGroupName = a});
cdcEngine :: Lens' CreateDBCluster (Maybe Text)
cdcEngine = lens _cdcEngine (\ s a -> s{_cdcEngine = a});
cdcPreferredMaintenanceWindow :: Lens' CreateDBCluster (Maybe Text)
cdcPreferredMaintenanceWindow = lens _cdcPreferredMaintenanceWindow (\ s a -> s{_cdcPreferredMaintenanceWindow = a});
cdcCharacterSetName :: Lens' CreateDBCluster (Maybe Text)
cdcCharacterSetName = lens _cdcCharacterSetName (\ s a -> s{_cdcCharacterSetName = a});
cdcAvailabilityZones :: Lens' CreateDBCluster [Text]
cdcAvailabilityZones = lens _cdcAvailabilityZones (\ s a -> s{_cdcAvailabilityZones = a}) . _Default . _Coerce;
cdcPreferredBackupWindow :: Lens' CreateDBCluster (Maybe Text)
cdcPreferredBackupWindow = lens _cdcPreferredBackupWindow (\ s a -> s{_cdcPreferredBackupWindow = a});
cdcBackupRetentionPeriod :: Lens' CreateDBCluster (Maybe Int)
cdcBackupRetentionPeriod = lens _cdcBackupRetentionPeriod (\ s a -> s{_cdcBackupRetentionPeriod = a});
cdcDatabaseName :: Lens' CreateDBCluster (Maybe Text)
cdcDatabaseName = lens _cdcDatabaseName (\ s a -> s{_cdcDatabaseName = a});
cdcVPCSecurityGroupIds :: Lens' CreateDBCluster [Text]
cdcVPCSecurityGroupIds = lens _cdcVPCSecurityGroupIds (\ s a -> s{_cdcVPCSecurityGroupIds = a}) . _Default . _Coerce;
cdcDBClusterParameterGroupName :: Lens' CreateDBCluster (Maybe Text)
cdcDBClusterParameterGroupName = lens _cdcDBClusterParameterGroupName (\ s a -> s{_cdcDBClusterParameterGroupName = a});
cdcOptionGroupName :: Lens' CreateDBCluster (Maybe Text)
cdcOptionGroupName = lens _cdcOptionGroupName (\ s a -> s{_cdcOptionGroupName = a});
cdcTags :: Lens' CreateDBCluster [Tag]
cdcTags = lens _cdcTags (\ s a -> s{_cdcTags = a}) . _Default . _Coerce;
cdcPort :: Lens' CreateDBCluster (Maybe Int)
cdcPort = lens _cdcPort (\ s a -> s{_cdcPort = a});
instance AWSRequest CreateDBCluster where
type Sv CreateDBCluster = RDS
type Rs CreateDBCluster = CreateDBClusterResponse
request = postQuery
response
= receiveXMLWrapper "CreateDBClusterResult"
(\ s h x ->
CreateDBClusterResponse' <$>
(x .@? "DBCluster") <*> (pure (fromEnum s)))
instance ToHeaders CreateDBCluster where
toHeaders = const mempty
instance ToPath CreateDBCluster where
toPath = const "/"
instance ToQuery CreateDBCluster where
toQuery CreateDBCluster'{..}
= mconcat
["Action" =: ("CreateDBCluster" :: ByteString),
"Version" =: ("2014-10-31" :: ByteString),
"EngineVersion" =: _cdcEngineVersion,
"DBClusterIdentifier" =: _cdcDBClusterIdentifier,
"MasterUserPassword" =: _cdcMasterUserPassword,
"MasterUsername" =: _cdcMasterUsername,
"DBSubnetGroupName" =: _cdcDBSubnetGroupName,
"Engine" =: _cdcEngine,
"PreferredMaintenanceWindow" =:
_cdcPreferredMaintenanceWindow,
"CharacterSetName" =: _cdcCharacterSetName,
"AvailabilityZones" =:
toQuery
(toQueryList "AvailabilityZone" <$>
_cdcAvailabilityZones),
"PreferredBackupWindow" =: _cdcPreferredBackupWindow,
"BackupRetentionPeriod" =: _cdcBackupRetentionPeriod,
"DatabaseName" =: _cdcDatabaseName,
"VpcSecurityGroupIds" =:
toQuery
(toQueryList "VpcSecurityGroupId" <$>
_cdcVPCSecurityGroupIds),
"DBClusterParameterGroupName" =:
_cdcDBClusterParameterGroupName,
"OptionGroupName" =: _cdcOptionGroupName,
"Tags" =: toQuery (toQueryList "Tag" <$> _cdcTags),
"Port" =: _cdcPort]
data CreateDBClusterResponse = CreateDBClusterResponse'
{ _cdcrsDBCluster :: !(Maybe DBCluster)
, _cdcrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createDBClusterResponse
:: Int
-> CreateDBClusterResponse
createDBClusterResponse pStatus_ =
CreateDBClusterResponse'
{ _cdcrsDBCluster = Nothing
, _cdcrsStatus = pStatus_
}
cdcrsDBCluster :: Lens' CreateDBClusterResponse (Maybe DBCluster)
cdcrsDBCluster = lens _cdcrsDBCluster (\ s a -> s{_cdcrsDBCluster = a});
cdcrsStatus :: Lens' CreateDBClusterResponse Int
cdcrsStatus = lens _cdcrsStatus (\ s a -> s{_cdcrsStatus = a});