Skip to main content

FunctionSpec

Struct FunctionSpec 

Source
pub struct FunctionSpec {
Show 30 fields pub architectures: Option<Vec<String>>, pub code: FunctionCode, pub code_signing_config_arn: Option<String>, pub dead_letter_config: Option<FunctionDeadLetterConfig>, pub description: Option<String>, pub durable_config: Option<FunctionDurableConfig>, pub environment: Option<FunctionEnvironment>, pub ephemeral_storage: Option<FunctionEphemeralStorage>, pub file_system_configs: Option<Vec<FunctionFileSystemConfigs>>, pub function_event_invoke_config: Option<FunctionFunctionEventInvokeConfig>, pub handler: Option<String>, pub image_config: Option<FunctionImageConfig>, pub kms_key_arn: Option<String>, pub kms_key_ref: Option<FunctionKmsKeyRef>, pub layers: Option<Vec<String>>, pub logging_config: Option<FunctionLoggingConfig>, pub memory_size: Option<i64>, pub name: String, pub package_type: Option<String>, pub publish: Option<bool>, pub reserved_concurrent_executions: Option<i64>, pub role: Option<String>, pub role_ref: Option<FunctionRoleRef>, pub runtime: Option<String>, pub snap_start: Option<FunctionSnapStart>, pub tags: Option<BTreeMap<String, String>>, pub tenancy_config: Option<FunctionTenancyConfig>, pub timeout: Option<i64>, pub tracing_config: Option<FunctionTracingConfig>, pub vpc_config: Option<FunctionVpcConfig>,
}
Expand description

FunctionSpec defines the desired state of Function.

Fields§

§architectures: Option<Vec<String>>

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.

§code: FunctionCode

The code for the function.

§code_signing_config_arn: Option<String>

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.

Regex Pattern: ^arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}$

§dead_letter_config: Option<FunctionDeadLetterConfig>

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 (https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-dlq).

§description: Option<String>

A description of the function.

§durable_config: Option<FunctionDurableConfig>

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

§environment: Option<FunctionEnvironment>

Environment variables that are accessible from function code during execution.

§ephemeral_storage: Option<FunctionEphemeralStorage>

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) (https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-ephemeral-storage).

§file_system_configs: Option<Vec<FunctionFileSystemConfigs>>

Connection settings for an Amazon EFS file system.

§function_event_invoke_config: Option<FunctionFunctionEventInvokeConfig>

Configures options for asynchronous invocation on a function.

  • DestinationConfig A destination for events after they have been sent to a function for processing.

Types of Destinations: Function - The Amazon Resource Name (ARN) of a Lambda function. Queue - The ARN of a standard SQS queue. Topic - The ARN of a standard SNS topic. Event Bus - The ARN of an Amazon EventBridge event bus.

  • MaximumEventAgeInSeconds The maximum age of a request that Lambda sends to a function for processing.

  • MaximumRetryAttempts The maximum number of times to retry when the function returns an error.

§handler: Option<String>

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 (https://docs.aws.amazon.com/lambda/latest/dg/foundation-progmodel.html).

Regex Pattern: ^[^\s]+$

§image_config: Option<FunctionImageConfig>

Container image configuration values (https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-parms) that override the values in the container image Dockerfile.

§kms_key_arn: Option<String>

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

If you don’t provide a customer managed key, Lambda uses an Amazon Web Services owned key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk) or an Amazon Web Services managed key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk).

Regex Pattern: ^(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()$

§kms_key_ref: Option<FunctionKmsKeyRef>

AWSResourceReferenceWrapper provides a wrapper around *AWSResourceReference type to provide more user friendly syntax for references using ‘from’ field Ex: APIIDRef:

from:
  name: my-api
§layers: Option<Vec<String>>

A list of function layers (https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) to add to the function’s execution environment. Specify each layer by its ARN, including the version.

§logging_config: Option<FunctionLoggingConfig>

The function’s Amazon CloudWatch Logs configuration settings.

§memory_size: Option<i64>

The amount of memory available to the function (https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-memory-console) 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.

§name: String

The name or ARN of the Lambda function.

Name formats

  • Function name – my-function.

  • Function ARN – arn:aws:lambda:us-west-2:123456789012:function:my-function.

  • Partial ARN – 123456789012: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.

Regex Pattern: ^(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}((-gov)|(-iso([a-z]?)))?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?$

§package_type: Option<String>

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

§publish: Option<bool>

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

§reserved_concurrent_executions: Option<i64>

The number of simultaneous executions to reserve for the function.

§role: Option<String>

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

Regex Pattern: ^arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+$

§role_ref: Option<FunctionRoleRef>

AWSResourceReferenceWrapper provides a wrapper around *AWSResourceReference type to provide more user friendly syntax for references using ‘from’ field Ex: APIIDRef:

from:
  name: my-api
§runtime: Option<String>

The identifier of the function’s runtime (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html). 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 (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-deprecation-levels).

For a list of all currently supported runtimes, see Supported runtimes (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported).

§snap_start: Option<FunctionSnapStart>§tags: Option<BTreeMap<String, String>>

A list of tags (https://docs.aws.amazon.com/lambda/latest/dg/tagging.html) to apply to the function.

§tenancy_config: Option<FunctionTenancyConfig>

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

§timeout: Option<i64>

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 (https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html).

§tracing_config: Option<FunctionTracingConfig>

Set Mode to Active to sample and trace a subset of incoming requests with X-Ray (https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html).

§vpc_config: Option<FunctionVpcConfig>

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 (https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html).

Trait Implementations§

Source§

impl Clone for FunctionSpec

Source§

fn clone(&self) -> FunctionSpec

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FunctionSpec

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for FunctionSpec

Source§

fn default() -> FunctionSpec

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for FunctionSpec

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for FunctionSpec

Source§

fn eq(&self, other: &FunctionSpec) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for FunctionSpec

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for FunctionSpec

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.