class Amazonite::Lambda::CreateFunctionRequest

Included Modules

Defined in:

lambda/create_function_request.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(function_name : String, role : String, code : FunctionCode, runtime : Runtime | Nil = nil, handler : String | Nil = nil, description : String | Nil = nil, timeout : Int32 | Nil = nil, memory_size : Int32 | Nil = nil, publish : Bool | Nil = nil, publish_to : FunctionVersionLatestPublished | Nil = nil, vpc_config : VpcConfig | Nil = nil, package_type : PackageType | Nil = nil, dead_letter_config : DeadLetterConfig | Nil = nil, environment : Environment | Nil = nil, kms_key_arn : String | Nil = nil, tracing_config : TracingConfig | Nil = nil, tags : Hash(String, String) | Nil = nil, layers : Array(String) | Nil = nil, file_system_configs : Array(FileSystemConfig) | Nil = nil, code_signing_config_arn : String | Nil = nil, image_config : ImageConfig | Nil = nil, architectures : Array(Architecture) | Nil = nil, ephemeral_storage : EphemeralStorage | Nil = nil, snap_start : SnapStart | Nil = nil, logging_config : LoggingConfig | Nil = nil, tenancy_config : TenancyConfig | Nil = nil, capacity_provider_config : CapacityProviderConfig | Nil = nil, durable_config : DurableConfig | Nil = nil) #

[View source]
def self.new(pull : JSON::PullParser) #

[View source]

Instance Method Detail

def ==(other : self) #
Description copied from class Reference

Returns true if this reference is the same as other. Invokes same?.


def architectures : Array(Architecture) | Nil #

The instruction set architecture that the function supports. Enter a string array with one of the valid values (arm64 or x86_64). The default value is x86_64.


[View source]
def architectures=(architectures : Array(Architecture) | Nil) #

The instruction set architecture that the function supports. Enter a string array with one of the valid values (arm64 or x86_64). The default value is x86_64.


[View source]
def capacity_provider_config : CapacityProviderConfig | Nil #

Configuration for the capacity provider that manages compute resources for Lambda functions.


[View source]
def capacity_provider_config=(capacity_provider_config : CapacityProviderConfig | Nil) #

Configuration for the capacity provider that manages compute resources for Lambda functions.


[View source]
def code : FunctionCode #

The code for the function.


[View source]
def code=(code : FunctionCode) #

The code for the function.


[View source]
def code_signing_config_arn : String | Nil #

To enable code signing for this function, specify the ARN of a code-signing configuration. A code-signing configuration includes a set of signing profiles, which define the trusted publishers for this function.


[View source]
def code_signing_config_arn=(code_signing_config_arn : String | Nil) #

To enable code signing for this function, specify the ARN of a code-signing configuration. A code-signing configuration includes a set of signing profiles, which define the trusted publishers for this function.


[View source]
def dead_letter_config : DeadLetterConfig | Nil #

A dead-letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing. For more information, see Dead-letter queues.


[View source]
def dead_letter_config=(dead_letter_config : DeadLetterConfig | Nil) #

A dead-letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing. For more information, see Dead-letter queues.


[View source]
def description : String | Nil #

A description of the function.


[View source]
def description=(description : String | Nil) #

A description of the function.


[View source]
def durable_config : DurableConfig | Nil #

Configuration settings for durable functions. Enables creating functions with durability that can remember their state and continue execution even after interruptions.


[View source]
def durable_config=(durable_config : DurableConfig | Nil) #

Configuration settings for durable functions. Enables creating functions with durability that can remember their state and continue execution even after interruptions.


[View source]
def environment : Environment | Nil #

Environment variables that are accessible from function code during execution.


[View source]
def environment=(environment : Environment | Nil) #

Environment variables that are accessible from function code during execution.


[View source]
def ephemeral_storage : EphemeralStorage | Nil #

The size of the function's /tmp directory in MB. The default value is 512, but can be any whole number between 512 and 10,240 MB. For more information, see Configuring ephemeral storage (console).


[View source]
def ephemeral_storage=(ephemeral_storage : EphemeralStorage | Nil) #

The size of the function's /tmp directory in MB. The default value is 512, but can be any whole number between 512 and 10,240 MB. For more information, see Configuring ephemeral storage (console).


[View source]
def file_system_configs : Array(FileSystemConfig) | Nil #

Connection settings for an Amazon EFS file system or an Amazon S3 Files file system.


[View source]
def file_system_configs=(file_system_configs : Array(FileSystemConfig) | Nil) #

Connection settings for an Amazon EFS file system or an Amazon S3 Files file system.


[View source]
def function_name : String #

The name or ARN of the Lambda function.

Name formats

  • Function namemy-function.

  • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

  • Partial ARN123456789012:function:my-function.

The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.


[View source]
def function_name=(function_name : String) #

The name or ARN of the Lambda function.

Name formats

  • Function namemy-function.

  • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

  • Partial ARN123456789012:function:my-function.

The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.


[View source]
def handler : String | Nil #

The name of the method within your code that Lambda calls to run your function. Handler is required if the deployment package is a .zip file archive. The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime. For more information, see Lambda programming model.


[View source]
def handler=(handler : String | Nil) #

The name of the method within your code that Lambda calls to run your function. Handler is required if the deployment package is a .zip file archive. The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime. For more information, see Lambda programming model.


[View source]
def hash(hasher) #
Description copied from class Reference

See Object#hash(hasher)


def image_config : ImageConfig | Nil #

Container image configuration values that override the values in the container image Dockerfile.


[View source]
def image_config=(image_config : ImageConfig | Nil) #

Container image configuration values that override the values in the container image Dockerfile.


[View source]
def kms_key_arn : String | Nil #

The ARN of the Key Management Service (KMS) customer managed key that's used to encrypt the following resources:

  • The function's environment variables.

  • The function's Lambda SnapStart snapshots.

  • When used with SourceKMSKeyArn, the unzipped version of the .zip deployment package that's used for function invocations. For more information, see Specifying a customer managed key for Lambda.

  • The optimized version of the container image that's used for function invocations. Note that this is not the same key that's used to protect your container image in the Amazon Elastic Container Registry (Amazon ECR). For more information, see Function lifecycle.

If you don't provide a customer managed key, Lambda uses an Amazon Web Services owned key or an Amazon Web Services managed key.


[View source]
def kms_key_arn=(kms_key_arn : String | Nil) #

The ARN of the Key Management Service (KMS) customer managed key that's used to encrypt the following resources:

  • The function's environment variables.

  • The function's Lambda SnapStart snapshots.

  • When used with SourceKMSKeyArn, the unzipped version of the .zip deployment package that's used for function invocations. For more information, see Specifying a customer managed key for Lambda.

  • The optimized version of the container image that's used for function invocations. Note that this is not the same key that's used to protect your container image in the Amazon Elastic Container Registry (Amazon ECR). For more information, see Function lifecycle.

If you don't provide a customer managed key, Lambda uses an Amazon Web Services owned key or an Amazon Web Services managed key.


[View source]
def layers : Array(String) | Nil #

A list of function layers to add to the function's execution environment. Specify each layer by its ARN, including the version.


[View source]
def layers=(layers : Array(String) | Nil) #

A list of function layers to add to the function's execution environment. Specify each layer by its ARN, including the version.


[View source]
def logging_config : LoggingConfig | Nil #

The function's Amazon CloudWatch Logs configuration settings.


[View source]
def logging_config=(logging_config : LoggingConfig | Nil) #

The function's Amazon CloudWatch Logs configuration settings.


[View source]
def memory_size : Int32 | Nil #

The amount of memory available to the function at runtime. Increasing the function memory also increases its CPU allocation. The default value is 128 MB. The value can be any multiple of 1 MB.


[View source]
def memory_size=(memory_size : Int32 | Nil) #

The amount of memory available to the function at runtime. Increasing the function memory also increases its CPU allocation. The default value is 128 MB. The value can be any multiple of 1 MB.


[View source]
def package_type : PackageType | Nil #

The type of deployment package. Set to Image for container image and set to Zip for .zip file archive.


[View source]
def package_type=(package_type : PackageType | Nil) #

The type of deployment package. Set to Image for container image and set to Zip for .zip file archive.


[View source]
def publish : Bool | Nil #

Set to true to publish the first version of the function during creation.


[View source]
def publish=(publish : Bool | Nil) #

Set to true to publish the first version of the function during creation.


[View source]
def publish_to : FunctionVersionLatestPublished | Nil #

Specifies where to publish the function version or configuration.


[View source]
def publish_to=(publish_to : FunctionVersionLatestPublished | Nil) #

Specifies where to publish the function version or configuration.


[View source]
def role : String #

The Amazon Resource Name (ARN) of the function's execution role.


[View source]
def role=(role : String) #

The Amazon Resource Name (ARN) of the function's execution role.


[View source]
def runtime : Runtime | Nil #

The identifier of the function's runtime. Runtime is required if the deployment package is a .zip file archive. Specifying a runtime results in an error if you're deploying a function using a container image.

The following list includes deprecated runtimes. Lambda blocks creating new functions and updating existing functions shortly after each runtime is deprecated. For more information, see Runtime use after deprecation.

For a list of all currently supported runtimes, see Supported runtimes.


[View source]
def runtime=(runtime : Runtime | Nil) #

The identifier of the function's runtime. Runtime is required if the deployment package is a .zip file archive. Specifying a runtime results in an error if you're deploying a function using a container image.

The following list includes deprecated runtimes. Lambda blocks creating new functions and updating existing functions shortly after each runtime is deprecated. For more information, see Runtime use after deprecation.

For a list of all currently supported runtimes, see Supported runtimes.


[View source]
def snap_start : SnapStart | Nil #

The function's SnapStart setting.


[View source]
def snap_start=(snap_start : SnapStart | Nil) #

The function's SnapStart setting.


[View source]
def tags : Hash(String, String) | Nil #

A list of tags to apply to the function.


[View source]
def tags=(tags : Hash(String, String) | Nil) #

A list of tags to apply to the function.


[View source]
def tenancy_config : TenancyConfig | Nil #

Configuration for multi-tenant applications that use Lambda functions. Defines tenant isolation settings and resource allocations. Required for functions supporting multiple tenants.


[View source]
def tenancy_config=(tenancy_config : TenancyConfig | Nil) #

Configuration for multi-tenant applications that use Lambda functions. Defines tenant isolation settings and resource allocations. Required for functions supporting multiple tenants.


[View source]
def timeout : Int32 | Nil #

The amount of time (in seconds) that Lambda allows a function to run before stopping it. The default is 3 seconds. The maximum allowed value is 900 seconds. For more information, see Lambda execution environment.


[View source]
def timeout=(timeout : Int32 | Nil) #

The amount of time (in seconds) that Lambda allows a function to run before stopping it. The default is 3 seconds. The maximum allowed value is 900 seconds. For more information, see Lambda execution environment.


[View source]
def tracing_config : TracingConfig | Nil #

Set Mode to Active to sample and trace a subset of incoming requests with X-Ray.


[View source]
def tracing_config=(tracing_config : TracingConfig | Nil) #

Set Mode to Active to sample and trace a subset of incoming requests with X-Ray.


[View source]
def validate! : Nil #

[View source]
def vpc_config : VpcConfig | Nil #

For network connectivity to Amazon Web Services resources in a VPC, specify a list of security groups and subnets in the VPC. When you connect a function to a VPC, it can access resources and the internet only through that VPC. For more information, see Configuring a Lambda function to access resources in a VPC.


[View source]
def vpc_config=(vpc_config : VpcConfig | Nil) #

For network connectivity to Amazon Web Services resources in a VPC, specify a list of security groups and subnets in the VPC. When you connect a function to a VPC, it can access resources and the internet only through that VPC. For more information, see Configuring a Lambda function to access resources in a VPC.


[View source]