pub struct Builder { /* private fields */ }
Expand description

A builder for CreateFunctionInput.

Implementations§

The name 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.

Examples found in repository?
src/client.rs (line 2403)
2402
2403
2404
2405
        pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
            self.inner = self.inner.function_name(input.into());
            self
        }

The name 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.

Examples found in repository?
src/client.rs (line 2418)
2414
2415
2416
2417
2418
2419
2420
        pub fn set_function_name(
            mut self,
            input: std::option::Option<std::string::String>,
        ) -> Self {
            self.inner = self.inner.set_function_name(input);
            self
        }

The identifier of the function's runtime. Runtime is required if the deployment package is a .zip file archive.

Examples found in repository?
src/client.rs (line 2423)
2422
2423
2424
2425
        pub fn runtime(mut self, input: crate::model::Runtime) -> Self {
            self.inner = self.inner.runtime(input);
            self
        }

The identifier of the function's runtime. Runtime is required if the deployment package is a .zip file archive.

Examples found in repository?
src/client.rs (line 2428)
2427
2428
2429
2430
        pub fn set_runtime(mut self, input: std::option::Option<crate::model::Runtime>) -> Self {
            self.inner = self.inner.set_runtime(input);
            self
        }

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

Examples found in repository?
src/client.rs (line 2433)
2432
2433
2434
2435
        pub fn role(mut self, input: impl Into<std::string::String>) -> Self {
            self.inner = self.inner.role(input.into());
            self
        }

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

Examples found in repository?
src/client.rs (line 2438)
2437
2438
2439
2440
        pub fn set_role(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.inner = self.inner.set_role(input);
            self
        }

The name of the method within your code that Lambda calls to execute 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 Programming Model.

Examples found in repository?
src/client.rs (line 2443)
2442
2443
2444
2445
        pub fn handler(mut self, input: impl Into<std::string::String>) -> Self {
            self.inner = self.inner.handler(input.into());
            self
        }

The name of the method within your code that Lambda calls to execute 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 Programming Model.

Examples found in repository?
src/client.rs (line 2448)
2447
2448
2449
2450
        pub fn set_handler(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.inner = self.inner.set_handler(input);
            self
        }

The code for the function.

Examples found in repository?
src/client.rs (line 2453)
2452
2453
2454
2455
        pub fn code(mut self, input: crate::model::FunctionCode) -> Self {
            self.inner = self.inner.code(input);
            self
        }

The code for the function.

Examples found in repository?
src/client.rs (line 2458)
2457
2458
2459
2460
        pub fn set_code(mut self, input: std::option::Option<crate::model::FunctionCode>) -> Self {
            self.inner = self.inner.set_code(input);
            self
        }

A description of the function.

Examples found in repository?
src/client.rs (line 2463)
2462
2463
2464
2465
        pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
            self.inner = self.inner.description(input.into());
            self
        }

A description of the function.

Examples found in repository?
src/client.rs (line 2468)
2467
2468
2469
2470
        pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.inner = self.inner.set_description(input);
            self
        }

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 additional information, see Lambda execution environment.

Examples found in repository?
src/client.rs (line 2473)
2472
2473
2474
2475
        pub fn timeout(mut self, input: i32) -> Self {
            self.inner = self.inner.timeout(input);
            self
        }

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 additional information, see Lambda execution environment.

Examples found in repository?
src/client.rs (line 2478)
2477
2478
2479
2480
        pub fn set_timeout(mut self, input: std::option::Option<i32>) -> Self {
            self.inner = self.inner.set_timeout(input);
            self
        }

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.

Examples found in repository?
src/client.rs (line 2483)
2482
2483
2484
2485
        pub fn memory_size(mut self, input: i32) -> Self {
            self.inner = self.inner.memory_size(input);
            self
        }

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.

Examples found in repository?
src/client.rs (line 2488)
2487
2488
2489
2490
        pub fn set_memory_size(mut self, input: std::option::Option<i32>) -> Self {
            self.inner = self.inner.set_memory_size(input);
            self
        }

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

Examples found in repository?
src/client.rs (line 2493)
2492
2493
2494
2495
        pub fn publish(mut self, input: bool) -> Self {
            self.inner = self.inner.publish(input);
            self
        }

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

Examples found in repository?
src/client.rs (line 2498)
2497
2498
2499
2500
        pub fn set_publish(mut self, input: std::option::Option<bool>) -> Self {
            self.inner = self.inner.set_publish(input);
            self
        }

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 only access resources and the internet through that VPC. For more information, see VPC Settings.

Examples found in repository?
src/client.rs (line 2503)
2502
2503
2504
2505
        pub fn vpc_config(mut self, input: crate::model::VpcConfig) -> Self {
            self.inner = self.inner.vpc_config(input);
            self
        }

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 only access resources and the internet through that VPC. For more information, see VPC Settings.

Examples found in repository?
src/client.rs (line 2511)
2507
2508
2509
2510
2511
2512
2513
        pub fn set_vpc_config(
            mut self,
            input: std::option::Option<crate::model::VpcConfig>,
        ) -> Self {
            self.inner = self.inner.set_vpc_config(input);
            self
        }

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

Examples found in repository?
src/client.rs (line 2516)
2515
2516
2517
2518
        pub fn package_type(mut self, input: crate::model::PackageType) -> Self {
            self.inner = self.inner.package_type(input);
            self
        }

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

Examples found in repository?
src/client.rs (line 2524)
2520
2521
2522
2523
2524
2525
2526
        pub fn set_package_type(
            mut self,
            input: std::option::Option<crate::model::PackageType>,
        ) -> Self {
            self.inner = self.inner.set_package_type(input);
            self
        }

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.

Examples found in repository?
src/client.rs (line 2529)
2528
2529
2530
2531
        pub fn dead_letter_config(mut self, input: crate::model::DeadLetterConfig) -> Self {
            self.inner = self.inner.dead_letter_config(input);
            self
        }

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.

Examples found in repository?
src/client.rs (line 2537)
2533
2534
2535
2536
2537
2538
2539
        pub fn set_dead_letter_config(
            mut self,
            input: std::option::Option<crate::model::DeadLetterConfig>,
        ) -> Self {
            self.inner = self.inner.set_dead_letter_config(input);
            self
        }

Environment variables that are accessible from function code during execution.

Examples found in repository?
src/client.rs (line 2542)
2541
2542
2543
2544
        pub fn environment(mut self, input: crate::model::Environment) -> Self {
            self.inner = self.inner.environment(input);
            self
        }

Environment variables that are accessible from function code during execution.

Examples found in repository?
src/client.rs (line 2550)
2546
2547
2548
2549
2550
2551
2552
        pub fn set_environment(
            mut self,
            input: std::option::Option<crate::model::Environment>,
        ) -> Self {
            self.inner = self.inner.set_environment(input);
            self
        }

The ARN of the Amazon Web Services Key Management Service (KMS) key that's used to encrypt your function's environment variables. If it's not provided, Lambda uses a default service key.

Examples found in repository?
src/client.rs (line 2555)
2554
2555
2556
2557
        pub fn kms_key_arn(mut self, input: impl Into<std::string::String>) -> Self {
            self.inner = self.inner.kms_key_arn(input.into());
            self
        }

The ARN of the Amazon Web Services Key Management Service (KMS) key that's used to encrypt your function's environment variables. If it's not provided, Lambda uses a default service key.

Examples found in repository?
src/client.rs (line 2560)
2559
2560
2561
2562
        pub fn set_kms_key_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.inner = self.inner.set_kms_key_arn(input);
            self
        }

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

Examples found in repository?
src/client.rs (line 2565)
2564
2565
2566
2567
        pub fn tracing_config(mut self, input: crate::model::TracingConfig) -> Self {
            self.inner = self.inner.tracing_config(input);
            self
        }

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

Examples found in repository?
src/client.rs (line 2573)
2569
2570
2571
2572
2573
2574
2575
        pub fn set_tracing_config(
            mut self,
            input: std::option::Option<crate::model::TracingConfig>,
        ) -> Self {
            self.inner = self.inner.set_tracing_config(input);
            self
        }

Adds a key-value pair to tags.

To override the contents of this collection use set_tags.

A list of tags to apply to the function.

Examples found in repository?
src/client.rs (line 2586)
2581
2582
2583
2584
2585
2586
2587
2588
        pub fn tags(
            mut self,
            k: impl Into<std::string::String>,
            v: impl Into<std::string::String>,
        ) -> Self {
            self.inner = self.inner.tags(k.into(), v.into());
            self
        }

A list of tags to apply to the function.

Examples found in repository?
src/client.rs (line 2596)
2590
2591
2592
2593
2594
2595
2596
2597
2598
        pub fn set_tags(
            mut self,
            input: std::option::Option<
                std::collections::HashMap<std::string::String, std::string::String>,
            >,
        ) -> Self {
            self.inner = self.inner.set_tags(input);
            self
        }

Appends an item to layers.

To override the contents of this collection use set_layers.

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

Examples found in repository?
src/client.rs (line 2605)
2604
2605
2606
2607
        pub fn layers(mut self, input: impl Into<std::string::String>) -> Self {
            self.inner = self.inner.layers(input.into());
            self
        }

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

Examples found in repository?
src/client.rs (line 2613)
2609
2610
2611
2612
2613
2614
2615
        pub fn set_layers(
            mut self,
            input: std::option::Option<std::vec::Vec<std::string::String>>,
        ) -> Self {
            self.inner = self.inner.set_layers(input);
            self
        }

Appends an item to file_system_configs.

To override the contents of this collection use set_file_system_configs.

Connection settings for an Amazon EFS file system.

Examples found in repository?
src/client.rs (line 2622)
2621
2622
2623
2624
        pub fn file_system_configs(mut self, input: crate::model::FileSystemConfig) -> Self {
            self.inner = self.inner.file_system_configs(input);
            self
        }

Connection settings for an Amazon EFS file system.

Examples found in repository?
src/client.rs (line 2630)
2626
2627
2628
2629
2630
2631
2632
        pub fn set_file_system_configs(
            mut self,
            input: std::option::Option<std::vec::Vec<crate::model::FileSystemConfig>>,
        ) -> Self {
            self.inner = self.inner.set_file_system_configs(input);
            self
        }

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

Examples found in repository?
src/client.rs (line 2635)
2634
2635
2636
2637
        pub fn image_config(mut self, input: crate::model::ImageConfig) -> Self {
            self.inner = self.inner.image_config(input);
            self
        }

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

Examples found in repository?
src/client.rs (line 2643)
2639
2640
2641
2642
2643
2644
2645
        pub fn set_image_config(
            mut self,
            input: std::option::Option<crate::model::ImageConfig>,
        ) -> Self {
            self.inner = self.inner.set_image_config(input);
            self
        }

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.

Examples found in repository?
src/client.rs (line 2648)
2647
2648
2649
2650
        pub fn code_signing_config_arn(mut self, input: impl Into<std::string::String>) -> Self {
            self.inner = self.inner.code_signing_config_arn(input.into());
            self
        }

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.

Examples found in repository?
src/client.rs (line 2656)
2652
2653
2654
2655
2656
2657
2658
        pub fn set_code_signing_config_arn(
            mut self,
            input: std::option::Option<std::string::String>,
        ) -> Self {
            self.inner = self.inner.set_code_signing_config_arn(input);
            self
        }

Appends an item to architectures.

To override the contents of this collection use set_architectures.

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.

Examples found in repository?
src/client.rs (line 2665)
2664
2665
2666
2667
        pub fn architectures(mut self, input: crate::model::Architecture) -> Self {
            self.inner = self.inner.architectures(input);
            self
        }

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.

Examples found in repository?
src/client.rs (line 2673)
2669
2670
2671
2672
2673
2674
2675
        pub fn set_architectures(
            mut self,
            input: std::option::Option<std::vec::Vec<crate::model::Architecture>>,
        ) -> Self {
            self.inner = self.inner.set_architectures(input);
            self
        }

The size of the function’s /tmp directory in MB. The default value is 512, but can be any whole number between 512 and 10240 MB.

Examples found in repository?
src/client.rs (line 2678)
2677
2678
2679
2680
        pub fn ephemeral_storage(mut self, input: crate::model::EphemeralStorage) -> Self {
            self.inner = self.inner.ephemeral_storage(input);
            self
        }

The size of the function’s /tmp directory in MB. The default value is 512, but can be any whole number between 512 and 10240 MB.

Examples found in repository?
src/client.rs (line 2686)
2682
2683
2684
2685
2686
2687
2688
        pub fn set_ephemeral_storage(
            mut self,
            input: std::option::Option<crate::model::EphemeralStorage>,
        ) -> Self {
            self.inner = self.inner.set_ephemeral_storage(input);
            self
        }

Consumes the builder and constructs a CreateFunctionInput.

Examples found in repository?
src/client.rs (line 2363)
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
        pub async fn customize(
            self,
        ) -> std::result::Result<
            crate::operation::customize::CustomizableOperation<
                crate::operation::CreateFunction,
                aws_http::retry::AwsResponseRetryClassifier,
            >,
            aws_smithy_http::result::SdkError<crate::error::CreateFunctionError>,
        > {
            let handle = self.handle.clone();
            let operation = self
                .inner
                .build()
                .map_err(aws_smithy_http::result::SdkError::construction_failure)?
                .make_operation(&handle.conf)
                .await
                .map_err(aws_smithy_http::result::SdkError::construction_failure)?;
            Ok(crate::operation::customize::CustomizableOperation { handle, operation })
        }

        /// Sends the request and returns the response.
        ///
        /// If an error occurs, an `SdkError` will be returned with additional details that
        /// can be matched against.
        ///
        /// By default, any retryable failures will be retried twice. Retry behavior
        /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
        /// set when configuring the client.
        pub async fn send(
            self,
        ) -> std::result::Result<
            crate::output::CreateFunctionOutput,
            aws_smithy_http::result::SdkError<crate::error::CreateFunctionError>,
        > {
            let op = self
                .inner
                .build()
                .map_err(aws_smithy_http::result::SdkError::construction_failure)?
                .make_operation(&self.handle.conf)
                .await
                .map_err(aws_smithy_http::result::SdkError::construction_failure)?;
            self.handle.client.call(op).await
        }

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more