« blib/lib/Paws/SecretsManager/RestoreSecretResponse.pm
↑ Summary
blib/lib/Paws/SecretsManager/RotateSecretResponse.pm »
| 1 | |||
| 2 | package Paws::SecretsManager::RotateSecret; | ||
| 3 | use Moose; | ||
| 4 | has ClientRequestToken => (is => 'ro', isa => 'Str'); | ||
| 5 | has RotationLambdaARN => (is => 'ro', isa => 'Str'); | ||
| 6 | has RotationRules => (is => 'ro', isa => 'Paws::SecretsManager::RotationRulesType'); | ||
| 7 | has SecretId => (is => 'ro', isa => 'Str', required => 1); | ||
| 8 | |||
| 9 | use MooseX::ClassAttribute; | ||
| 10 | |||
| 11 | class_has _api_call => (isa => 'Str', is => 'ro', default => 'RotateSecret'); | ||
| 12 | class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::SecretsManager::RotateSecretResponse'); | ||
| 13 | class_has _result_key => (isa => 'Str', is => 'ro'); | ||
| 14 | 1; | ||
| 15 | |||
| 16 | ### main pod documentation begin ### | ||
| 17 | |||
| 18 | =head1 NAME | ||
| 19 | |||
| 20 | Paws::SecretsManager::RotateSecret - Arguments for method RotateSecret on L<Paws::SecretsManager> | ||
| 21 | |||
| 22 | =head1 DESCRIPTION | ||
| 23 | |||
| 24 | This class represents the parameters used for calling the method RotateSecret on the | ||
| 25 | L<AWS Secrets Manager|Paws::SecretsManager> service. Use the attributes of this class | ||
| 26 | as arguments to method RotateSecret. | ||
| 27 | |||
| 28 | You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to RotateSecret. | ||
| 29 | |||
| 30 | =head1 SYNOPSIS | ||
| 31 | |||
| 32 | my $secretsmanager = Paws->service('SecretsManager'); | ||
| 33 | # To configure rotation for a secret | ||
| 34 | # The following example configures rotation for a secret by providing the ARN of | ||
| 35 | # a Lambda rotation function (which must already exist) and the number of days | ||
| 36 | # between rotation. The first rotation happens immediately upon completion of | ||
| 37 | # this command. The rotation function runs asynchronously in the background. | ||
| 38 | my $RotateSecretResponse = $secretsmanager->RotateSecret( | ||
| 39 | 'RotationLambdaARN' => | ||
| 40 | 'arn:aws:lambda:us-west-2:123456789012:function:MyTestDatabaseRotationLambda', | ||
| 41 | 'RotationRules' => { | ||
| 42 | 'AutomaticallyAfterDays' => 30 | ||
| 43 | }, | ||
| 44 | 'SecretId' => 'MyTestDatabaseSecret' | ||
| 45 | ); | ||
| 46 | |||
| 47 | # Results: | ||
| 48 | my $ARN = $RotateSecretResponse->ARN; | ||
| 49 | my $Name = $RotateSecretResponse->Name; | ||
| 50 | my $VersionId = $RotateSecretResponse->VersionId; | ||
| 51 | |||
| 52 | # Returns a L<Paws::SecretsManager::RotateSecretResponse> object. | ||
| 53 | |||
| 54 | 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. | ||
| 55 | For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/secretsmanager/RotateSecret> | ||
| 56 | |||
| 57 | =head1 ATTRIBUTES | ||
| 58 | |||
| 59 | |||
| 60 | =head2 ClientRequestToken => Str | ||
| 61 | |||
| 62 | (Optional) Specifies a unique identifier for the new version of the | ||
| 63 | secret that helps ensure idempotency. | ||
| 64 | |||
| 65 | If you use the AWS CLI or one of the AWS SDK to call this operation, | ||
| 66 | then you can leave this parameter empty. The CLI or SDK generates a | ||
| 67 | random UUID for you and includes that in the request for this | ||
| 68 | parameter. If you don't use the SDK and instead generate a raw HTTP | ||
| 69 | request to the Secrets Manager service endpoint, then you must generate | ||
| 70 | a C<ClientRequestToken> yourself for new versions and include that | ||
| 71 | value in the request. | ||
| 72 | |||
| 73 | You only need to specify your own value if you implement your own retry | ||
| 74 | logic and want to ensure that a given secret is not created twice. We | ||
| 75 | recommend that you generate a UUID-type | ||
| 76 | (https://wikipedia.org/wiki/Universally_unique_identifier) value to | ||
| 77 | ensure uniqueness within the specified secret. | ||
| 78 | |||
| 79 | Secrets Manager uses this value to prevent the accidental creation of | ||
| 80 | duplicate versions if there are failures and retries during the | ||
| 81 | function's processing. This value becomes the C<VersionId> of the new | ||
| 82 | version. | ||
| 83 | |||
| 84 | |||
| 85 | |||
| 86 | =head2 RotationLambdaARN => Str | ||
| 87 | |||
| 88 | (Optional) Specifies the ARN of the Lambda function that can rotate the | ||
| 89 | secret. | ||
| 90 | |||
| 91 | |||
| 92 | |||
| 93 | =head2 RotationRules => L<Paws::SecretsManager::RotationRulesType> | ||
| 94 | |||
| 95 | A structure that defines the rotation configuration for this secret. | ||
| 96 | |||
| 97 | |||
| 98 | |||
| 99 | =head2 B<REQUIRED> SecretId => Str | ||
| 100 | |||
| 101 | Specifies the secret that you want to rotate. You can specify either | ||
| 102 | the Amazon Resource Name (ARN) or the friendly name of the secret. | ||
| 103 | |||
| 104 | If you specify an ARN, we generally recommend that you specify a | ||
| 105 | complete ARN. You can specify a partial ARN tooE<mdash>for example, if | ||
| 106 | you donE<rsquo>t include the final hyphen and six random characters | ||
| 107 | that Secrets Manager adds at the end of the ARN when you created the | ||
| 108 | secret. A partial ARN match can work as long as it uniquely matches | ||
| 109 | only one secret. However, if your secret has a name that ends in a | ||
| 110 | hyphen followed by six characters (before Secrets Manager adds the | ||
| 111 | hyphen and six characters to the ARN) and you try to use that as a | ||
| 112 | partial ARN, then those characters cause Secrets Manager to assume that | ||
| 113 | youE<rsquo>re specifying a complete ARN. This confusion can cause | ||
| 114 | unexpected results. To avoid this situation, we recommend that you | ||
| 115 | donE<rsquo>t create secret names ending with a hyphen followed by six | ||
| 116 | characters. | ||
| 117 | |||
| 118 | If you specify an incomplete ARN without the random suffix, and instead | ||
| 119 | provide the 'friendly name', you I<must> not include the random suffix. | ||
| 120 | If you do include the random suffix added by Secrets Manager, you | ||
| 121 | receive either a I<ResourceNotFoundException> or an | ||
| 122 | I<AccessDeniedException> error, depending on your permissions. | ||
| 123 | |||
| 124 | |||
| 125 | |||
| 126 | |||
| 127 | =head1 SEE ALSO | ||
| 128 | |||
| 129 | This class forms part of L<Paws>, documenting arguments for method RotateSecret in L<Paws::SecretsManager> | ||
| 130 | |||
| 131 | =head1 BUGS and CONTRIBUTIONS | ||
| 132 | |||
| 133 | The source code is located here: L<https://github.com/pplu/aws-sdk-perl> | ||
| 134 | |||
| 135 | Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues> | ||
| 136 | |||
| 137 | =cut | ||
| 138 |