public class CreateFunctionRequest extends AmazonWebServiceRequest implements Serializable, Cloneable
CreateFunction operation
.
Creates a new Lambda function. The function metadata is created from the request parameters, and the code for the function is provided by a .zip file in the request body. If the function name already exists, the operation will fail. Note that the function name is case-sensitive.
This operation requires permission for the
lambda:CreateFunction
action.
NOOP
Constructor and Description |
---|
CreateFunctionRequest() |
Modifier and Type | Method and Description |
---|---|
CreateFunctionRequest |
clone()
Creates a shallow clone of this request.
|
boolean |
equals(Object obj) |
FunctionCode |
getCode()
The code for the Lambda function.
|
String |
getDescription()
A short, user-defined function description.
|
String |
getFunctionName()
The name you want to assign to the function you are uploading.
|
String |
getHandler()
The function within your code that Lambda calls to begin execution.
|
Integer |
getMemorySize()
The amount of memory, in MB, your Lambda function is given.
|
String |
getRole()
The Amazon Resource Name (ARN) of the IAM role that Lambda assumes
when it executes your function to access any other Amazon Web Services
(AWS) resources.
|
String |
getRuntime()
The runtime environment for the Lambda function you are uploading.
|
Integer |
getTimeout()
The function execution time at which Lambda should terminate the
function.
|
int |
hashCode() |
void |
setCode(FunctionCode code)
The code for the Lambda function.
|
void |
setDescription(String description)
A short, user-defined function description.
|
void |
setFunctionName(String functionName)
The name you want to assign to the function you are uploading.
|
void |
setHandler(String handler)
The function within your code that Lambda calls to begin execution.
|
void |
setMemorySize(Integer memorySize)
The amount of memory, in MB, your Lambda function is given.
|
void |
setRole(String role)
The Amazon Resource Name (ARN) of the IAM role that Lambda assumes
when it executes your function to access any other Amazon Web Services
(AWS) resources.
|
void |
setRuntime(Runtime runtime)
The runtime environment for the Lambda function you are uploading.
|
void |
setRuntime(String runtime)
The runtime environment for the Lambda function you are uploading.
|
void |
setTimeout(Integer timeout)
The function execution time at which Lambda should terminate the
function.
|
String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
CreateFunctionRequest |
withCode(FunctionCode code)
The code for the Lambda function.
|
CreateFunctionRequest |
withDescription(String description)
A short, user-defined function description.
|
CreateFunctionRequest |
withFunctionName(String functionName)
The name you want to assign to the function you are uploading.
|
CreateFunctionRequest |
withHandler(String handler)
The function within your code that Lambda calls to begin execution.
|
CreateFunctionRequest |
withMemorySize(Integer memorySize)
The amount of memory, in MB, your Lambda function is given.
|
CreateFunctionRequest |
withRole(String role)
The Amazon Resource Name (ARN) of the IAM role that Lambda assumes
when it executes your function to access any other Amazon Web Services
(AWS) resources.
|
CreateFunctionRequest |
withRuntime(Runtime runtime)
The runtime environment for the Lambda function you are uploading.
|
CreateFunctionRequest |
withRuntime(String runtime)
The runtime environment for the Lambda function you are uploading.
|
CreateFunctionRequest |
withTimeout(Integer timeout)
The function execution time at which Lambda should terminate the
function.
|
copyBaseTo, getCustomQueryParameters, getCustomRequestHeaders, getGeneralProgressListener, getReadLimit, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, putCustomQueryParameter, putCustomRequestHeader, setGeneralProgressListener, setRequestCredentials, setRequestMetricCollector, withGeneralProgressListener, withRequestMetricCollector
public String getFunctionName()
Constraints:
Length: 1 - 111
Pattern: (arn:aws:lambda:)?([a-z]{2}-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)
public void setFunctionName(String functionName)
Constraints:
Length: 1 - 111
Pattern: (arn:aws:lambda:)?([a-z]{2}-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)
functionName
- The name you want to assign to the function you are uploading. You can
specify an unqualified 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"). AWS Lambda
also allows you to specify only 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. The function names appear in the console and are
returned in the ListFunctions API. Function names are used to
specify functions to other AWS Lambda APIs, such as Invoke.public CreateFunctionRequest withFunctionName(String functionName)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 111
Pattern: (arn:aws:lambda:)?([a-z]{2}-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)
functionName
- The name you want to assign to the function you are uploading. You can
specify an unqualified 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"). AWS Lambda
also allows you to specify only 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. The function names appear in the console and are
returned in the ListFunctions API. Function names are used to
specify functions to other AWS Lambda APIs, such as Invoke.public String getRuntime()
Constraints:
Allowed Values: nodejs, java8
Runtime
public void setRuntime(String runtime)
Constraints:
Allowed Values: nodejs, java8
runtime
- The runtime environment for the Lambda function you are uploading.
Currently, Lambda supports "java" and "nodejs" as the runtime.Runtime
public CreateFunctionRequest withRuntime(String runtime)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Allowed Values: nodejs, java8
runtime
- The runtime environment for the Lambda function you are uploading.
Currently, Lambda supports "java" and "nodejs" as the runtime.Runtime
public void setRuntime(Runtime runtime)
Constraints:
Allowed Values: nodejs, java8
runtime
- The runtime environment for the Lambda function you are uploading.
Currently, Lambda supports "java" and "nodejs" as the runtime.Runtime
public CreateFunctionRequest withRuntime(Runtime runtime)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Allowed Values: nodejs, java8
runtime
- The runtime environment for the Lambda function you are uploading.
Currently, Lambda supports "java" and "nodejs" as the runtime.Runtime
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 Amazon Resource Name (ARN) of the IAM role that Lambda assumes
when it executes your function to access any other Amazon Web Services
(AWS) resources. For more information, see AWS
Lambda: How it Workspublic CreateFunctionRequest 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 Amazon Resource Name (ARN) of the IAM role that Lambda assumes
when it executes your function to access any other Amazon Web Services
(AWS) resources. For more information, see AWS
Lambda: How it Workspublic String getHandler()
package.class-name::handler
or package.class-name
. For more information, see Lambda
Function Handler (Java).
Constraints:
Length: 0 - 128
Pattern: [^\s]+
package.class-name::handler
or package.class-name
. For more information, see Lambda
Function Handler (Java).public void setHandler(String handler)
package.class-name::handler
or package.class-name
. For more information, see Lambda
Function Handler (Java).
Constraints:
Length: 0 - 128
Pattern: [^\s]+
handler
- The function within your code that Lambda calls to begin execution.
For Node.js, it is the module-name.export value in your
function. For Java, it can be package.class-name::handler
or package.class-name
. For more information, see Lambda
Function Handler (Java).public CreateFunctionRequest withHandler(String handler)
package.class-name::handler
or package.class-name
. For more information, see Lambda
Function Handler (Java).
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 0 - 128
Pattern: [^\s]+
handler
- The function within your code that Lambda calls to begin execution.
For Node.js, it is the module-name.export value in your
function. For Java, it can be package.class-name::handler
or package.class-name
. For more information, see Lambda
Function Handler (Java).public String getDescription()
Constraints:
Length: 0 - 256
public void setDescription(String description)
Constraints:
Length: 0 - 256
description
- A short, user-defined function description. Lambda does not use this
value. Assign a meaningful description as you see fit.public CreateFunctionRequest withDescription(String description)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 0 - 256
description
- A short, user-defined function description. Lambda does not use this
value. Assign a meaningful description as you see fit.public Integer getTimeout()
Constraints:
Range: 1 - 60
public void setTimeout(Integer timeout)
Constraints:
Range: 1 - 60
timeout
- The function execution time at which Lambda should terminate the
function. Because the execution time has cost implications, we
recommend you set this value based on your expected execution time.
The default is 3 seconds.public CreateFunctionRequest withTimeout(Integer timeout)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Range: 1 - 60
timeout
- The function execution time at which Lambda should terminate the
function. Because the execution time has cost implications, we
recommend you set this value based on your expected execution time.
The default is 3 seconds.public Integer getMemorySize()
Constraints:
Range: 128 - 1536
public void setMemorySize(Integer memorySize)
Constraints:
Range: 128 - 1536
memorySize
- The amount of memory, in MB, your Lambda function is given. Lambda
uses this memory size to infer the amount of CPU and memory allocated
to your function. Your function use-case determines your CPU and
memory requirements. For example, a database operation might need less
memory compared to an image processing function. The default value is
128 MB. The value must be a multiple of 64 MB.public CreateFunctionRequest withMemorySize(Integer memorySize)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Range: 128 - 1536
memorySize
- The amount of memory, in MB, your Lambda function is given. Lambda
uses this memory size to infer the amount of CPU and memory allocated
to your function. Your function use-case determines your CPU and
memory requirements. For example, a database operation might need less
memory compared to an image processing function. The default value is
128 MB. The value must be a multiple of 64 MB.public FunctionCode getCode()
public void setCode(FunctionCode code)
code
- The code for the Lambda function.public CreateFunctionRequest withCode(FunctionCode code)
Returns a reference to this object so that method calls can be chained together.
code
- The code for the Lambda function.public String toString()
toString
in class Object
Object.toString()
public CreateFunctionRequest clone()
AmazonWebServiceRequest
clone
in class AmazonWebServiceRequest
Object.clone()
Copyright © 2015. All rights reserved.