module Network.AWS.KMS.Types
(
kms
, _InvalidMarkerException
, _KMSInvalidStateException
, _InvalidKeyUsageException
, _MalformedPolicyDocumentException
, _UnsupportedOperationException
, _DisabledException
, _KeyUnavailableException
, _KMSInternalException
, _NotFoundException
, _InvalidAliasNameException
, _InvalidGrantIdException
, _InvalidGrantTokenException
, _InvalidARNException
, _DependencyTimeoutException
, _InvalidCiphertextException
, _AlreadyExistsException
, _LimitExceededException
, DataKeySpec (..)
, GrantOperation (..)
, KeyState (..)
, KeyUsageType (..)
, AliasListEntry
, aliasListEntry
, aleTargetKeyId
, aleAliasName
, aleAliasARN
, GrantConstraints
, grantConstraints
, gcEncryptionContextEquals
, gcEncryptionContextSubset
, GrantListEntry
, grantListEntry
, gleKeyId
, gleRetiringPrincipal
, gleIssuingAccount
, gleGrantId
, gleConstraints
, gleGranteePrincipal
, gleName
, gleCreationDate
, gleOperations
, KeyListEntry
, keyListEntry
, kleKeyId
, kleKeyARN
, KeyMetadata
, keyMetadata
, kmEnabled
, kmARN
, kmKeyState
, kmAWSAccountId
, kmKeyUsage
, kmCreationDate
, kmDeletionDate
, kmDescription
, kmKeyId
, ListGrantsResponse
, listGrantsResponse
, lgTruncated
, lgGrants
, lgNextMarker
) where
import Network.AWS.KMS.Types.Product
import Network.AWS.KMS.Types.Sum
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Sign.V4
kms :: Service
kms =
Service
{ _svcAbbrev = "KMS"
, _svcSigner = v4
, _svcPrefix = "kms"
, _svcVersion = "2014-11-01"
, _svcEndpoint = defaultEndpoint kms
, _svcTimeout = Just 70
, _svcCheck = statusSuccess
, _svcError = parseJSONError "KMS"
, _svcRetry = retry
}
where
retry =
Exponential
{ _retryBase = 5.0e-2
, _retryGrowth = 2
, _retryAttempts = 5
, _retryCheck = check
}
check e
| 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 (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
_InvalidMarkerException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidMarkerException = _ServiceError . hasCode "InvalidMarkerException"
_KMSInvalidStateException :: AsError a => Getting (First ServiceError) a ServiceError
_KMSInvalidStateException = _ServiceError . hasCode "KMSInvalidStateException"
_InvalidKeyUsageException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidKeyUsageException = _ServiceError . hasCode "InvalidKeyUsageException"
_MalformedPolicyDocumentException :: AsError a => Getting (First ServiceError) a ServiceError
_MalformedPolicyDocumentException =
_ServiceError . hasCode "MalformedPolicyDocumentException"
_UnsupportedOperationException :: AsError a => Getting (First ServiceError) a ServiceError
_UnsupportedOperationException =
_ServiceError . hasCode "UnsupportedOperationException"
_DisabledException :: AsError a => Getting (First ServiceError) a ServiceError
_DisabledException = _ServiceError . hasCode "DisabledException"
_KeyUnavailableException :: AsError a => Getting (First ServiceError) a ServiceError
_KeyUnavailableException = _ServiceError . hasCode "KeyUnavailableException"
_KMSInternalException :: AsError a => Getting (First ServiceError) a ServiceError
_KMSInternalException = _ServiceError . hasCode "KMSInternalException"
_NotFoundException :: AsError a => Getting (First ServiceError) a ServiceError
_NotFoundException = _ServiceError . hasCode "NotFoundException"
_InvalidAliasNameException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidAliasNameException =
_ServiceError . hasCode "InvalidAliasNameException"
_InvalidGrantIdException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidGrantIdException = _ServiceError . hasCode "InvalidGrantIdException"
_InvalidGrantTokenException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidGrantTokenException =
_ServiceError . hasCode "InvalidGrantTokenException"
_InvalidARNException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidARNException = _ServiceError . hasCode "InvalidArnException"
_DependencyTimeoutException :: AsError a => Getting (First ServiceError) a ServiceError
_DependencyTimeoutException =
_ServiceError . hasCode "DependencyTimeoutException"
_InvalidCiphertextException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidCiphertextException =
_ServiceError . hasCode "InvalidCiphertextException"
_AlreadyExistsException :: AsError a => Getting (First ServiceError) a ServiceError
_AlreadyExistsException = _ServiceError . hasCode "AlreadyExistsException"
_LimitExceededException :: AsError a => Getting (First ServiceError) a ServiceError
_LimitExceededException = _ServiceError . hasCode "LimitExceededException"