« blib/lib/Paws/SecretsManager/ListSecretsResponse.pm
↑ Summary
blib/lib/Paws/SecretsManager/PutResourcePolicyResponse.pm »
| 1 | |||
| 2 | package Paws::SecretsManager::PutResourcePolicy; | ||
| 3 | use Moose; | ||
| 4 | has BlockPublicPolicy => (is => 'ro', isa => 'Bool'); | ||
| 5 | has ResourcePolicy => (is => 'ro', isa => 'Str', required => 1); | ||
| 6 | has SecretId => (is => 'ro', isa => 'Str', required => 1); | ||
| 7 | |||
| 8 | use MooseX::ClassAttribute; | ||
| 9 | |||
| 10 | class_has _api_call => (isa => 'Str', is => 'ro', default => 'PutResourcePolicy'); | ||
| 11 | class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::SecretsManager::PutResourcePolicyResponse'); | ||
| 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::PutResourcePolicy - Arguments for method PutResourcePolicy on L<Paws::SecretsManager> | ||
| 20 | |||
| 21 | =head1 DESCRIPTION | ||
| 22 | |||
| 23 | This class represents the parameters used for calling the method PutResourcePolicy on the | ||
| 24 | L<AWS Secrets Manager|Paws::SecretsManager> service. Use the attributes of this class | ||
| 25 | as arguments to method PutResourcePolicy. | ||
| 26 | |||
| 27 | You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to PutResourcePolicy. | ||
| 28 | |||
| 29 | =head1 SYNOPSIS | ||
| 30 | |||
| 31 | my $secretsmanager = Paws->service('SecretsManager'); | ||
| 32 | # To add a resource-based policy to a secret | ||
| 33 | # The following example shows how to add a resource-based policy to a secret. | ||
| 34 | my $PutResourcePolicyResponse = $secretsmanager->PutResourcePolicy( | ||
| 35 | 'ResourcePolicy' => '{ | ||
| 36 | "Version":"2012-10-17", | ||
| 37 | "Statement":[{ | ||
| 38 | "Effect":"Allow", | ||
| 39 | "Principal":{ | ||
| 40 | "AWS":"arn:aws:iam::123456789012:root" | ||
| 41 | }, | ||
| 42 | "Action":"secretsmanager:GetSecretValue", | ||
| 43 | "Resource":"*" | ||
| 44 | }] | ||
| 45 | }', | ||
| 46 | 'SecretId' => 'MyTestDatabaseSecret' | ||
| 47 | ); | ||
| 48 | |||
| 49 | # Results: | ||
| 50 | my $ARN = $PutResourcePolicyResponse->ARN; | ||
| 51 | my $Name = $PutResourcePolicyResponse->Name; | ||
| 52 | |||
| 53 | # Returns a L<Paws::SecretsManager::PutResourcePolicyResponse> object. | ||
| 54 | |||
| 55 | 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. | ||
| 56 | For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/secretsmanager/PutResourcePolicy> | ||
| 57 | |||
| 58 | =head1 ATTRIBUTES | ||
| 59 | |||
| 60 | |||
| 61 | =head2 BlockPublicPolicy => Bool | ||
| 62 | |||
| 63 | (Optional) If you set the parameter, C<BlockPublicPolicy> to true, then | ||
| 64 | you block resource-based policies that allow broad access to the | ||
| 65 | secret. | ||
| 66 | |||
| 67 | |||
| 68 | |||
| 69 | =head2 B<REQUIRED> ResourcePolicy => Str | ||
| 70 | |||
| 71 | A JSON-formatted string constructed according to the grammar and syntax | ||
| 72 | for an AWS resource-based policy. The policy in the string identifies | ||
| 73 | who can access or manage this secret and its versions. For information | ||
| 74 | on how to format a JSON parameter for the various command line tool | ||
| 75 | environments, see Using JSON for Parameters | ||
| 76 | (http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json) | ||
| 77 | in the I<AWS CLI User Guide>. | ||
| 78 | |||
| 79 | |||
| 80 | |||
| 81 | =head2 B<REQUIRED> SecretId => Str | ||
| 82 | |||
| 83 | Specifies the secret that you want to attach the resource-based policy. | ||
| 84 | You can specify either the ARN or the friendly name of the secret. | ||
| 85 | |||
| 86 | If you specify an ARN, we generally recommend that you specify a | ||
| 87 | complete ARN. You can specify a partial ARN tooE<mdash>for example, if | ||
| 88 | you donE<rsquo>t include the final hyphen and six random characters | ||
| 89 | that Secrets Manager adds at the end of the ARN when you created the | ||
| 90 | secret. A partial ARN match can work as long as it uniquely matches | ||
| 91 | only one secret. However, if your secret has a name that ends in a | ||
| 92 | hyphen followed by six characters (before Secrets Manager adds the | ||
| 93 | hyphen and six characters to the ARN) and you try to use that as a | ||
| 94 | partial ARN, then those characters cause Secrets Manager to assume that | ||
| 95 | youE<rsquo>re specifying a complete ARN. This confusion can cause | ||
| 96 | unexpected results. To avoid this situation, we recommend that you | ||
| 97 | donE<rsquo>t create secret names ending with a hyphen followed by six | ||
| 98 | characters. | ||
| 99 | |||
| 100 | If you specify an incomplete ARN without the random suffix, and instead | ||
| 101 | provide the 'friendly name', you I<must> not include the random suffix. | ||
| 102 | If you do include the random suffix added by Secrets Manager, you | ||
| 103 | receive either a I<ResourceNotFoundException> or an | ||
| 104 | I<AccessDeniedException> error, depending on your permissions. | ||
| 105 | |||
| 106 | |||
| 107 | |||
| 108 | |||
| 109 | =head1 SEE ALSO | ||
| 110 | |||
| 111 | This class forms part of L<Paws>, documenting arguments for method PutResourcePolicy in L<Paws::SecretsManager> | ||
| 112 | |||
| 113 | =head1 BUGS and CONTRIBUTIONS | ||
| 114 | |||
| 115 | The source code is located here: L<https://github.com/pplu/aws-sdk-perl> | ||
| 116 | |||
| 117 | Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues> | ||
| 118 | |||
| 119 | =cut | ||
| 120 |