errors.go 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  1. // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
  2. package kms
  3. import (
  4. "github.com/aws/aws-sdk-go/private/protocol"
  5. )
  6. const (
  7. // ErrCodeAlreadyExistsException for service response error code
  8. // "AlreadyExistsException".
  9. //
  10. // The request was rejected because it attempted to create a resource that already
  11. // exists.
  12. ErrCodeAlreadyExistsException = "AlreadyExistsException"
  13. // ErrCodeCloudHsmClusterInUseException for service response error code
  14. // "CloudHsmClusterInUseException".
  15. //
  16. // The request was rejected because the specified AWS CloudHSM cluster is already
  17. // associated with a custom key store or it shares a backup history with a cluster
  18. // that is associated with a custom key store. Each custom key store must be
  19. // associated with a different AWS CloudHSM cluster.
  20. //
  21. // Clusters that share a backup history have the same cluster certificate. To
  22. // view the cluster certificate of a cluster, use the DescribeClusters (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html)
  23. // operation.
  24. ErrCodeCloudHsmClusterInUseException = "CloudHsmClusterInUseException"
  25. // ErrCodeCloudHsmClusterInvalidConfigurationException for service response error code
  26. // "CloudHsmClusterInvalidConfigurationException".
  27. //
  28. // The request was rejected because the associated AWS CloudHSM cluster did
  29. // not meet the configuration requirements for a custom key store.
  30. //
  31. // * The cluster must be configured with private subnets in at least two
  32. // different Availability Zones in the Region.
  33. //
  34. // * The security group for the cluster (https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html)
  35. // (cloudhsm-cluster-<cluster-id>-sg) must include inbound rules and outbound
  36. // rules that allow TCP traffic on ports 2223-2225. The Source in the inbound
  37. // rules and the Destination in the outbound rules must match the security
  38. // group ID. These rules are set by default when you create the cluster.
  39. // Do not delete or change them. To get information about a particular security
  40. // group, use the DescribeSecurityGroups (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html)
  41. // operation.
  42. //
  43. // * The cluster must contain at least as many HSMs as the operation requires.
  44. // To add HSMs, use the AWS CloudHSM CreateHsm (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_CreateHsm.html)
  45. // operation. For the CreateCustomKeyStore, UpdateCustomKeyStore, and CreateKey
  46. // operations, the AWS CloudHSM cluster must have at least two active HSMs,
  47. // each in a different Availability Zone. For the ConnectCustomKeyStore operation,
  48. // the AWS CloudHSM must contain at least one active HSM.
  49. //
  50. // For information about the requirements for an AWS CloudHSM cluster that is
  51. // associated with a custom key store, see Assemble the Prerequisites (https://docs.aws.amazon.com/kms/latest/developerguide/create-keystore.html#before-keystore)
  52. // in the AWS Key Management Service Developer Guide. For information about
  53. // creating a private subnet for an AWS CloudHSM cluster, see Create a Private
  54. // Subnet (https://docs.aws.amazon.com/cloudhsm/latest/userguide/create-subnets.html)
  55. // in the AWS CloudHSM User Guide. For information about cluster security groups,
  56. // see Configure a Default Security Group (https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html)
  57. // in the AWS CloudHSM User Guide .
  58. ErrCodeCloudHsmClusterInvalidConfigurationException = "CloudHsmClusterInvalidConfigurationException"
  59. // ErrCodeCloudHsmClusterNotActiveException for service response error code
  60. // "CloudHsmClusterNotActiveException".
  61. //
  62. // The request was rejected because the AWS CloudHSM cluster that is associated
  63. // with the custom key store is not active. Initialize and activate the cluster
  64. // and try the command again. For detailed instructions, see Getting Started
  65. // (https://docs.aws.amazon.com/cloudhsm/latest/userguide/getting-started.html)
  66. // in the AWS CloudHSM User Guide.
  67. ErrCodeCloudHsmClusterNotActiveException = "CloudHsmClusterNotActiveException"
  68. // ErrCodeCloudHsmClusterNotFoundException for service response error code
  69. // "CloudHsmClusterNotFoundException".
  70. //
  71. // The request was rejected because AWS KMS cannot find the AWS CloudHSM cluster
  72. // with the specified cluster ID. Retry the request with a different cluster
  73. // ID.
  74. ErrCodeCloudHsmClusterNotFoundException = "CloudHsmClusterNotFoundException"
  75. // ErrCodeCloudHsmClusterNotRelatedException for service response error code
  76. // "CloudHsmClusterNotRelatedException".
  77. //
  78. // The request was rejected because the specified AWS CloudHSM cluster has a
  79. // different cluster certificate than the original cluster. You cannot use the
  80. // operation to specify an unrelated cluster.
  81. //
  82. // Specify a cluster that shares a backup history with the original cluster.
  83. // This includes clusters that were created from a backup of the current cluster,
  84. // and clusters that were created from the same backup that produced the current
  85. // cluster.
  86. //
  87. // Clusters that share a backup history have the same cluster certificate. To
  88. // view the cluster certificate of a cluster, use the DescribeClusters (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html)
  89. // operation.
  90. ErrCodeCloudHsmClusterNotRelatedException = "CloudHsmClusterNotRelatedException"
  91. // ErrCodeCustomKeyStoreHasCMKsException for service response error code
  92. // "CustomKeyStoreHasCMKsException".
  93. //
  94. // The request was rejected because the custom key store contains AWS KMS customer
  95. // master keys (CMKs). After verifying that you do not need to use the CMKs,
  96. // use the ScheduleKeyDeletion operation to delete the CMKs. After they are
  97. // deleted, you can delete the custom key store.
  98. ErrCodeCustomKeyStoreHasCMKsException = "CustomKeyStoreHasCMKsException"
  99. // ErrCodeCustomKeyStoreInvalidStateException for service response error code
  100. // "CustomKeyStoreInvalidStateException".
  101. //
  102. // The request was rejected because of the ConnectionState of the custom key
  103. // store. To get the ConnectionState of a custom key store, use the DescribeCustomKeyStores
  104. // operation.
  105. //
  106. // This exception is thrown under the following conditions:
  107. //
  108. // * You requested the CreateKey or GenerateRandom operation in a custom
  109. // key store that is not connected. These operations are valid only when
  110. // the custom key store ConnectionState is CONNECTED.
  111. //
  112. // * You requested the UpdateCustomKeyStore or DeleteCustomKeyStore operation
  113. // on a custom key store that is not disconnected. This operation is valid
  114. // only when the custom key store ConnectionState is DISCONNECTED.
  115. //
  116. // * You requested the ConnectCustomKeyStore operation on a custom key store
  117. // with a ConnectionState of DISCONNECTING or FAILED. This operation is valid
  118. // for all other ConnectionState values.
  119. ErrCodeCustomKeyStoreInvalidStateException = "CustomKeyStoreInvalidStateException"
  120. // ErrCodeCustomKeyStoreNameInUseException for service response error code
  121. // "CustomKeyStoreNameInUseException".
  122. //
  123. // The request was rejected because the specified custom key store name is already
  124. // assigned to another custom key store in the account. Try again with a custom
  125. // key store name that is unique in the account.
  126. ErrCodeCustomKeyStoreNameInUseException = "CustomKeyStoreNameInUseException"
  127. // ErrCodeCustomKeyStoreNotFoundException for service response error code
  128. // "CustomKeyStoreNotFoundException".
  129. //
  130. // The request was rejected because AWS KMS cannot find a custom key store with
  131. // the specified key store name or ID.
  132. ErrCodeCustomKeyStoreNotFoundException = "CustomKeyStoreNotFoundException"
  133. // ErrCodeDependencyTimeoutException for service response error code
  134. // "DependencyTimeoutException".
  135. //
  136. // The system timed out while trying to fulfill the request. The request can
  137. // be retried.
  138. ErrCodeDependencyTimeoutException = "DependencyTimeoutException"
  139. // ErrCodeDisabledException for service response error code
  140. // "DisabledException".
  141. //
  142. // The request was rejected because the specified CMK is not enabled.
  143. ErrCodeDisabledException = "DisabledException"
  144. // ErrCodeExpiredImportTokenException for service response error code
  145. // "ExpiredImportTokenException".
  146. //
  147. // The request was rejected because the specified import token is expired. Use
  148. // GetParametersForImport to get a new import token and public key, use the
  149. // new public key to encrypt the key material, and then try the request again.
  150. ErrCodeExpiredImportTokenException = "ExpiredImportTokenException"
  151. // ErrCodeIncorrectKeyException for service response error code
  152. // "IncorrectKeyException".
  153. //
  154. // The request was rejected because the specified CMK cannot decrypt the data.
  155. // The KeyId in a Decrypt request and the SourceKeyId in a ReEncrypt request
  156. // must identify the same CMK that was used to encrypt the ciphertext.
  157. ErrCodeIncorrectKeyException = "IncorrectKeyException"
  158. // ErrCodeIncorrectKeyMaterialException for service response error code
  159. // "IncorrectKeyMaterialException".
  160. //
  161. // The request was rejected because the key material in the request is, expired,
  162. // invalid, or is not the same key material that was previously imported into
  163. // this customer master key (CMK).
  164. ErrCodeIncorrectKeyMaterialException = "IncorrectKeyMaterialException"
  165. // ErrCodeIncorrectTrustAnchorException for service response error code
  166. // "IncorrectTrustAnchorException".
  167. //
  168. // The request was rejected because the trust anchor certificate in the request
  169. // is not the trust anchor certificate for the specified AWS CloudHSM cluster.
  170. //
  171. // When you initialize the cluster (https://docs.aws.amazon.com/cloudhsm/latest/userguide/initialize-cluster.html#sign-csr),
  172. // you create the trust anchor certificate and save it in the customerCA.crt
  173. // file.
  174. ErrCodeIncorrectTrustAnchorException = "IncorrectTrustAnchorException"
  175. // ErrCodeInternalException for service response error code
  176. // "KMSInternalException".
  177. //
  178. // The request was rejected because an internal exception occurred. The request
  179. // can be retried.
  180. ErrCodeInternalException = "KMSInternalException"
  181. // ErrCodeInvalidAliasNameException for service response error code
  182. // "InvalidAliasNameException".
  183. //
  184. // The request was rejected because the specified alias name is not valid.
  185. ErrCodeInvalidAliasNameException = "InvalidAliasNameException"
  186. // ErrCodeInvalidArnException for service response error code
  187. // "InvalidArnException".
  188. //
  189. // The request was rejected because a specified ARN, or an ARN in a key policy,
  190. // is not valid.
  191. ErrCodeInvalidArnException = "InvalidArnException"
  192. // ErrCodeInvalidCiphertextException for service response error code
  193. // "InvalidCiphertextException".
  194. //
  195. // From the Decrypt or ReEncrypt operation, the request was rejected because
  196. // the specified ciphertext, or additional authenticated data incorporated into
  197. // the ciphertext, such as the encryption context, is corrupted, missing, or
  198. // otherwise invalid.
  199. //
  200. // From the ImportKeyMaterial operation, the request was rejected because AWS
  201. // KMS could not decrypt the encrypted (wrapped) key material.
  202. ErrCodeInvalidCiphertextException = "InvalidCiphertextException"
  203. // ErrCodeInvalidGrantIdException for service response error code
  204. // "InvalidGrantIdException".
  205. //
  206. // The request was rejected because the specified GrantId is not valid.
  207. ErrCodeInvalidGrantIdException = "InvalidGrantIdException"
  208. // ErrCodeInvalidGrantTokenException for service response error code
  209. // "InvalidGrantTokenException".
  210. //
  211. // The request was rejected because the specified grant token is not valid.
  212. ErrCodeInvalidGrantTokenException = "InvalidGrantTokenException"
  213. // ErrCodeInvalidImportTokenException for service response error code
  214. // "InvalidImportTokenException".
  215. //
  216. // The request was rejected because the provided import token is invalid or
  217. // is associated with a different customer master key (CMK).
  218. ErrCodeInvalidImportTokenException = "InvalidImportTokenException"
  219. // ErrCodeInvalidKeyUsageException for service response error code
  220. // "InvalidKeyUsageException".
  221. //
  222. // The request was rejected for one of the following reasons:
  223. //
  224. // * The KeyUsage value of the CMK is incompatible with the API operation.
  225. //
  226. // * The encryption algorithm or signing algorithm specified for the operation
  227. // is incompatible with the type of key material in the CMK (CustomerMasterKeySpec).
  228. //
  229. // For encrypting, decrypting, re-encrypting, and generating data keys, the
  230. // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage
  231. // must be SIGN_VERIFY. To find the KeyUsage of a CMK, use the DescribeKey operation.
  232. //
  233. // To find the encryption or signing algorithms supported for a particular CMK,
  234. // use the DescribeKey operation.
  235. ErrCodeInvalidKeyUsageException = "InvalidKeyUsageException"
  236. // ErrCodeInvalidMarkerException for service response error code
  237. // "InvalidMarkerException".
  238. //
  239. // The request was rejected because the marker that specifies where pagination
  240. // should next begin is not valid.
  241. ErrCodeInvalidMarkerException = "InvalidMarkerException"
  242. // ErrCodeInvalidStateException for service response error code
  243. // "KMSInvalidStateException".
  244. //
  245. // The request was rejected because the state of the specified resource is not
  246. // valid for this request.
  247. //
  248. // For more information about how key state affects the use of a CMK, see How
  249. // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  250. // in the AWS Key Management Service Developer Guide .
  251. ErrCodeInvalidStateException = "KMSInvalidStateException"
  252. // ErrCodeKMSInvalidSignatureException for service response error code
  253. // "KMSInvalidSignatureException".
  254. //
  255. // The request was rejected because the signature verification failed. Signature
  256. // verification fails when it cannot confirm that signature was produced by
  257. // signing the specified message with the specified CMK and signing algorithm.
  258. ErrCodeKMSInvalidSignatureException = "KMSInvalidSignatureException"
  259. // ErrCodeKeyUnavailableException for service response error code
  260. // "KeyUnavailableException".
  261. //
  262. // The request was rejected because the specified CMK was not available. You
  263. // can retry the request.
  264. ErrCodeKeyUnavailableException = "KeyUnavailableException"
  265. // ErrCodeLimitExceededException for service response error code
  266. // "LimitExceededException".
  267. //
  268. // The request was rejected because a limit was exceeded. For more information,
  269. // see Limits (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html)
  270. // in the AWS Key Management Service Developer Guide.
  271. ErrCodeLimitExceededException = "LimitExceededException"
  272. // ErrCodeMalformedPolicyDocumentException for service response error code
  273. // "MalformedPolicyDocumentException".
  274. //
  275. // The request was rejected because the specified policy is not syntactically
  276. // or semantically correct.
  277. ErrCodeMalformedPolicyDocumentException = "MalformedPolicyDocumentException"
  278. // ErrCodeNotFoundException for service response error code
  279. // "NotFoundException".
  280. //
  281. // The request was rejected because the specified entity or resource could not
  282. // be found.
  283. ErrCodeNotFoundException = "NotFoundException"
  284. // ErrCodeTagException for service response error code
  285. // "TagException".
  286. //
  287. // The request was rejected because one or more tags are not valid.
  288. ErrCodeTagException = "TagException"
  289. // ErrCodeUnsupportedOperationException for service response error code
  290. // "UnsupportedOperationException".
  291. //
  292. // The request was rejected because a specified parameter is not supported or
  293. // a specified resource is not valid for this operation.
  294. ErrCodeUnsupportedOperationException = "UnsupportedOperationException"
  295. )
  296. var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{
  297. "AlreadyExistsException": newErrorAlreadyExistsException,
  298. "CloudHsmClusterInUseException": newErrorCloudHsmClusterInUseException,
  299. "CloudHsmClusterInvalidConfigurationException": newErrorCloudHsmClusterInvalidConfigurationException,
  300. "CloudHsmClusterNotActiveException": newErrorCloudHsmClusterNotActiveException,
  301. "CloudHsmClusterNotFoundException": newErrorCloudHsmClusterNotFoundException,
  302. "CloudHsmClusterNotRelatedException": newErrorCloudHsmClusterNotRelatedException,
  303. "CustomKeyStoreHasCMKsException": newErrorCustomKeyStoreHasCMKsException,
  304. "CustomKeyStoreInvalidStateException": newErrorCustomKeyStoreInvalidStateException,
  305. "CustomKeyStoreNameInUseException": newErrorCustomKeyStoreNameInUseException,
  306. "CustomKeyStoreNotFoundException": newErrorCustomKeyStoreNotFoundException,
  307. "DependencyTimeoutException": newErrorDependencyTimeoutException,
  308. "DisabledException": newErrorDisabledException,
  309. "ExpiredImportTokenException": newErrorExpiredImportTokenException,
  310. "IncorrectKeyException": newErrorIncorrectKeyException,
  311. "IncorrectKeyMaterialException": newErrorIncorrectKeyMaterialException,
  312. "IncorrectTrustAnchorException": newErrorIncorrectTrustAnchorException,
  313. "KMSInternalException": newErrorInternalException,
  314. "InvalidAliasNameException": newErrorInvalidAliasNameException,
  315. "InvalidArnException": newErrorInvalidArnException,
  316. "InvalidCiphertextException": newErrorInvalidCiphertextException,
  317. "InvalidGrantIdException": newErrorInvalidGrantIdException,
  318. "InvalidGrantTokenException": newErrorInvalidGrantTokenException,
  319. "InvalidImportTokenException": newErrorInvalidImportTokenException,
  320. "InvalidKeyUsageException": newErrorInvalidKeyUsageException,
  321. "InvalidMarkerException": newErrorInvalidMarkerException,
  322. "KMSInvalidStateException": newErrorInvalidStateException,
  323. "KMSInvalidSignatureException": newErrorKMSInvalidSignatureException,
  324. "KeyUnavailableException": newErrorKeyUnavailableException,
  325. "LimitExceededException": newErrorLimitExceededException,
  326. "MalformedPolicyDocumentException": newErrorMalformedPolicyDocumentException,
  327. "NotFoundException": newErrorNotFoundException,
  328. "TagException": newErrorTagException,
  329. "UnsupportedOperationException": newErrorUnsupportedOperationException,
  330. }