Copyright | (c) 2013-2021 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Retrieves the contents of the encrypted fields SecretString
or
SecretBinary
from the specified version of a secret, whichever
contains content.
Minimum permissions
To run this command, you must have the following permissions:
- secretsmanager:GetSecretValue
- kms:Decrypt - required only if you use a customer-managed Amazon Web Services KMS key to encrypt the secret. You do not need this permission to use the account's default Amazon Web Services managed CMK for Secrets Manager.
Related operations
- To create a new version of the secret with different encrypted information, use PutSecretValue.
- To retrieve the non-encrypted details for the secret, use DescribeSecret.
Synopsis
- data GetSecretValue = GetSecretValue' {}
- newGetSecretValue :: Text -> GetSecretValue
- getSecretValue_versionId :: Lens' GetSecretValue (Maybe Text)
- getSecretValue_versionStage :: Lens' GetSecretValue (Maybe Text)
- getSecretValue_secretId :: Lens' GetSecretValue Text
- data GetSecretValueResponse = GetSecretValueResponse' {}
- newGetSecretValueResponse :: Int -> GetSecretValueResponse
- getSecretValueResponse_versionId :: Lens' GetSecretValueResponse (Maybe Text)
- getSecretValueResponse_arn :: Lens' GetSecretValueResponse (Maybe Text)
- getSecretValueResponse_versionStages :: Lens' GetSecretValueResponse (Maybe (NonEmpty Text))
- getSecretValueResponse_secretBinary :: Lens' GetSecretValueResponse (Maybe ByteString)
- getSecretValueResponse_createdDate :: Lens' GetSecretValueResponse (Maybe UTCTime)
- getSecretValueResponse_name :: Lens' GetSecretValueResponse (Maybe Text)
- getSecretValueResponse_secretString :: Lens' GetSecretValueResponse (Maybe Text)
- getSecretValueResponse_httpStatus :: Lens' GetSecretValueResponse Int
Creating a Request
data GetSecretValue Source #
See: newGetSecretValue
smart constructor.
GetSecretValue' | |
|
Instances
Create a value of GetSecretValue
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:versionId:GetSecretValue'
, getSecretValue_versionId
- Specifies the unique identifier of the version of the secret that you
want to retrieve. If you specify both this parameter and VersionStage
,
the two parameters must refer to the same secret version. If you don't
specify either a VersionStage
or VersionId
then the default is to
perform the operation on the version with the VersionStage
value of
AWSCURRENT
.
This value is typically a UUID-type value with 32 hexadecimal digits.
$sel:versionStage:GetSecretValue'
, getSecretValue_versionStage
- Specifies the secret version that you want to retrieve by the staging
label attached to the version.
Staging labels are used to keep track of different versions during the
rotation process. If you specify both this parameter and VersionId
,
the two parameters must refer to the same secret version . If you don't
specify either a VersionStage
or VersionId
, then the default is to
perform the operation on the version with the VersionStage
value of
AWSCURRENT
.
$sel:secretId:GetSecretValue'
, getSecretValue_secretId
- Specifies the secret containing the version that you want to retrieve.
You can specify either the Amazon Resource Name (ARN) or the friendly
name of the secret.
For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.
Request Lenses
getSecretValue_versionId :: Lens' GetSecretValue (Maybe Text) Source #
Specifies the unique identifier of the version of the secret that you
want to retrieve. If you specify both this parameter and VersionStage
,
the two parameters must refer to the same secret version. If you don't
specify either a VersionStage
or VersionId
then the default is to
perform the operation on the version with the VersionStage
value of
AWSCURRENT
.
This value is typically a UUID-type value with 32 hexadecimal digits.
getSecretValue_versionStage :: Lens' GetSecretValue (Maybe Text) Source #
Specifies the secret version that you want to retrieve by the staging label attached to the version.
Staging labels are used to keep track of different versions during the
rotation process. If you specify both this parameter and VersionId
,
the two parameters must refer to the same secret version . If you don't
specify either a VersionStage
or VersionId
, then the default is to
perform the operation on the version with the VersionStage
value of
AWSCURRENT
.
getSecretValue_secretId :: Lens' GetSecretValue Text Source #
Specifies the secret containing the version that you want to retrieve. You can specify either the Amazon Resource Name (ARN) or the friendly name of the secret.
For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.
Destructuring the Response
data GetSecretValueResponse Source #
See: newGetSecretValueResponse
smart constructor.
GetSecretValueResponse' | |
|
Instances
newGetSecretValueResponse Source #
Create a value of GetSecretValueResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:versionId:GetSecretValue'
, getSecretValueResponse_versionId
- The unique identifier of this version of the secret.
$sel:arn:GetSecretValueResponse'
, getSecretValueResponse_arn
- The ARN of the secret.
$sel:versionStages:GetSecretValueResponse'
, getSecretValueResponse_versionStages
- A list of all of the staging labels currently attached to this version
of the secret.
$sel:secretBinary:GetSecretValueResponse'
, getSecretValueResponse_secretBinary
- The decrypted part of the protected secret information that was
originally provided as binary data in the form of a byte array. The
response parameter represents the binary data as a
base64-encoded string.
This parameter is not used if the secret is created by the Secrets Manager console.
If you store custom information in this field of the secret, then you
must code your Lambda rotation function to parse and interpret whatever
you store in the SecretString
or SecretBinary
fields.--
-- Note: This Lens
automatically encodes and decodes Base64 data.
-- The underlying isomorphism will encode to Base64 representation during
-- serialisation, and decode from Base64 representation during deserialisation.
-- This Lens
accepts and returns only raw unencoded data.
$sel:createdDate:GetSecretValueResponse'
, getSecretValueResponse_createdDate
- The date and time that this version of the secret was created.
$sel:name:GetSecretValueResponse'
, getSecretValueResponse_name
- The friendly name of the secret.
$sel:secretString:GetSecretValueResponse'
, getSecretValueResponse_secretString
- The decrypted part of the protected secret information that was
originally provided as a string.
If you create this secret by using the Secrets Manager console then only
the SecretString
parameter contains data. Secrets Manager stores the
information as a JSON structure of key/value pairs that the Lambda
rotation function knows how to parse.
If you store custom information in the secret by using the CreateSecret, UpdateSecret, or PutSecretValue API operations instead of the Secrets Manager console, or by using the Other secret type in the console, then you must code your Lambda rotation function to parse and interpret those values.
$sel:httpStatus:GetSecretValueResponse'
, getSecretValueResponse_httpStatus
- The response's http status code.
Response Lenses
getSecretValueResponse_versionId :: Lens' GetSecretValueResponse (Maybe Text) Source #
The unique identifier of this version of the secret.
getSecretValueResponse_arn :: Lens' GetSecretValueResponse (Maybe Text) Source #
The ARN of the secret.
getSecretValueResponse_versionStages :: Lens' GetSecretValueResponse (Maybe (NonEmpty Text)) Source #
A list of all of the staging labels currently attached to this version of the secret.
getSecretValueResponse_secretBinary :: Lens' GetSecretValueResponse (Maybe ByteString) Source #
The decrypted part of the protected secret information that was originally provided as binary data in the form of a byte array. The response parameter represents the binary data as a base64-encoded string.
This parameter is not used if the secret is created by the Secrets Manager console.
If you store custom information in this field of the secret, then you
must code your Lambda rotation function to parse and interpret whatever
you store in the SecretString
or SecretBinary
fields.--
-- Note: This Lens
automatically encodes and decodes Base64 data.
-- The underlying isomorphism will encode to Base64 representation during
-- serialisation, and decode from Base64 representation during deserialisation.
-- This Lens
accepts and returns only raw unencoded data.
getSecretValueResponse_createdDate :: Lens' GetSecretValueResponse (Maybe UTCTime) Source #
The date and time that this version of the secret was created.
getSecretValueResponse_name :: Lens' GetSecretValueResponse (Maybe Text) Source #
The friendly name of the secret.
getSecretValueResponse_secretString :: Lens' GetSecretValueResponse (Maybe Text) Source #
The decrypted part of the protected secret information that was originally provided as a string.
If you create this secret by using the Secrets Manager console then only
the SecretString
parameter contains data. Secrets Manager stores the
information as a JSON structure of key/value pairs that the Lambda
rotation function knows how to parse.
If you store custom information in the secret by using the CreateSecret, UpdateSecret, or PutSecretValue API operations instead of the Secrets Manager console, or by using the Other secret type in the console, then you must code your Lambda rotation function to parse and interpret those values.
getSecretValueResponse_httpStatus :: Lens' GetSecretValueResponse Int Source #
The response's http status code.