public class AddEventSourceRequest extends AmazonWebServiceRequest implements Serializable, Cloneable
AddEventSource operation
.
Identifies a stream as an event source for an AWS Lambda function. It can be either an Amazon Kinesis stream or a Amazon DynamoDB stream. AWS Lambda invokes the specified function when records are posted to the stream.
This is the pull model, where AWS Lambda invokes the function. For more information, go to AWS Lambda: How it Works in the AWS Lambda Developer Guide.
This association between an Amazon Kinesis stream and an AWS Lambda function is called the event source mapping. You provide the configuration information (for example, which stream to read from and which AWS Lambda function to invoke) for the event source mapping in the request body.
Each event source, such as a Kinesis stream, can only be associated with one AWS Lambda function. If you call AddEventSource for an event source that is already mapped to another AWS Lambda function, the existing mapping is updated to call the new function instead of the old one.
This operation requires permission for the iam:PassRole
action for the IAM role. It also requires permission for the
lambda:AddEventSource
action.
NOOP
Constructor and Description |
---|
AddEventSourceRequest() |
Modifier and Type | Method and Description |
---|---|
AddEventSourceRequest |
addParametersEntry(String key,
String value)
A map (key-value pairs) defining the configuration for AWS Lambda to
use when reading the event source.
|
AddEventSourceRequest |
clearParametersEntries()
Removes all the entries added into Parameters.
|
AddEventSourceRequest |
clone() |
boolean |
equals(Object obj) |
Integer |
getBatchSize()
The largest number of records that AWS Lambda will give to your
function in a single event.
|
String |
getEventSource()
The Amazon Resource Name (ARN) of the Amazon Kinesis stream that is
the event source.
|
String |
getFunctionName()
The Lambda function to invoke when AWS Lambda detects an event on the
stream.
|
Map<String,String> |
getParameters()
A map (key-value pairs) defining the configuration for AWS Lambda to
use when reading the event source.
|
String |
getRole()
The ARN of the IAM role (invocation role) that AWS Lambda can assume
to read from the stream and invoke the function.
|
int |
hashCode() |
void |
setBatchSize(Integer batchSize)
The largest number of records that AWS Lambda will give to your
function in a single event.
|
void |
setEventSource(String eventSource)
The Amazon Resource Name (ARN) of the Amazon Kinesis stream that is
the event source.
|
void |
setFunctionName(String functionName)
The Lambda function to invoke when AWS Lambda detects an event on the
stream.
|
void |
setParameters(Map<String,String> parameters)
A map (key-value pairs) defining the configuration for AWS Lambda to
use when reading the event source.
|
void |
setRole(String role)
The ARN of the IAM role (invocation role) that AWS Lambda can assume
to read from the stream and invoke the function.
|
String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
AddEventSourceRequest |
withBatchSize(Integer batchSize)
The largest number of records that AWS Lambda will give to your
function in a single event.
|
AddEventSourceRequest |
withEventSource(String eventSource)
The Amazon Resource Name (ARN) of the Amazon Kinesis stream that is
the event source.
|
AddEventSourceRequest |
withFunctionName(String functionName)
The Lambda function to invoke when AWS Lambda detects an event on the
stream.
|
AddEventSourceRequest |
withParameters(Map<String,String> parameters)
A map (key-value pairs) defining the configuration for AWS Lambda to
use when reading the event source.
|
AddEventSourceRequest |
withRole(String role)
The ARN of the IAM role (invocation role) that AWS Lambda can assume
to read from the stream and invoke the function.
|
copyBaseTo, copyPrivateRequestParameters, getCustomRequestHeaders, getGeneralProgressListener, getReadLimit, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, putCustomRequestHeader, setGeneralProgressListener, setRequestCredentials, setRequestMetricCollector, withGeneralProgressListener, withRequestMetricCollector
public String getEventSource()
public void setEventSource(String eventSource)
eventSource
- The Amazon Resource Name (ARN) of the Amazon Kinesis stream that is
the event source. Any record added to this stream causes AWS Lambda to
invoke your Lambda function. AWS Lambda POSTs the Amazon Kinesis
event, containing records, to your Lambda function as JSON.public AddEventSourceRequest withEventSource(String eventSource)
Returns a reference to this object so that method calls can be chained together.
eventSource
- The Amazon Resource Name (ARN) of the Amazon Kinesis stream that is
the event source. Any record added to this stream causes AWS Lambda to
invoke your Lambda function. AWS Lambda POSTs the Amazon Kinesis
event, containing records, to your Lambda function as JSON.public String getFunctionName()
Constraints:
Length: 1 - 64
Pattern: [a-zA-Z0-9-_]+
public void setFunctionName(String functionName)
Constraints:
Length: 1 - 64
Pattern: [a-zA-Z0-9-_]+
functionName
- The Lambda function to invoke when AWS Lambda detects an event on the
stream.public AddEventSourceRequest withFunctionName(String functionName)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 64
Pattern: [a-zA-Z0-9-_]+
functionName
- The Lambda function to invoke when AWS Lambda detects an event on the
stream.public String getRole()
Constraints:
Pattern: arn:aws:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+
public void setRole(String role)
Constraints:
Pattern: arn:aws:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+
role
- The ARN of the IAM role (invocation role) that AWS Lambda can assume
to read from the stream and invoke the function.public AddEventSourceRequest withRole(String role)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Pattern: arn:aws:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+
role
- The ARN of the IAM role (invocation role) that AWS Lambda can assume
to read from the stream and invoke the function.public Integer getBatchSize()
public void setBatchSize(Integer batchSize)
batchSize
- The largest number of records that AWS Lambda will give to your
function in a single event. The default is 100 records.public AddEventSourceRequest withBatchSize(Integer batchSize)
Returns a reference to this object so that method calls can be chained together.
batchSize
- The largest number of records that AWS Lambda will give to your
function in a single event. The default is 100 records.public Map<String,String> getParameters()
InitialPositionInStream
key. The valid values are:
"TRIM_HORIZON" and "LATEST". The default value is "TRIM_HORIZON". For
more information, go to ShardIteratorType
in the Amazon Kinesis Service API Reference.InitialPositionInStream
key. The valid values are:
"TRIM_HORIZON" and "LATEST". The default value is "TRIM_HORIZON". For
more information, go to ShardIteratorType
in the Amazon Kinesis Service API Reference.public void setParameters(Map<String,String> parameters)
InitialPositionInStream
key. The valid values are:
"TRIM_HORIZON" and "LATEST". The default value is "TRIM_HORIZON". For
more information, go to ShardIteratorType
in the Amazon Kinesis Service API Reference.parameters
- A map (key-value pairs) defining the configuration for AWS Lambda to
use when reading the event source. Currently, AWS Lambda supports only
the InitialPositionInStream
key. The valid values are:
"TRIM_HORIZON" and "LATEST". The default value is "TRIM_HORIZON". For
more information, go to ShardIteratorType
in the Amazon Kinesis Service API Reference.public AddEventSourceRequest withParameters(Map<String,String> parameters)
InitialPositionInStream
key. The valid values are:
"TRIM_HORIZON" and "LATEST". The default value is "TRIM_HORIZON". For
more information, go to ShardIteratorType
in the Amazon Kinesis Service API Reference.
Returns a reference to this object so that method calls can be chained together.
parameters
- A map (key-value pairs) defining the configuration for AWS Lambda to
use when reading the event source. Currently, AWS Lambda supports only
the InitialPositionInStream
key. The valid values are:
"TRIM_HORIZON" and "LATEST". The default value is "TRIM_HORIZON". For
more information, go to ShardIteratorType
in the Amazon Kinesis Service API Reference.public AddEventSourceRequest addParametersEntry(String key, String value)
InitialPositionInStream
key. The valid values are:
"TRIM_HORIZON" and "LATEST". The default value is "TRIM_HORIZON". For
more information, go to ShardIteratorType
in the Amazon Kinesis Service API Reference.
The method adds a new key-value pair into Parameters parameter, and returns a reference to this object so that method calls can be chained together.
key
- The key of the entry to be added into Parameters.value
- The corresponding value of the entry to be added into Parameters.public AddEventSourceRequest clearParametersEntries()
Returns a reference to this object so that method calls can be chained together.
public String toString()
toString
in class Object
Object.toString()
public AddEventSourceRequest clone()
clone
in class AmazonWebServiceRequest
Copyright © 2015. All rights reserved.