{-# LANGUAGE OverloadedStrings #-}
module Network.AWS.CloudHSMv2.Types
(
cloudHSMv2
, _CloudHSMInternalFailureException
, _CloudHSMServiceException
, _CloudHSMInvalidRequestException
, _CloudHSMAccessDeniedException
, _CloudHSMResourceNotFoundException
, BackupPolicy (..)
, BackupState (..)
, ClusterState (..)
, HSMState (..)
, Backup
, backup
, bClusterId
, bCreateTimestamp
, bBackupState
, bBackupId
, Certificates
, certificates
, cManufacturerHardwareCertificate
, cClusterCSR
, cHSMCertificate
, cClusterCertificate
, cAWSHardwareCertificate
, Cluster
, cluster
, cPreCoPassword
, cStateMessage
, cState
, cSubnetMapping
, cHSMs
, cVPCId
, cSourceBackupId
, cCertificates
, cSecurityGroup
, cClusterId
, cCreateTimestamp
, cBackupPolicy
, cHSMType
, HSM
, hsm
, hsmStateMessage
, hsmState
, hsmEniId
, hsmSubnetId
, hsmAvailabilityZone
, hsmClusterId
, hsmEniIP
, hsmHSMId
, Tag
, tag
, tagKey
, tagValue
) where
import Network.AWS.CloudHSMv2.Types.Product
import Network.AWS.CloudHSMv2.Types.Sum
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Sign.V4
cloudHSMv2 :: Service
cloudHSMv2 =
Service
{ _svcAbbrev = "CloudHSMv2"
, _svcSigner = v4
, _svcPrefix = "cloudhsmv2"
, _svcVersion = "2017-04-28"
, _svcEndpoint = defaultEndpoint cloudHSMv2
, _svcTimeout = Just 70
, _svcCheck = statusSuccess
, _svcError = parseJSONError "CloudHSMv2"
, _svcRetry = retry
}
where
retry =
Exponential
{ _retryBase = 5.0e-2
, _retryGrowth = 2
, _retryAttempts = 5
, _retryCheck = check
}
check e
| has (hasCode "ThrottledException" . hasStatus 400) e =
Just "throttled_exception"
| has (hasStatus 429) e = Just "too_many_requests"
| has (hasCode "ThrottlingException" . hasStatus 400) e =
Just "throttling_exception"
| has (hasCode "Throttling" . hasStatus 400) e = Just "throttling"
| has (hasStatus 504) e = Just "gateway_timeout"
| has (hasCode "RequestThrottledException" . hasStatus 400) e =
Just "request_throttled_exception"
| has (hasStatus 502) e = Just "bad_gateway"
| has (hasStatus 503) e = Just "service_unavailable"
| has (hasStatus 500) e = Just "general_server_error"
| has (hasStatus 509) e = Just "limit_exceeded"
| otherwise = Nothing
_CloudHSMInternalFailureException :: AsError a => Getting (First ServiceError) a ServiceError
_CloudHSMInternalFailureException =
_MatchServiceError cloudHSMv2 "CloudHsmInternalFailureException"
_CloudHSMServiceException :: AsError a => Getting (First ServiceError) a ServiceError
_CloudHSMServiceException =
_MatchServiceError cloudHSMv2 "CloudHsmServiceException"
_CloudHSMInvalidRequestException :: AsError a => Getting (First ServiceError) a ServiceError
_CloudHSMInvalidRequestException =
_MatchServiceError cloudHSMv2 "CloudHsmInvalidRequestException"
_CloudHSMAccessDeniedException :: AsError a => Getting (First ServiceError) a ServiceError
_CloudHSMAccessDeniedException =
_MatchServiceError cloudHSMv2 "CloudHsmAccessDeniedException"
_CloudHSMResourceNotFoundException :: AsError a => Getting (First ServiceError) a ServiceError
_CloudHSMResourceNotFoundException =
_MatchServiceError cloudHSMv2 "CloudHsmResourceNotFoundException"