« blib/lib/Paws/SecretsManager/GetResourcePolicyResponse.pm
↑ Summary
blib/lib/Paws/SecretsManager/GetSecretValueResponse.pm »
| 1 | |||
| 2 | package Paws::SecretsManager::GetSecretValue; | ||
| 3 | use Moose; | ||
| 4 | has SecretId => (is => 'ro', isa => 'Str', required => 1); | ||
| 5 | has VersionId => (is => 'ro', isa => 'Str'); | ||
| 6 | has VersionStage => (is => 'ro', isa => 'Str'); | ||
| 7 | |||
| 8 | use MooseX::ClassAttribute; | ||
| 9 | |||
| 10 | class_has _api_call => (isa => 'Str', is => 'ro', default => 'GetSecretValue'); | ||
| 11 | class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::SecretsManager::GetSecretValueResponse'); | ||
| 12 | class_has _result_key => (isa => 'Str', is => 'ro'); | ||
| 13 | 1; | ||
| 14 | |||
| 15 | ### main pod documentation begin ### | ||
| 16 | |||
| 17 | =head1 NAME | ||
| 18 | |||
| 19 | Paws::SecretsManager::GetSecretValue - Arguments for method GetSecretValue on L<Paws::SecretsManager> | ||
| 20 | |||
| 21 | =head1 DESCRIPTION | ||
| 22 | |||
| 23 | This class represents the parameters used for calling the method GetSecretValue on the | ||
| 24 | L<AWS Secrets Manager|Paws::SecretsManager> service. Use the attributes of this class | ||
| 25 | as arguments to method GetSecretValue. | ||
| 26 | |||
| 27 | You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to GetSecretValue. | ||
| 28 | |||
| 29 | =head1 SYNOPSIS | ||
| 30 | |||
| 31 | my $secretsmanager = Paws->service('SecretsManager'); | ||
| 32 | # To retrieve the encrypted secret value of a secret | ||
| 33 | # The following example shows how to retrieve the secret string value from the | ||
| 34 | # version of the secret that has the AWSPREVIOUS staging label attached. If you | ||
| 35 | # want to retrieve the AWSCURRENT version of the secret, then you can omit the | ||
| 36 | # VersionStage parameter because it defaults to AWSCURRENT. | ||
| 37 | my $GetSecretValueResponse = $secretsmanager->GetSecretValue( | ||
| 38 | 'SecretId' => 'MyTestDatabaseSecret', | ||
| 39 | 'VersionStage' => 'AWSPREVIOUS' | ||
| 40 | ); | ||
| 41 | |||
| 42 | # Results: | ||
| 43 | my $ARN = $GetSecretValueResponse->ARN; | ||
| 44 | my $CreatedDate = $GetSecretValueResponse->CreatedDate; | ||
| 45 | my $Name = $GetSecretValueResponse->Name; | ||
| 46 | my $SecretString = $GetSecretValueResponse->SecretString; | ||
| 47 | my $VersionId = $GetSecretValueResponse->VersionId; | ||
| 48 | my $VersionStages = $GetSecretValueResponse->VersionStages; | ||
| 49 | |||
| 50 | # Returns a L<Paws::SecretsManager::GetSecretValueResponse> object. | ||
| 51 | |||
| 52 | Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object. | ||
| 53 | For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/secretsmanager/GetSecretValue> | ||
| 54 | |||
| 55 | =head1 ATTRIBUTES | ||
| 56 | |||
| 57 | |||
| 58 | =head2 B<REQUIRED> SecretId => Str | ||
| 59 | |||
| 60 | Specifies the secret containing the version that you want to retrieve. | ||
| 61 | You can specify either the Amazon Resource Name (ARN) or the friendly | ||
| 62 | name of the secret. | ||
| 63 | |||
| 64 | If you specify an ARN, we generally recommend that you specify a | ||
| 65 | complete ARN. You can specify a partial ARN tooE<mdash>for example, if | ||
| 66 | you donE<rsquo>t include the final hyphen and six random characters | ||
| 67 | that Secrets Manager adds at the end of the ARN when you created the | ||
| 68 | secret. A partial ARN match can work as long as it uniquely matches | ||
| 69 | only one secret. However, if your secret has a name that ends in a | ||
| 70 | hyphen followed by six characters (before Secrets Manager adds the | ||
| 71 | hyphen and six characters to the ARN) and you try to use that as a | ||
| 72 | partial ARN, then those characters cause Secrets Manager to assume that | ||
| 73 | youE<rsquo>re specifying a complete ARN. This confusion can cause | ||
| 74 | unexpected results. To avoid this situation, we recommend that you | ||
| 75 | donE<rsquo>t create secret names ending with a hyphen followed by six | ||
| 76 | characters. | ||
| 77 | |||
| 78 | If you specify an incomplete ARN without the random suffix, and instead | ||
| 79 | provide the 'friendly name', you I<must> not include the random suffix. | ||
| 80 | If you do include the random suffix added by Secrets Manager, you | ||
| 81 | receive either a I<ResourceNotFoundException> or an | ||
| 82 | I<AccessDeniedException> error, depending on your permissions. | ||
| 83 | |||
| 84 | |||
| 85 | |||
| 86 | =head2 VersionId => Str | ||
| 87 | |||
| 88 | Specifies the unique identifier of the version of the secret that you | ||
| 89 | want to retrieve. If you specify both this parameter and | ||
| 90 | C<VersionStage>, the two parameters must refer to the same secret | ||
| 91 | version. If you don't specify either a C<VersionStage> or C<VersionId> | ||
| 92 | then the default is to perform the operation on the version with the | ||
| 93 | C<VersionStage> value of C<AWSCURRENT>. | ||
| 94 | |||
| 95 | This value is typically a UUID-type | ||
| 96 | (https://wikipedia.org/wiki/Universally_unique_identifier) value with | ||
| 97 | 32 hexadecimal digits. | ||
| 98 | |||
| 99 | |||
| 100 | |||
| 101 | =head2 VersionStage => Str | ||
| 102 | |||
| 103 | Specifies the secret version that you want to retrieve by the staging | ||
| 104 | label attached to the version. | ||
| 105 | |||
| 106 | Staging labels are used to keep track of different versions during the | ||
| 107 | rotation process. If you specify both this parameter and C<VersionId>, | ||
| 108 | the two parameters must refer to the same secret version . If you don't | ||
| 109 | specify either a C<VersionStage> or C<VersionId>, then the default is | ||
| 110 | to perform the operation on the version with the C<VersionStage> value | ||
| 111 | of C<AWSCURRENT>. | ||
| 112 | |||
| 113 | |||
| 114 | |||
| 115 | |||
| 116 | =head1 SEE ALSO | ||
| 117 | |||
| 118 | This class forms part of L<Paws>, documenting arguments for method GetSecretValue in L<Paws::SecretsManager> | ||
| 119 | |||
| 120 | =head1 BUGS and CONTRIBUTIONS | ||
| 121 | |||
| 122 | The source code is located here: L<https://github.com/pplu/aws-sdk-perl> | ||
| 123 | |||
| 124 | Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues> | ||
| 125 | |||
| 126 | =cut | ||
| 127 |