public void LambdaAddPermission()
        {
            #region add-permission-1474651469455

            var response = client.AddPermission(new AddPermissionRequest
            {
                Action        = "lambda:InvokeFunction",
                FunctionName  = "my-function",
                Principal     = "s3.amazonaws.com",
                SourceAccount = "123456789012",
                SourceArn     = "arn:aws:s3:::my-bucket-1xpuxmplzrlbh/*",
                StatementId   = "s3"
            });

            string statement = response.Statement;

            #endregion
        }
Exemple #2
0
 private Amazon.Lambda.Model.AddPermissionResponse CallAWSServiceOperation(IAmazonLambda client, Amazon.Lambda.Model.AddPermissionRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Lambda", "AddPermission");
     try
     {
         #if DESKTOP
         return(client.AddPermission(request));
         #elif CORECLR
         return(client.AddPermissionAsync(request).GetAwaiter().GetResult());
         #else
                 #error "Unknown build edition"
         #endif
     }
     catch (AmazonServiceException exc)
     {
         var webException = exc.InnerException as System.Net.WebException;
         if (webException != null)
         {
             throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
         }
         throw;
     }
 }