File Coverage

blib/lib/Paws/Lambda/AddPermission.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1              
2             package Paws::Lambda::AddPermission;
3 1     1   519 use Moose;
  1         2  
  1         8  
4             has Action => (is => 'ro', isa => 'Str', required => 1);
5             has EventSourceToken => (is => 'ro', isa => 'Str');
6             has FunctionName => (is => 'ro', isa => 'Str', traits => ['ParamInURI'], uri_name => 'FunctionName' , required => 1);
7             has Principal => (is => 'ro', isa => 'Str', required => 1);
8             has Qualifier => (is => 'ro', isa => 'Str', traits => ['ParamInQuery'], query_name => 'Qualifier' );
9             has SourceAccount => (is => 'ro', isa => 'Str');
10             has SourceArn => (is => 'ro', isa => 'Str');
11             has StatementId => (is => 'ro', isa => 'Str', required => 1);
12              
13 1     1   6587 use MooseX::ClassAttribute;
  1         3  
  1         11  
14              
15             class_has _api_call => (isa => 'Str', is => 'ro', default => 'AddPermission');
16             class_has _api_uri => (isa => 'Str', is => 'ro', default => '/2015-03-31/functions/{FunctionName}/policy');
17             class_has _api_method => (isa => 'Str', is => 'ro', default => 'POST');
18             class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::Lambda::AddPermissionResponse');
19             class_has _result_key => (isa => 'Str', is => 'ro');
20             1;
21              
22             ### main pod documentation begin ###
23              
24             =head1 NAME
25              
26             Paws::Lambda::AddPermission - Arguments for method AddPermission on Paws::Lambda
27              
28             =head1 DESCRIPTION
29              
30             This class represents the parameters used for calling the method AddPermission on the
31             AWS Lambda service. Use the attributes of this class
32             as arguments to method AddPermission.
33              
34             You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to AddPermission.
35              
36             As an example:
37              
38             $service_obj->AddPermission(Att1 => $value1, Att2 => $value2, ...);
39              
40             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.
41              
42             =head1 ATTRIBUTES
43              
44              
45             =head2 B<REQUIRED> Action => Str
46              
47             The AWS Lambda action you want to allow in this statement. Each Lambda
48             action is a string starting with C<lambda:> followed by the API name .
49             For example, C<lambda:CreateFunction>. You can use wildcard
50             (C<lambda:*>) to grant permission for all AWS Lambda actions.
51              
52              
53              
54             =head2 EventSourceToken => Str
55              
56             A unique token that must be supplied by the principal invoking the
57             function. This is currently only used for Alexa Smart Home functions.
58              
59              
60              
61             =head2 B<REQUIRED> FunctionName => Str
62              
63             Name of the Lambda function whose resource policy you are updating by
64             adding a new permission.
65              
66             You can specify a function name (for example, C<Thumbnail>) or you can
67             specify Amazon Resource Name (ARN) of the function (for example,
68             C<arn:aws:lambda:us-west-2:account-id:function:ThumbNail>). AWS Lambda
69             also allows you to specify partial ARN (for example,
70             C<account-id:Thumbnail>). Note that the length constraint applies only
71             to the ARN. If you specify only the function name, it is limited to 64
72             characters in length.
73              
74              
75              
76             =head2 B<REQUIRED> Principal => Str
77              
78             The principal who is getting this permission. It can be Amazon S3
79             service Principal (C<s3.amazonaws.com>) if you want Amazon S3 to invoke
80             the function, an AWS account ID if you are granting cross-account
81             permission, or any valid AWS service principal such as
82             C<sns.amazonaws.com>. For example, you might want to allow a custom
83             application in another AWS account to push events to AWS Lambda by
84             invoking your function.
85              
86              
87              
88             =head2 Qualifier => Str
89              
90             You can use this optional query parameter to describe a qualified ARN
91             using a function version or an alias name. The permission will then
92             apply to the specific qualified ARN. For example, if you specify
93             function version 2 as the qualifier, then permission applies only when
94             request is made using qualified function ARN:
95              
96             C<arn:aws:lambda:aws-region:acct-id:function:function-name:2>
97              
98             If you specify an alias name, for example C<PROD>, then the permission
99             is valid only for requests made using the alias ARN:
100              
101             C<arn:aws:lambda:aws-region:acct-id:function:function-name:PROD>
102              
103             If the qualifier is not specified, the permission is valid only when
104             requests is made using unqualified function ARN.
105              
106             C<arn:aws:lambda:aws-region:acct-id:function:function-name>
107              
108              
109              
110             =head2 SourceAccount => Str
111              
112             This parameter is used for S3 and SES. The AWS account ID (without a
113             hyphen) of the source owner. For example, if the C<SourceArn>
114             identifies a bucket, then this is the bucket owner's account ID. You
115             can use this additional condition to ensure the bucket you specify is
116             owned by a specific account (it is possible the bucket owner deleted
117             the bucket and some other AWS account created the bucket). You can also
118             use this condition to specify all sources (that is, you don't specify
119             the C<SourceArn>) owned by a specific account.
120              
121              
122              
123             =head2 SourceArn => Str
124              
125             This is optional; however, when granting permission to invoke your
126             function, you should specify this field with the Amazon Resource Name
127             (ARN) as its value. This ensures that only events generated from the
128             specified source can invoke the function.
129              
130             If you add a permission without providing the source ARN, any AWS
131             account that creates a mapping to your function ARN can send events to
132             invoke your Lambda function.
133              
134              
135              
136             =head2 B<REQUIRED> StatementId => Str
137              
138             A unique statement identifier.
139              
140              
141              
142              
143             =head1 SEE ALSO
144              
145             This class forms part of L<Paws>, documenting arguments for method AddPermission in L<Paws::Lambda>
146              
147             =head1 BUGS and CONTRIBUTIONS
148              
149             The source code is located here: https://github.com/pplu/aws-sdk-perl
150              
151             Please report bugs to: https://github.com/pplu/aws-sdk-perl/issues
152              
153             =cut
154