blib/lib/Paws/KMS/CreateGrant.pm untested

filter: Statementstmt 0.0% 0 / 16 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 2 Podpod n/a totaltotal 0.0% 0 / 18 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1  
2 package Paws::KMS::CreateGrant;
3 use Moose;
4 has Constraints => (is => 'ro', isa => 'Paws::KMS::GrantConstraints');
5 has GranteePrincipal => (is => 'ro', isa => 'Str', required => 1);
6 has GrantTokens => (is => 'ro', isa => 'ArrayRef[Str|Undef]');
7 has KeyId => (is => 'ro', isa => 'Str', required => 1);
8 has Name => (is => 'ro', isa => 'Str');
9 has Operations => (is => 'ro', isa => 'ArrayRef[Str|Undef]', required => 1);
10 has RetiringPrincipal => (is => 'ro', isa => 'Str');
11  
12 use MooseX::ClassAttribute;
13  
14 class_has _api_call => (isa => 'Str', is => 'ro', default => 'CreateGrant');
15 class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::KMS::CreateGrantResponse');
16 class_has _result_key => (isa => 'Str', is => 'ro');
17 1;
18  
19 ### main pod documentation begin ###
20  
21 =head1 NAME
22  
23 Paws::KMS::CreateGrant - Arguments for method CreateGrant on L<Paws::KMS>
24  
25 =head1 DESCRIPTION
26  
27 This class represents the parameters used for calling the method CreateGrant on the
28 L<AWS Key Management Service|Paws::KMS> service. Use the attributes of this class
29 as arguments to method CreateGrant.
30  
31 You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to CreateGrant.
32  
33 =head1 SYNOPSIS
34  
35 my $kms = Paws->service('KMS');
36 # To create a grant
37 # The following example creates a grant that allows the specified IAM role to
38 # encrypt data with the specified customer master key (CMK).
39 my $CreateGrantResponse = $kms->CreateGrant(
40 'GranteePrincipal' => 'arn:aws:iam::111122223333:role/ExampleRole',
41 'KeyId' =>
42 'arn:aws:kms:us-east-2:444455556666:key/1234abcd-12ab-34cd-56ef-1234567890ab',
43 'Operations' => [ 'Encrypt', 'Decrypt' ]
44 );
45  
46 # Results:
47 my $GrantId = $CreateGrantResponse->GrantId;
48 my $GrantToken = $CreateGrantResponse->GrantToken;
49  
50 # Returns a L<Paws::KMS::CreateGrantResponse> 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/kms/CreateGrant>
54  
55 =head1 ATTRIBUTES
56  
57  
58 =head2 Constraints => L<Paws::KMS::GrantConstraints>
59  
60 Specifies a grant constraint.
61  
62 AWS KMS supports the C<EncryptionContextEquals> and
63 C<EncryptionContextSubset> grant constraints. Each constraint value can
64 include up to 8 encryption context pairs. The encryption context value
65 in each constraint cannot exceed 384 characters.
66  
67 These grant constraints allow a cryptographic operation
68 (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations)
69 only when the encryption context in the request matches
70 (C<EncryptionContextEquals>) or includes (C<EncryptionContextSubset>)
71 the encryption context specified in this structure. For more
72 information about encryption context, see Encryption Context
73 (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context)
74 in the I< I<AWS Key Management Service Developer Guide> >. For
75 information about grant constraints, see Using grant constraints
76 (https://docs.aws.amazon.com/kms/latest/developerguide/create-grant-overview.html#grant-constraints)
77 in the I<AWS Key Management Service Developer Guide>.
78  
79 The encryption context grant constraints are supported only on
80 operations that include an encryption context. You cannot use an
81 encryption context grant constraint for cryptographic operations with
82 asymmetric CMKs or for management operations, such as DescribeKey or
83 RetireGrant.
84  
85  
86  
87 =head2 B<REQUIRED> GranteePrincipal => Str
88  
89 The identity that gets the permissions specified in the grant.
90  
91 To specify the principal, use the Amazon Resource Name (ARN)
92 (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
93 of an AWS principal. Valid AWS principals include AWS accounts (root),
94 IAM users, IAM roles, federated users, and assumed role users. For
95 examples of the ARN syntax to use for specifying a principal, see AWS
96 Identity and Access Management (IAM)
97 (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-iam)
98 in the Example ARNs section of the I<AWS General Reference>.
99  
100  
101  
102 =head2 GrantTokens => ArrayRef[Str|Undef]
103  
104 A list of grant tokens.
105  
106 Use a grant token when your permission to call this operation comes
107 from a new grant that has not yet achieved I<eventual consistency>. For
108 more information, see Grant token
109 (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token)
110 in the I<AWS Key Management Service Developer Guide>.
111  
112  
113  
114 =head2 B<REQUIRED> KeyId => Str
115  
116 Identifies the customer master key (CMK) for the grant. The grant gives
117 principals permission to use this CMK.
118  
119 Specify the key ID or key ARN of the CMK. To specify a CMK in a
120 different AWS account, you must use the key ARN.
121  
122 For example:
123  
124 =over
125  
126 =item *
127  
128 Key ID: C<1234abcd-12ab-34cd-56ef-1234567890ab>
129  
130 =item *
131  
132 Key ARN:
133 C<arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab>
134  
135 =back
136  
137 To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
138  
139  
140  
141 =head2 Name => Str
142  
143 A friendly name for the grant. Use this value to prevent the unintended
144 creation of duplicate grants when retrying this request.
145  
146 When this value is absent, all C<CreateGrant> requests result in a new
147 grant with a unique C<GrantId> even if all the supplied parameters are
148 identical. This can result in unintended duplicates when you retry the
149 C<CreateGrant> request.
150  
151 When this value is present, you can retry a C<CreateGrant> request with
152 identical parameters; if the grant already exists, the original
153 C<GrantId> is returned without creating a new grant. Note that the
154 returned grant token is unique with every C<CreateGrant> request, even
155 when a duplicate C<GrantId> is returned. All grant tokens for the same
156 grant ID can be used interchangeably.
157  
158  
159  
160 =head2 B<REQUIRED> Operations => ArrayRef[Str|Undef]
161  
162 A list of operations that the grant permits.
163  
164 The operation must be supported on the CMK. For example, you cannot
165 create a grant for a symmetric CMK that allows the Sign operation, or a
166 grant for an asymmetric CMK that allows the GenerateDataKey operation.
167 If you try, AWS KMS returns a C<ValidationError> exception. For
168 details, see Grant operations
169 (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#terms-grant-operations)
170 in the I<AWS Key Management Service Developer Guide>.
171  
172  
173  
174 =head2 RetiringPrincipal => Str
175  
176 The principal that is given permission to retire the grant by using
177 RetireGrant operation.
178  
179 To specify the principal, use the Amazon Resource Name (ARN)
180 (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
181 of an AWS principal. Valid AWS principals include AWS accounts (root),
182 IAM users, federated users, and assumed role users. For examples of the
183 ARN syntax to use for specifying a principal, see AWS Identity and
184 Access Management (IAM)
185 (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-iam)
186 in the Example ARNs section of the I<AWS General Reference>.
187  
188  
189  
190  
191 =head1 SEE ALSO
192  
193 This class forms part of L<Paws>, documenting arguments for method CreateGrant in L<Paws::KMS>
194  
195 =head1 BUGS and CONTRIBUTIONS
196  
197 The source code is located here: L<https://github.com/pplu/aws-sdk-perl>
198  
199 Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues>
200  
201 =cut
202