Class: Aws::Lambda::Types::CreateFunctionRequest
- Inherits:
-
Struct
- Object
- Struct
- Aws::Lambda::Types::CreateFunctionRequest
- Includes:
- Structure
- Defined in:
- lib/aws-sdk-lambda/types.rb
Overview
When making an API call, you may pass CreateFunctionRequest data as a hash:
{
function_name: "FunctionName", # required
runtime: "nodejs", # required, accepts nodejs, nodejs4.3, nodejs6.10, java8, python2.7, python3.6, dotnetcore1.0, nodejs4.3-edge
role: "RoleArn", # required
handler: "Handler", # required
code: { # required
zip_file: "data",
s3_bucket: "S3Bucket",
s3_key: "S3Key",
s3_object_version: "S3ObjectVersion",
},
description: "Description",
timeout: 1,
memory_size: 1,
publish: false,
vpc_config: {
subnet_ids: ["SubnetId"],
security_group_ids: ["SecurityGroupId"],
},
dead_letter_config: {
target_arn: "ResourceArn",
},
environment: {
variables: {
"EnvironmentVariableName" => "EnvironmentVariableValue",
},
},
kms_key_arn: "KMSKeyArn",
tracing_config: {
mode: "Active", # accepts Active, PassThrough
},
tags: {
"TagKey" => "TagValue",
},
}
Instance Attribute Summary collapse
-
#code ⇒ Types::FunctionCode
The code for the Lambda function.
-
#dead_letter_config ⇒ Types::DeadLetterConfig
The parent object that contains the target ARN (Amazon Resource Name) of an Amazon SQS queue or Amazon SNS topic.
-
#description ⇒ String
A short, user-defined function description.
-
#environment ⇒ Types::Environment
The parent object that contains your environment’s configuration settings.
-
#function_name ⇒ String
The name you want to assign to the function you are uploading.
-
#handler ⇒ String
The function within your code that Lambda calls to begin execution.
-
#kms_key_arn ⇒ String
The Amazon Resource Name (ARN) of the KMS key used to encrypt your function’s environment variables.
-
#memory_size ⇒ Integer
The amount of memory, in MB, your Lambda function is given.
-
#publish ⇒ Boolean
This boolean parameter can be used to request AWS Lambda to create the Lambda function and publish a version as an atomic operation.
-
#role ⇒ String
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.
-
#runtime ⇒ String
The runtime environment for the Lambda function you are uploading.
-
#tags ⇒ Hash<String,String>
The list of tags (key-value pairs) assigned to the new function.
-
#timeout ⇒ Integer
The function execution time at which Lambda should terminate the function.
-
#tracing_config ⇒ Types::TracingConfig
The parent object that contains your function’s tracing settings.
-
#vpc_config ⇒ Types::VpcConfig
If your Lambda function accesses resources in a VPC, you provide this parameter identifying the list of security group IDs and subnet IDs.
Instance Attribute Details
#code ⇒ Types::FunctionCode
The code for the Lambda function.
514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 |
# File 'lib/aws-sdk-lambda/types.rb', line 514 class CreateFunctionRequest < Struct.new( :function_name, :runtime, :role, :handler, :code, :description, :timeout, :memory_size, :publish, :vpc_config, :dead_letter_config, :environment, :kms_key_arn, :tracing_config, :tags) include Aws::Structure end |
#dead_letter_config ⇒ Types::DeadLetterConfig
The parent object that contains the target ARN (Amazon Resource Name) of an Amazon SQS queue or Amazon SNS topic.
514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 |
# File 'lib/aws-sdk-lambda/types.rb', line 514 class CreateFunctionRequest < Struct.new( :function_name, :runtime, :role, :handler, :code, :description, :timeout, :memory_size, :publish, :vpc_config, :dead_letter_config, :environment, :kms_key_arn, :tracing_config, :tags) include Aws::Structure end |
#description ⇒ String
A short, user-defined function description. Lambda does not use this value. Assign a meaningful description as you see fit.
514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 |
# File 'lib/aws-sdk-lambda/types.rb', line 514 class CreateFunctionRequest < Struct.new( :function_name, :runtime, :role, :handler, :code, :description, :timeout, :memory_size, :publish, :vpc_config, :dead_letter_config, :environment, :kms_key_arn, :tracing_config, :tags) include Aws::Structure end |
#environment ⇒ Types::Environment
The parent object that contains your environment’s configuration settings.
514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 |
# File 'lib/aws-sdk-lambda/types.rb', line 514 class CreateFunctionRequest < Struct.new( :function_name, :runtime, :role, :handler, :code, :description, :timeout, :memory_size, :publish, :vpc_config, :dead_letter_config, :environment, :kms_key_arn, :tracing_config, :tags) include Aws::Structure end |
#function_name ⇒ String
The name you want to assign to the function you are uploading. 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 API operations, such as Invoke. Note that the length constraint applies only to the ARN. If you specify only the function name, it is limited to 64 characters in length.
514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 |
# File 'lib/aws-sdk-lambda/types.rb', line 514 class CreateFunctionRequest < Struct.new( :function_name, :runtime, :role, :handler, :code, :description, :timeout, :memory_size, :publish, :vpc_config, :dead_letter_config, :environment, :kms_key_arn, :tracing_config, :tags) include Aws::Structure end |
#handler ⇒ String
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)].
[1]: docs.aws.amazon.com/lambda/latest/dg/java-programming-model-handler-types.html
514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 |
# File 'lib/aws-sdk-lambda/types.rb', line 514 class CreateFunctionRequest < Struct.new( :function_name, :runtime, :role, :handler, :code, :description, :timeout, :memory_size, :publish, :vpc_config, :dead_letter_config, :environment, :kms_key_arn, :tracing_config, :tags) include Aws::Structure end |
#kms_key_arn ⇒ String
The Amazon Resource Name (ARN) of the KMS key used to encrypt your function’s environment variables. If not provided, AWS Lambda will use a default service key.
514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 |
# File 'lib/aws-sdk-lambda/types.rb', line 514 class CreateFunctionRequest < Struct.new( :function_name, :runtime, :role, :handler, :code, :description, :timeout, :memory_size, :publish, :vpc_config, :dead_letter_config, :environment, :kms_key_arn, :tracing_config, :tags) include Aws::Structure end |
#memory_size ⇒ Integer
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.
514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 |
# File 'lib/aws-sdk-lambda/types.rb', line 514 class CreateFunctionRequest < Struct.new( :function_name, :runtime, :role, :handler, :code, :description, :timeout, :memory_size, :publish, :vpc_config, :dead_letter_config, :environment, :kms_key_arn, :tracing_config, :tags) include Aws::Structure end |
#publish ⇒ Boolean
This boolean parameter can be used to request AWS Lambda to create the Lambda function and publish a version as an atomic operation.
514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 |
# File 'lib/aws-sdk-lambda/types.rb', line 514 class CreateFunctionRequest < Struct.new( :function_name, :runtime, :role, :handler, :code, :description, :timeout, :memory_size, :publish, :vpc_config, :dead_letter_config, :environment, :kms_key_arn, :tracing_config, :tags) include Aws::Structure end |
#role ⇒ String
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 Works].
[1]: docs.aws.amazon.com/lambda/latest/dg/lambda-introduction.html
514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 |
# File 'lib/aws-sdk-lambda/types.rb', line 514 class CreateFunctionRequest < Struct.new( :function_name, :runtime, :role, :handler, :code, :description, :timeout, :memory_size, :publish, :vpc_config, :dead_letter_config, :environment, :kms_key_arn, :tracing_config, :tags) include Aws::Structure end |
#runtime ⇒ String
The runtime environment for the Lambda function you are uploading.
To use the Python runtime v3.6, set the value to “python3.6”. To use the Python runtime v2.7, set the value to “python2.7”. To use the Node.js runtime v6.10, set the value to “nodejs6.10”. To use the Node.js runtime v4.3, set the value to “nodejs4.3”.
<note markdown=“1”> Node v0.10.42 is currently marked as deprecated. You must migrate existing functions to the newer Node.js runtime versions available on AWS Lambda (nodejs4.3 or nodejs6.10) as soon as possible. You can request a one-time extension until June 30, 2017 by going to the Lambda console and following the instructions provided. Failure to do so will result in an invalid parmaeter error being returned. Note that you will have to follow this procedure for each region that contains functions written in the Node v0.10.42 runtime.
</note>
514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 |
# File 'lib/aws-sdk-lambda/types.rb', line 514 class CreateFunctionRequest < Struct.new( :function_name, :runtime, :role, :handler, :code, :description, :timeout, :memory_size, :publish, :vpc_config, :dead_letter_config, :environment, :kms_key_arn, :tracing_config, :tags) include Aws::Structure end |
#tags ⇒ Hash<String,String>
The list of tags (key-value pairs) assigned to the new function.
514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 |
# File 'lib/aws-sdk-lambda/types.rb', line 514 class CreateFunctionRequest < Struct.new( :function_name, :runtime, :role, :handler, :code, :description, :timeout, :memory_size, :publish, :vpc_config, :dead_letter_config, :environment, :kms_key_arn, :tracing_config, :tags) include Aws::Structure end |
#timeout ⇒ Integer
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.
514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 |
# File 'lib/aws-sdk-lambda/types.rb', line 514 class CreateFunctionRequest < Struct.new( :function_name, :runtime, :role, :handler, :code, :description, :timeout, :memory_size, :publish, :vpc_config, :dead_letter_config, :environment, :kms_key_arn, :tracing_config, :tags) include Aws::Structure end |
#tracing_config ⇒ Types::TracingConfig
The parent object that contains your function’s tracing settings.
514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 |
# File 'lib/aws-sdk-lambda/types.rb', line 514 class CreateFunctionRequest < Struct.new( :function_name, :runtime, :role, :handler, :code, :description, :timeout, :memory_size, :publish, :vpc_config, :dead_letter_config, :environment, :kms_key_arn, :tracing_config, :tags) include Aws::Structure end |
#vpc_config ⇒ Types::VpcConfig
If your Lambda function accesses resources in a VPC, you provide this parameter identifying the list of security group IDs and subnet IDs. These must belong to the same VPC. You must provide at least one security group and one subnet ID.
514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 |
# File 'lib/aws-sdk-lambda/types.rb', line 514 class CreateFunctionRequest < Struct.new( :function_name, :runtime, :role, :handler, :code, :description, :timeout, :memory_size, :publish, :vpc_config, :dead_letter_config, :environment, :kms_key_arn, :tracing_config, :tags) include Aws::Structure end |