Class Fog::AWS::Lambda::Real
In: lib/fog/aws/requests/lambda/add_permission.rb
lib/fog/aws/requests/lambda/invoke.rb
lib/fog/aws/requests/lambda/list_functions.rb
lib/fog/aws/requests/lambda/update_function_code.rb
lib/fog/aws/requests/lambda/delete_function.rb
lib/fog/aws/requests/lambda/delete_event_source_mapping.rb
lib/fog/aws/requests/lambda/create_event_source_mapping.rb
lib/fog/aws/requests/lambda/get_function.rb
lib/fog/aws/requests/lambda/get_event_source_mapping.rb
lib/fog/aws/requests/lambda/remove_permission.rb
lib/fog/aws/requests/lambda/get_function_configuration.rb
lib/fog/aws/requests/lambda/list_event_source_mappings.rb
lib/fog/aws/requests/lambda/update_function_configuration.rb
lib/fog/aws/requests/lambda/create_function.rb
lib/fog/aws/requests/lambda/get_policy.rb
lib/fog/aws/requests/lambda/update_event_source_mapping.rb
lib/fog/aws/lambda.rb
Parent: Object

Methods

Included Modules

Fog::AWS::CredentialFetcher::ConnectionMethods

Attributes

region  [R] 

Public Class methods

Initialize connection to Lambda

Notes

options parameter must include values for :aws_access_key_id and :aws_secret_access_key in order to create a connection

Examples

  lambda = Lambda.new(
   :aws_access_key_id => your_aws_access_key_id,
   :aws_secret_access_key => your_aws_secret_access_key
  )

Parameters

  • options<~Hash> - config arguments for connection. Defaults to {}.

Returns

Public Instance methods

Adds a permission to the access policy associated with the specified AWS Lambda function. docs.aws.amazon.com/lambda/latest/dg/API_AddPermission.html

Parameters

  • FunctionName <~String> - Name of the Lambda function whose access policy you are updating by adding a new permission.
  • Action <~String> - AWS Lambda action you want to allow in this statement.
  • Principal <~String> - principal who is getting this permission.
  • SourceAccount <~String> - AWS account ID (without a hyphen) of the source owner.
  • SourceArn <~String> - Amazon Resource Name (ARN) of the source resource to assign permissions.
  • StatemendId. <~String> - unique statement identifier.

Returns

  • response<~Excon::Response>:
    • body<~Hash>:
      • ‘Statement’ <~Hash> - permission statement you specified in the request.

Identifies a stream as an event source for a Lambda function. docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html

Parameters

  • BatchSize <~Integer> - largest number of records that AWS Lambda will retrieve from your event source at the time of invoking your function.
  • Enabled <~Boolean> - indicates whether AWS Lambda should begin polling the event source.
  • EventSourceArn <~String> - Amazon Resource Name (ARN) of the stream that is the event source
  • FunctionName <~String> - Lambda function to invoke when AWS Lambda detects an event on the stream.
  • StartingPosition <~String> - position in the stream where AWS Lambda should start reading.

Returns

  • response<~Excon::Response>:
    • body<~Hash>:
      • ‘BatchSize’ <~Integer> - largest number of records that AWS Lambda will retrieve from your event source at the time of invoking your function.
      • ‘EventSourceArn’ <~String> - Amazon Resource Name (ARN) of the stream that is the source of events.
      • ‘FunctionArn’ <~String> - Lambda function to invoke when AWS Lambda detects an event on the stream.
      • ‘LastModified’ <~Time> - UTC time string indicating the last time the event mapping was updated.
      • ‘LastProcessingResult’ <~String> - result of the last AWS Lambda invocation of your Lambda function.
      • ‘State’ <~String> - state of the event source mapping.
      • ‘StateTransitionReason’ <~String> - reason the event source mapping is in its current state.
      • ‘UUID’ <~String> - AWS Lambda assigned opaque identifier for the mapping.

Creates a new Lambda function. docs.aws.amazon.com/lambda/latest/dg/API_CreateFunction.html

Parameters

  • Code <~Hash> - code for the Lambda function.
  • Description <~String> - short, user-defined function description.
  • FunctionName <~String> - name you want to assign to the function you are uploading.
  • Handler <~String> - function within your code that Lambda calls to begin execution.
  • MemorySize <~Integer> - amount of memory, in MB, your Lambda function is given.
  • Role <~String> - ARN of the IAM role that Lambda assumes when it executes your function to access any other AWS resources.
  • Runtime <~String> - runtime environment for the Lambda function you are uploading.
  • Timeout <~Integer> - function execution time at which Lambda should terminate the function.

Returns

  • response<~Excon::Response>:
    • body<~Hash>:
      • ‘CodeSize’ <~Integer> - size, in bytes, of the function .zip file you uploaded.
      • ‘Description’ <~String> - user-provided description.
      • ‘FunctionArn’ <~String> - Amazon Resource Name (ARN) assigned to the function.
      • ‘FunctionName’ <~String> - name of the function.
      • ‘Handler’ <~String> - function Lambda calls to begin executing your function.
      • ‘LastModified’ <~Time> - timestamp of the last time you updated the function.
      • ‘MemorySize’ <~Integer> - memory size, in MB, you configured for the function.
      • ‘Role’ <~String> - ARN of the IAM role that Lambda assumes when it executes your function to access any other AWS resources.
      • ‘Runtime’ <~String> - runtime environment for the Lambda function.
      • ‘Timeout’ <~Integer> - function execution time at which Lambda should terminate the function.

Removes an event source mapping. docs.aws.amazon.com/lambda/latest/dg/API_DeleteEventSourceMapping.html

Parameters

  • UUID <~String> - event source mapping ID.

Returns

  • response<~Excon::Response>:
    • body<~String>:

Deletes the specified Lambda function code and configuration. docs.aws.amazon.com/lambda/latest/dg/API_DeleteFunction.html

Parameters

  • FunctionName <~String> - Lambda function to delete.

Returns

  • response<~Excon::Response>:
    • body<~String>:

Returns configuration information for the specified event source mapping. docs.aws.amazon.com/lambda/latest/dg/API_GetEventSourceMapping.html

Parameters

  • UUID <~String> - AWS Lambda assigned ID of the event source mapping.

Returns

  • response<~Excon::Response>:
    • body<~Hash>:
      • ‘BatchSize’ <~Integer> - largest number of records that AWS Lambda will retrieve from your event source at the time of invoking your function.
      • ‘EventSourceArn’ <~String> - Amazon Resource Name (ARN) of the stream that is the source of events.
      • ‘FunctionArn’ <~String> - Lambda function to invoke when AWS Lambda detects an event on the stream.
      • ‘LastModified’ <~Time> - UTC time string indicating the last time the event mapping was updated.
      • ‘LastProcessingResult’ <~String> - result of the last AWS Lambda invocation of your Lambda function.
      • ‘State’ <~String> - state of the event source mapping.
      • ‘StateTransitionReason’ <~String> - reason the event source mapping is in its current state.
      • ‘UUID’ <~String> - AWS Lambda assigned opaque identifier for the mapping.
      • ‘Code’ <~Hash> - object for the Lambda function location.
      • ‘Configuration’ <~Hash> - function metadata description.

Returns the configuration information of the Lambda function. docs.aws.amazon.com/lambda/latest/dg/API_GetFunction.html

Parameters

  • FunctionName <~String> - Lambda function name.

Returns

  • response<~Excon::Response>:
    • body<~Hash>:
      • ‘Code’ <~Hash> - object for the Lambda function location.
      • ‘Configuration’ <~Hash> - function metadata description.

Returns the configuration information of the Lambda function. docs.aws.amazon.com/lambda/latest/dg/API_GetFunction.html

Parameters

  • FunctionName <~String> - Lambda function name.

Returns

  • response<~Excon::Response>:
    • body<~Hash>:
      • ‘CodeSize’ <~Integer> - size, in bytes, of the function .zip file you uploaded.
      • ‘Description’ <~String> - user-provided description.
      • ‘FunctionArn’ <~String> - Amazon Resource Name (ARN) assigned to the function.
      • ‘FunctionName’ <~String> - name of the function.
      • ‘Handler’ <~String> - function Lambda calls to begin executing your function.
      • ‘LastModified’ <~Time> - timestamp of the last time you updated the function.
      • ‘Memorysize’ <~String> - memory size, in MB, you configured for the function.
      • ‘Role’ <~String> - ARN of the IAM role that Lambda assumes when it executes your function to access any other AWS resources.
      • ‘Runtime’ <~String> - runtime environment for the Lambda function.
      • ‘Timeout’ <~Integer> - function execution time at which Lambda should terminate the function.

Returns the access policy, containing a list of permissions granted via the AddPermission API, associated with the specified bucket. docs.aws.amazon.com/lambda/latest/dg/API_GetPolicy.html

Parameters

  • FunctionName <~String> - Function name whose access policy you want to retrieve.

Returns

  • response<~Excon::Response>:
    • body<~Hash>:
      • ‘Policy’ <~Hash> - The access policy associated with the specified function.

Invokes a specified Lambda function. docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html

Parameters

  • ClientContext <~Hash> - client-specific information to the Lambda function you are invoking.
  • FunctionName <~String> - Lambda function name.
  • InvocationType <~String> - function invocation type.
  • LogType <~String> - logs format for function calls of "RequestResponse" invocation type.
  • Payload <~Integer> - Lambda function input.

Returns

  • response<~Excon::Response>:
    • body<~Hash> - JSON representation of the object returned by the Lambda function.

Returns a list of event source mappings where you can identify a stream as an event source. docs.aws.amazon.com/lambda/latest/dg/API_ListEventSourceMappings.html

Parameters

  • EventSourceArn <~String> - Amazon Resource Name (ARN) of the stream.
  • FunctionName <~String> - name of the Lambda function.
  • Marker <~String> - opaque pagination token returned from a previous ListEventSourceMappings operation.
  • MaxItems <~Integer> - maximum number of event sources to return in response.

Returns

  • response<~Excon::Response>:
    • body<~Hash>:
      • ‘EventSourceMappings’ <~Array> - array of EventSourceMappingConfiguration objects.
      • ‘NextMarker’ <~String> - present if there are more event source mappings.

Returns a list of your Lambda functions. docs.aws.amazon.com/lambda/latest/dg/API_ListFunctions.html

Parameters

  • Marker <~String> - opaque pagination token returned from a previous ListFunctions operation. If present, indicates where to continue the listing.
  • MaxItems <~Integer> - Specifies the maximum number of AWS Lambda functions to return in response.

Returns

  • response<~Excon::Response>:
    • body<~Hash>:
      • ‘Functions’ <~Array> - list of Lambda functions.
      • ‘NextMarker’ <~String> - present if there are more functions.

Remove individual permissions from an access policy associated with a Lambda function by providing a Statement ID. docs.aws.amazon.com/lambda/latest/dg/API_RemovePermission.html

Parameters

  • FunctionName <~String> - Lambda function whose access policy you want to remove a permission from.
  • StatementId <~String> - Statement ID of the permission to remove.

Returns

  • response<~Excon::Response>:
    • body<~String>:

Change the parameters of the existing mapping without losing your position in the stream. docs.aws.amazon.com/lambda/latest/dg/API_UpdateEventSourceMapping.html

Parameters

  • UUID <~String> - event source mapping identifier.
  • BatchSize <~Integer> - maximum number of stream records that can be sent to your Lambda function for a single invocation.
  • Enabled <~Boolean> - specifies whether AWS Lambda should actively poll the stream or not.
  • FunctionName <~String> - Lambda function to which you want the stream records sent.

Returns

  • response<~Excon::Response>:
    • body<~Hash>:
      • ‘BatchSize’ <~Integer> - largest number of records that AWS Lambda will retrieve from your event source at the time of invoking your function.
      • ‘EventSourceArn’ <~String> - Amazon Resource Name (ARN) of the stream that is the source of events.
      • ‘FunctionArn’ <~String> - Lambda function to invoke when AWS Lambda detects an event on the stream.
      • ‘LastModified’ <~Time> - UTC time string indicating the last time the event mapping was updated.
      • ‘LastProcessingResult’ <~String> - result of the last AWS Lambda invocation of your Lambda function.
      • ‘State’ <~String> - state of the event source mapping.
      • ‘StateTransitionReason’ <~String> - reason the event source mapping is in its current state.
      • ‘UUID’ <~String> - AWS Lambda assigned opaque identifier for the mapping.

Updates the code for the specified Lambda function. docs.aws.amazon.com/lambda/latest/dg/API_UpdateFunctionCode.html

Parameters

  • FunctionName <~String> - existing Lambda function name whose code you want to replace.
  • S3Bucket <~String> - Amazon S3 bucket name where the .zip file containing your deployment package is stored.
  • S3Key <~String> - Amazon S3 object (the deployment package) key name you want to upload.
  • S3ObjectVersion <~String> - Amazon S3 object (the deployment package) version you want to upload.
  • ZipFile <~String> - Based64-encoded .zip file containing your packaged source code.

Returns

  • response<~Excon::Response>:
    • body<~Hash>:
      • ‘CodeSize’ <~Integer> - size, in bytes, of the function .zip file you uploaded.
      • ‘Description’ <~String> - user-provided description.
      • ‘FunctionArn’ <~String> - Amazon Resource Name (ARN) assigned to the function.
      • ‘FunctionName’ <~String> - name of the function.
      • ‘Handler’ <~String> - function Lambda calls to begin executing your function.
      • ‘LastModified’ <~Time> - timestamp of the last time you updated the function.
      • ‘Memorysize’ <~String> - memory size, in MB, you configured for the function.
      • ‘Role’ <~String> - ARN of the IAM role that Lambda assumes when it executes your function to access any other AWS resources.
      • ‘Runtime’ <~String> - runtime environment for the Lambda function.
      • ‘Timeout’ <~Integer> - function execution time at which Lambda should terminate the function.

Updates the configuration parameters for the specified Lambda function. docs.aws.amazon.com/lambda/latest/dg/API_UpdateFunctionConfiguration.html

Parameters

  • FunctionName <~String> - name of the Lambda function.
  • Description <~String> - short user-defined function description.
  • Handler <~String> - function that Lambda calls to begin executing your function.
  • MemorySize <~Integer> - amount of memory, in MB, your Lambda function is given.
  • Role <~String> - ARN of the IAM role that Lambda will assume when it executes your function.
  • Timeout <~Integer> - function execution time at which AWS Lambda should terminate the function.

Returns

  • response<~Excon::Response>:
    • body<~Hash>:
      • ‘CodeSize’ <~Integer> - size, in bytes, of the function .zip file you uploaded.
      • ‘Description’ <~String> - user-provided description.
      • ‘FunctionArn’ <~String> - Amazon Resource Name (ARN) assigned to the function.
      • ‘FunctionName’ <~String> - name of the function.
      • ‘Handler’ <~String> - function Lambda calls to begin executing your function.
      • ‘LastModified’ <~Time> - timestamp of the last time you updated the function.
      • ‘Memorysize’ <~String> - memory size, in MB, you configured for the function.
      • ‘Role’ <~String> - ARN of the IAM role that Lambda assumes when it executes your function to access any other AWS resources.
      • ‘Runtime’ <~String> - runtime environment for the Lambda function.
      • ‘Timeout’ <~Integer> - function execution time at which Lambda should terminate the function.

[Validate]