aws_sdk_lambda/client/
update_function_code.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3    /// Constructs a fluent builder for the [`UpdateFunctionCode`](crate::operation::update_function_code::builders::UpdateFunctionCodeFluentBuilder) operation.
4    ///
5    /// - The fluent builder is configurable:
6    ///   - [`function_name(impl Into<String>)`](crate::operation::update_function_code::builders::UpdateFunctionCodeFluentBuilder::function_name) / [`set_function_name(Option<String>)`](crate::operation::update_function_code::builders::UpdateFunctionCodeFluentBuilder::set_function_name):<br>required: **true**<br><p>The name or ARN of the Lambda function.</p> <p class="title"><b>Name formats</b></p> <ul>  <li>   <p><b>Function name</b> – <code>my-function</code>.</p></li>  <li>   <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>  <li>   <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li> </ul> <p>The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.</p><br>
7    ///   - [`zip_file(Blob)`](crate::operation::update_function_code::builders::UpdateFunctionCodeFluentBuilder::zip_file) / [`set_zip_file(Option<Blob>)`](crate::operation::update_function_code::builders::UpdateFunctionCodeFluentBuilder::set_zip_file):<br>required: **false**<br><p>The base64-encoded contents of the deployment package. Amazon Web Services SDK and CLI clients handle the encoding for you. Use only with a function defined with a .zip file archive deployment package.</p><br>
8    ///   - [`s3_bucket(impl Into<String>)`](crate::operation::update_function_code::builders::UpdateFunctionCodeFluentBuilder::s3_bucket) / [`set_s3_bucket(Option<String>)`](crate::operation::update_function_code::builders::UpdateFunctionCodeFluentBuilder::set_s3_bucket):<br>required: **false**<br><p>An Amazon S3 bucket in the same Amazon Web Services Region as your function. The bucket can be in a different Amazon Web Services account. Use only with a function defined with a .zip file archive deployment package.</p><br>
9    ///   - [`s3_key(impl Into<String>)`](crate::operation::update_function_code::builders::UpdateFunctionCodeFluentBuilder::s3_key) / [`set_s3_key(Option<String>)`](crate::operation::update_function_code::builders::UpdateFunctionCodeFluentBuilder::set_s3_key):<br>required: **false**<br><p>The Amazon S3 key of the deployment package. Use only with a function defined with a .zip file archive deployment package.</p><br>
10    ///   - [`s3_object_version(impl Into<String>)`](crate::operation::update_function_code::builders::UpdateFunctionCodeFluentBuilder::s3_object_version) / [`set_s3_object_version(Option<String>)`](crate::operation::update_function_code::builders::UpdateFunctionCodeFluentBuilder::set_s3_object_version):<br>required: **false**<br><p>For versioned objects, the version of the deployment package object to use.</p><br>
11    ///   - [`image_uri(impl Into<String>)`](crate::operation::update_function_code::builders::UpdateFunctionCodeFluentBuilder::image_uri) / [`set_image_uri(Option<String>)`](crate::operation::update_function_code::builders::UpdateFunctionCodeFluentBuilder::set_image_uri):<br>required: **false**<br><p>URI of a container image in the Amazon ECR registry. Do not use for a function defined with a .zip file archive.</p><br>
12    ///   - [`publish(bool)`](crate::operation::update_function_code::builders::UpdateFunctionCodeFluentBuilder::publish) / [`set_publish(Option<bool>)`](crate::operation::update_function_code::builders::UpdateFunctionCodeFluentBuilder::set_publish):<br>required: **false**<br><p>Set to true to publish a new version of the function after updating the code. This has the same effect as calling <code>PublishVersion</code> separately.</p><br>
13    ///   - [`dry_run(bool)`](crate::operation::update_function_code::builders::UpdateFunctionCodeFluentBuilder::dry_run) / [`set_dry_run(Option<bool>)`](crate::operation::update_function_code::builders::UpdateFunctionCodeFluentBuilder::set_dry_run):<br>required: **false**<br><p>Set to true to validate the request parameters and access permissions without modifying the function code.</p><br>
14    ///   - [`revision_id(impl Into<String>)`](crate::operation::update_function_code::builders::UpdateFunctionCodeFluentBuilder::revision_id) / [`set_revision_id(Option<String>)`](crate::operation::update_function_code::builders::UpdateFunctionCodeFluentBuilder::set_revision_id):<br>required: **false**<br><p>Update the function only if the revision ID matches the ID that's specified. Use this option to avoid modifying a function that has changed since you last read it.</p><br>
15    ///   - [`architectures(Architecture)`](crate::operation::update_function_code::builders::UpdateFunctionCodeFluentBuilder::architectures) / [`set_architectures(Option<Vec::<Architecture>>)`](crate::operation::update_function_code::builders::UpdateFunctionCodeFluentBuilder::set_architectures):<br>required: **false**<br><p>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 <code>x86_64</code>.</p><br>
16    ///   - [`source_kms_key_arn(impl Into<String>)`](crate::operation::update_function_code::builders::UpdateFunctionCodeFluentBuilder::source_kms_key_arn) / [`set_source_kms_key_arn(Option<String>)`](crate::operation::update_function_code::builders::UpdateFunctionCodeFluentBuilder::set_source_kms_key_arn):<br>required: **false**<br><p>The ARN of the Key Management Service (KMS) customer managed key that's used to encrypt your function's .zip deployment package. If you don't provide a customer managed key, Lambda uses an Amazon Web Services managed key.</p><br>
17    /// - On success, responds with [`UpdateFunctionCodeOutput`](crate::operation::update_function_code::UpdateFunctionCodeOutput) with field(s):
18    ///   - [`function_name(Option<String>)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::function_name): <p>The name of the function.</p>
19    ///   - [`function_arn(Option<String>)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::function_arn): <p>The function's Amazon Resource Name (ARN).</p>
20    ///   - [`runtime(Option<Runtime>)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::runtime): <p>The identifier of the function's <a href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html"> runtime</a>. 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.</p> <p>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 <a href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-deprecation-levels">Runtime use after deprecation</a>.</p> <p>For a list of all currently supported runtimes, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported">Supported runtimes</a>.</p>
21    ///   - [`role(Option<String>)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::role): <p>The function's execution role.</p>
22    ///   - [`handler(Option<String>)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::handler): <p>The function that Lambda calls to begin running your function.</p>
23    ///   - [`code_size(i64)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::code_size): <p>The size of the function's deployment package, in bytes.</p>
24    ///   - [`description(Option<String>)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::description): <p>The function's description.</p>
25    ///   - [`timeout(Option<i32>)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::timeout): <p>The amount of time in seconds that Lambda allows a function to run before stopping it.</p>
26    ///   - [`memory_size(Option<i32>)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::memory_size): <p>The amount of memory available to the function at runtime.</p>
27    ///   - [`last_modified(Option<String>)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::last_modified): <p>The date and time that the function was last updated, in <a href="https://www.w3.org/TR/NOTE-datetime">ISO-8601 format</a> (YYYY-MM-DDThh:mm:ss.sTZD).</p>
28    ///   - [`code_sha256(Option<String>)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::code_sha256): <p>The SHA256 hash of the function's deployment package.</p>
29    ///   - [`version(Option<String>)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::version): <p>The version of the Lambda function.</p>
30    ///   - [`vpc_config(Option<VpcConfigResponse>)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::vpc_config): <p>The function's networking configuration.</p>
31    ///   - [`dead_letter_config(Option<DeadLetterConfig>)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::dead_letter_config): <p>The function's dead letter queue.</p>
32    ///   - [`environment(Option<EnvironmentResponse>)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::environment): <p>The function's <a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html">environment variables</a>. Omitted from CloudTrail logs.</p>
33    ///   - [`kms_key_arn(Option<String>)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::kms_key_arn): <p>The ARN of the Key Management Service (KMS) customer managed key that's used to encrypt the following resources:</p> <ul>  <li>   <p>The function's <a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption">environment variables</a>.</p></li>  <li>   <p>The function's <a href="https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html">Lambda SnapStart</a> snapshots.</p></li>  <li>   <p>When used with <code>SourceKMSKeyArn</code>, the unzipped version of the .zip deployment package that's used for function invocations. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/encrypt-zip-package.html#enable-zip-custom-encryption"> Specifying a customer managed key for Lambda</a>.</p></li>  <li>   <p>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 <a href="https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-lifecycle">Function lifecycle</a>.</p></li> </ul> <p>If you don't provide a customer managed key, Lambda uses an <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk">Amazon Web Services owned key</a> or an <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk">Amazon Web Services managed key</a>.</p>
34    ///   - [`tracing_config(Option<TracingConfigResponse>)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::tracing_config): <p>The function's X-Ray tracing configuration.</p>
35    ///   - [`master_arn(Option<String>)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::master_arn): <p>For Lambda@Edge functions, the ARN of the main function.</p>
36    ///   - [`revision_id(Option<String>)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::revision_id): <p>The latest updated revision of the function or alias.</p>
37    ///   - [`layers(Option<Vec::<Layer>>)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::layers): <p>The function's <a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html">layers</a>.</p>
38    ///   - [`state(Option<State>)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::state): <p>The current state of the function. When the state is <code>Inactive</code>, you can reactivate the function by invoking it.</p>
39    ///   - [`state_reason(Option<String>)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::state_reason): <p>The reason for the function's current state.</p>
40    ///   - [`state_reason_code(Option<StateReasonCode>)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::state_reason_code): <p>The reason code for the function's current state. When the code is <code>Creating</code>, you can't invoke or modify the function.</p>
41    ///   - [`last_update_status(Option<LastUpdateStatus>)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::last_update_status): <p>The status of the last update that was performed on the function. This is first set to <code>Successful</code> after function creation completes.</p>
42    ///   - [`last_update_status_reason(Option<String>)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::last_update_status_reason): <p>The reason for the last update that was performed on the function.</p>
43    ///   - [`last_update_status_reason_code(Option<LastUpdateStatusReasonCode>)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::last_update_status_reason_code): <p>The reason code for the last update that was performed on the function.</p>
44    ///   - [`file_system_configs(Option<Vec::<FileSystemConfig>>)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::file_system_configs): <p>Connection settings for an <a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html">Amazon EFS file system</a>.</p>
45    ///   - [`package_type(Option<PackageType>)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::package_type): <p>The type of deployment package. Set to <code>Image</code> for container image and set <code>Zip</code> for .zip file archive.</p>
46    ///   - [`image_config_response(Option<ImageConfigResponse>)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::image_config_response): <p>The function's image configuration values.</p>
47    ///   - [`signing_profile_version_arn(Option<String>)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::signing_profile_version_arn): <p>The ARN of the signing profile version.</p>
48    ///   - [`signing_job_arn(Option<String>)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::signing_job_arn): <p>The ARN of the signing job.</p>
49    ///   - [`architectures(Option<Vec::<Architecture>>)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::architectures): <p>The instruction set architecture that the function supports. Architecture is a string array with one of the valid values. The default architecture value is <code>x86_64</code>.</p>
50    ///   - [`ephemeral_storage(Option<EphemeralStorage>)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::ephemeral_storage): <p>The size of the function's <code>/tmp</code> directory in MB. The default value is 512, but can be any whole number between 512 and 10,240 MB. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-ephemeral-storage">Configuring ephemeral storage (console)</a>.</p>
51    ///   - [`snap_start(Option<SnapStartResponse>)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::snap_start): <p>Set <code>ApplyOn</code> to <code>PublishedVersions</code> to create a snapshot of the initialized execution environment when you publish a function version. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html">Improving startup performance with Lambda SnapStart</a>.</p>
52    ///   - [`runtime_version_config(Option<RuntimeVersionConfig>)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::runtime_version_config): <p>The ARN of the runtime and any errors that occured.</p>
53    ///   - [`logging_config(Option<LoggingConfig>)`](crate::operation::update_function_code::UpdateFunctionCodeOutput::logging_config): <p>The function's Amazon CloudWatch Logs configuration settings.</p>
54    /// - On failure, responds with [`SdkError<UpdateFunctionCodeError>`](crate::operation::update_function_code::UpdateFunctionCodeError)
55    pub fn update_function_code(&self) -> crate::operation::update_function_code::builders::UpdateFunctionCodeFluentBuilder {
56        crate::operation::update_function_code::builders::UpdateFunctionCodeFluentBuilder::new(self.handle.clone())
57    }
58}