public class CreateEventSourceMappingRequest extends AmazonWebServiceRequest implements Serializable, Cloneable
CreateEventSourceMapping operation
.
Identifies a stream as an event source for a Lambda function. It can be either an Amazon Kinesis stream or an Amazon DynamoDB stream. AWS Lambda invokes the specified function when records are posted to the stream.
This association between a stream source and a Lambda function is called the event source mapping.
IMPORTANT:This event source mapping is relevant only in the AWS Lambda pull model, where AWS Lambda invokes the function. For more information, go to AWS Lambda: How it Works in the AWS Lambda Developer Guide.
You provide mapping information (for example, which stream to read from and which Lambda function to invoke) in the request body.
Each event source, such as an Amazon Kinesis or a DynamoDB stream, can be associated with multiple AWS Lambda function. A given Lambda function can be associated with multiple AWS event sources.
If you are using versioning, you can specify a specific function version or an alias via the function name parameter. For more information about versioning, see AWS Lambda Function Versioning and Aliases .
This operation requires permission for the
lambda:CreateEventSourceMapping
action.
NOOP
Constructor and Description |
---|
CreateEventSourceMappingRequest() |
Modifier and Type | Method and Description |
---|---|
CreateEventSourceMappingRequest |
clone()
Creates a shallow clone of this request.
|
boolean |
equals(Object obj) |
Integer |
getBatchSize()
The largest number of records that AWS Lambda will retrieve from your
event source at the time of invoking your function.
|
Boolean |
getEnabled()
Indicates whether AWS Lambda should begin polling the event source.
|
String |
getEventSourceArn()
The Amazon Resource Name (ARN) of the Amazon Kinesis or the Amazon
DynamoDB stream that is the event source.
|
String |
getFunctionName()
The Lambda function to invoke when AWS Lambda detects an event on the
stream.
|
String |
getStartingPosition()
The position in the stream where AWS Lambda should start reading.
|
int |
hashCode() |
Boolean |
isEnabled()
Indicates whether AWS Lambda should begin polling the event source.
|
void |
setBatchSize(Integer batchSize)
The largest number of records that AWS Lambda will retrieve from your
event source at the time of invoking your function.
|
void |
setEnabled(Boolean enabled)
Indicates whether AWS Lambda should begin polling the event source.
|
void |
setEventSourceArn(String eventSourceArn)
The Amazon Resource Name (ARN) of the Amazon Kinesis or the Amazon
DynamoDB 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 |
setStartingPosition(EventSourcePosition startingPosition)
The position in the stream where AWS Lambda should start reading.
|
void |
setStartingPosition(String startingPosition)
The position in the stream where AWS Lambda should start reading.
|
String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
CreateEventSourceMappingRequest |
withBatchSize(Integer batchSize)
The largest number of records that AWS Lambda will retrieve from your
event source at the time of invoking your function.
|
CreateEventSourceMappingRequest |
withEnabled(Boolean enabled)
Indicates whether AWS Lambda should begin polling the event source.
|
CreateEventSourceMappingRequest |
withEventSourceArn(String eventSourceArn)
The Amazon Resource Name (ARN) of the Amazon Kinesis or the Amazon
DynamoDB stream that is the event source.
|
CreateEventSourceMappingRequest |
withFunctionName(String functionName)
The Lambda function to invoke when AWS Lambda detects an event on the
stream.
|
CreateEventSourceMappingRequest |
withStartingPosition(EventSourcePosition startingPosition)
The position in the stream where AWS Lambda should start reading.
|
CreateEventSourceMappingRequest |
withStartingPosition(String startingPosition)
The position in the stream where AWS Lambda should start reading.
|
getCloneRoot, getCloneSource, getCustomQueryParameters, getCustomRequestHeaders, getGeneralProgressListener, getReadLimit, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, getSdkClientExecutionTimeout, getSdkRequestTimeout, putCustomQueryParameter, putCustomRequestHeader, setGeneralProgressListener, setRequestCredentials, setRequestMetricCollector, setSdkClientExecutionTimeout, setSdkRequestTimeout, withGeneralProgressListener, withRequestMetricCollector, withSdkClientExecutionTimeout, withSdkRequestTimeout
public String getEventSourceArn()
BatchSize
. AWS Lambda POSTs the Amazon
Kinesis event, containing records, to your Lambda function as JSON.
Constraints:
Pattern: arn:aws:([a-zA-Z0-9\-])+:([a-z]{2}-[a-z]+-\d{1})?:(\d{12})?:(.*)
BatchSize
. AWS Lambda POSTs the Amazon
Kinesis event, containing records, to your Lambda function as JSON.public void setEventSourceArn(String eventSourceArn)
BatchSize
. AWS Lambda POSTs the Amazon
Kinesis event, containing records, to your Lambda function as JSON.
Constraints:
Pattern: arn:aws:([a-zA-Z0-9\-])+:([a-z]{2}-[a-z]+-\d{1})?:(\d{12})?:(.*)
eventSourceArn
- The Amazon Resource Name (ARN) of the Amazon Kinesis or the Amazon
DynamoDB stream that is the event source. Any record added to this
stream could cause AWS Lambda to invoke your Lambda function, it
depends on the BatchSize
. AWS Lambda POSTs the Amazon
Kinesis event, containing records, to your Lambda function as JSON.public CreateEventSourceMappingRequest withEventSourceArn(String eventSourceArn)
BatchSize
. AWS Lambda POSTs the Amazon
Kinesis event, containing records, to your Lambda function as JSON.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Pattern: arn:aws:([a-zA-Z0-9\-])+:([a-z]{2}-[a-z]+-\d{1})?:(\d{12})?:(.*)
eventSourceArn
- The Amazon Resource Name (ARN) of the Amazon Kinesis or the Amazon
DynamoDB stream that is the event source. Any record added to this
stream could cause AWS Lambda to invoke your Lambda function, it
depends on the BatchSize
. AWS Lambda POSTs the Amazon
Kinesis event, containing records, to your Lambda function as JSON.public String getFunctionName()
You can specify the function name (for example,
Thumbnail
) or you can specify Amazon Resource Name (ARN)
of the function (for example,
arn:aws:lambda:us-west-2:account-id:function:ThumbNail
).
If you are using versioning, you can also provide a qualified function ARN (ARN that is qualified with function version or alias name as suffix). For more information about versioning, see AWS Lambda Function Versioning and Aliases
AWS Lambda also allows
you to specify only the function name with the account ID qualifier
(for example, account-id:Thumbnail
).
Note that the length constraint applies only to the ARN. If you specify only the function name, it is limited to 64 character in length.
Constraints:
Length: 1 - 140
Pattern: (arn:aws:lambda:)?([a-z]{2}-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?
You can specify the function name (for example,
Thumbnail
) or you can specify Amazon Resource Name (ARN)
of the function (for example,
arn:aws:lambda:us-west-2:account-id:function:ThumbNail
).
If you are using versioning, you can also provide a qualified function ARN (ARN that is qualified with function version or alias name as suffix). For more information about versioning, see AWS Lambda Function Versioning and Aliases
AWS Lambda also allows
you to specify only the function name with the account ID qualifier
(for example, account-id:Thumbnail
).
Note that the length constraint applies only to the ARN. If you specify only the function name, it is limited to 64 character in length.
public void setFunctionName(String functionName)
You can specify the function name (for example,
Thumbnail
) or you can specify Amazon Resource Name (ARN)
of the function (for example,
arn:aws:lambda:us-west-2:account-id:function:ThumbNail
).
If you are using versioning, you can also provide a qualified function ARN (ARN that is qualified with function version or alias name as suffix). For more information about versioning, see AWS Lambda Function Versioning and Aliases
AWS Lambda also allows
you to specify only the function name with the account ID qualifier
(for example, account-id:Thumbnail
).
Note that the length constraint applies only to the ARN. If you specify only the function name, it is limited to 64 character in length.
Constraints:
Length: 1 - 140
Pattern: (arn:aws:lambda:)?([a-z]{2}-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?
functionName
- The Lambda function to invoke when AWS Lambda detects an event on the
stream. You can specify the function name (for example,
Thumbnail
) or you can specify Amazon Resource Name (ARN)
of the function (for example,
arn:aws:lambda:us-west-2:account-id:function:ThumbNail
).
If you are using versioning, you can also provide a qualified function ARN (ARN that is qualified with function version or alias name as suffix). For more information about versioning, see AWS Lambda Function Versioning and Aliases
AWS Lambda also allows
you to specify only the function name with the account ID qualifier
(for example, account-id:Thumbnail
).
Note that the length constraint applies only to the ARN. If you specify only the function name, it is limited to 64 character in length.
public CreateEventSourceMappingRequest withFunctionName(String functionName)
You can specify the function name (for example,
Thumbnail
) or you can specify Amazon Resource Name (ARN)
of the function (for example,
arn:aws:lambda:us-west-2:account-id:function:ThumbNail
).
If you are using versioning, you can also provide a qualified function ARN (ARN that is qualified with function version or alias name as suffix). For more information about versioning, see AWS Lambda Function Versioning and Aliases
AWS Lambda also allows
you to specify only the function name with the account ID qualifier
(for example, account-id:Thumbnail
).
Note that the length constraint applies only to the ARN. If you specify only the function name, it is limited to 64 character in length.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 140
Pattern: (arn:aws:lambda:)?([a-z]{2}-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?
functionName
- The Lambda function to invoke when AWS Lambda detects an event on the
stream. You can specify the function name (for example,
Thumbnail
) or you can specify Amazon Resource Name (ARN)
of the function (for example,
arn:aws:lambda:us-west-2:account-id:function:ThumbNail
).
If you are using versioning, you can also provide a qualified function ARN (ARN that is qualified with function version or alias name as suffix). For more information about versioning, see AWS Lambda Function Versioning and Aliases
AWS Lambda also allows
you to specify only the function name with the account ID qualifier
(for example, account-id:Thumbnail
).
Note that the length constraint applies only to the ARN. If you specify only the function name, it is limited to 64 character in length.
public Boolean isEnabled()
Enabled
is true.Enabled
is true.public void setEnabled(Boolean enabled)
Enabled
is true.enabled
- Indicates whether AWS Lambda should begin polling the event source. By
default, Enabled
is true.public CreateEventSourceMappingRequest withEnabled(Boolean enabled)
Enabled
is true.
Returns a reference to this object so that method calls can be chained together.
enabled
- Indicates whether AWS Lambda should begin polling the event source. By
default, Enabled
is true.public Boolean getEnabled()
Enabled
is true.Enabled
is true.public Integer getBatchSize()
Constraints:
Range: 1 - 10000
public void setBatchSize(Integer batchSize)
Constraints:
Range: 1 - 10000
batchSize
- The largest number of records that AWS Lambda will retrieve from your
event source at the time of invoking your function. Your function
receives an event with all the retrieved records. The default is 100
records.public CreateEventSourceMappingRequest withBatchSize(Integer batchSize)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Range: 1 - 10000
batchSize
- The largest number of records that AWS Lambda will retrieve from your
event source at the time of invoking your function. Your function
receives an event with all the retrieved records. The default is 100
records.public String getStartingPosition()
Constraints:
Allowed Values: TRIM_HORIZON, LATEST
EventSourcePosition
public void setStartingPosition(String startingPosition)
Constraints:
Allowed Values: TRIM_HORIZON, LATEST
startingPosition
- The position in the stream where AWS Lambda should start reading. For
more information, go to ShardIteratorType
in the Amazon Kinesis API Reference.EventSourcePosition
public CreateEventSourceMappingRequest withStartingPosition(String startingPosition)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Allowed Values: TRIM_HORIZON, LATEST
startingPosition
- The position in the stream where AWS Lambda should start reading. For
more information, go to ShardIteratorType
in the Amazon Kinesis API Reference.EventSourcePosition
public void setStartingPosition(EventSourcePosition startingPosition)
Constraints:
Allowed Values: TRIM_HORIZON, LATEST
startingPosition
- The position in the stream where AWS Lambda should start reading. For
more information, go to ShardIteratorType
in the Amazon Kinesis API Reference.EventSourcePosition
public CreateEventSourceMappingRequest withStartingPosition(EventSourcePosition startingPosition)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Allowed Values: TRIM_HORIZON, LATEST
startingPosition
- The position in the stream where AWS Lambda should start reading. For
more information, go to ShardIteratorType
in the Amazon Kinesis API Reference.EventSourcePosition
public String toString()
toString
in class Object
Object.toString()
public CreateEventSourceMappingRequest clone()
AmazonWebServiceRequest
clone
in class AmazonWebServiceRequest
Object.clone()
Copyright © 2013 Amazon Web Services, Inc. All Rights Reserved.