// Code generated by smithy-go-codegen DO NOT EDIT. package lambda import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/lambda/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Modify the version-specific settings of a Lambda function. When you update a // function, Lambda provisions an instance of the function and its supporting // resources. If your function connects to a VPC, this process can take a minute. // During this time, you can't modify the function, but you can still invoke it. // The LastUpdateStatus , LastUpdateStatusReason , and LastUpdateStatusReasonCode // fields in the response from GetFunctionConfiguration indicate when the update // is complete and the function is processing events with the new configuration. // For more information, see Lambda function states (https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html) // . These settings can vary between versions of a function and are locked when you // publish a version. You can't modify the configuration of a published version, // only the unpublished version. To configure function concurrency, use // PutFunctionConcurrency . To grant invoke permissions to an Amazon Web Services // account or Amazon Web Service, use AddPermission . func (c *Client) UpdateFunctionConfiguration(ctx context.Context, params *UpdateFunctionConfigurationInput, optFns ...func(*Options)) (*UpdateFunctionConfigurationOutput, error) { if params == nil { params = &UpdateFunctionConfigurationInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateFunctionConfiguration", params, optFns, c.addOperationUpdateFunctionConfigurationMiddlewares) if err != nil { return nil, err } out := result.(*UpdateFunctionConfigurationOutput) out.ResultMetadata = metadata return out, nil } type UpdateFunctionConfigurationInput struct { // 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. // // This member is required. FunctionName *string // 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) // . DeadLetterConfig *types.DeadLetterConfig // A description of the function. Description *string // Environment variables that are accessible from function code during execution. Environment *types.Environment // 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. EphemeralStorage *types.EphemeralStorage // Connection settings for an Amazon EFS file system. FileSystemConfigs []types.FileSystemConfig // 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) // . Handler *string // Container image configuration values (https://docs.aws.amazon.com/lambda/latest/dg/images-parms.html) // that override the values in the container image Docker file. ImageConfig *types.ImageConfig // The ARN of the Key Management Service (KMS) customer managed key that's used to // encrypt your function's environment variables (https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption) // . When Lambda SnapStart (https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html) // is activated, Lambda also uses this key is to encrypt your function's snapshot. // If you deploy your function using a container image, Lambda also uses this key // to encrypt your function when it's deployed. Note that this is not the same key // that's used to protect your container image in the Amazon Elastic Container // Registry (Amazon ECR). If you don't provide a customer managed key, Lambda uses // a default service key. KMSKeyArn *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. Layers []string // 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. MemorySize *int32 // 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. RevisionId *string // The Amazon Resource Name (ARN) of the function's execution role. Role *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. The // following list includes deprecated runtimes. For more information, see Runtime // deprecation policy (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-support-policy) // . Runtime types.Runtime // The function's SnapStart (https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html) // setting. SnapStart *types.SnapStart // 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) // . Timeout *int32 // 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) // . TracingConfig *types.TracingConfig // 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) // . VpcConfig *types.VpcConfig noSmithyDocumentSerde } // Details about a function's configuration. type UpdateFunctionConfigurationOutput struct { // The instruction set architecture that the function supports. Architecture is a // string array with one of the valid values. The default architecture value is // x86_64 . Architectures []types.Architecture // The SHA256 hash of the function's deployment package. CodeSha256 *string // The size of the function's deployment package, in bytes. CodeSize int64 // The function's dead letter queue. DeadLetterConfig *types.DeadLetterConfig // The function's description. Description *string // The function's environment variables (https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html) // . Omitted from CloudTrail logs. Environment *types.EnvironmentResponse // The size of the function’s /tmp directory in MB. The default value is 512, but // it can be any whole number between 512 and 10,240 MB. EphemeralStorage *types.EphemeralStorage // Connection settings for an Amazon EFS file system (https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html) // . FileSystemConfigs []types.FileSystemConfig // The function's Amazon Resource Name (ARN). FunctionArn *string // The name of the function. FunctionName *string // The function that Lambda calls to begin running your function. Handler *string // The function's image configuration values. ImageConfigResponse *types.ImageConfigResponse // The KMS key that's used to encrypt the function's environment variables (https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption) // . When Lambda SnapStart (https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html) // is activated, this key is also used to encrypt the function's snapshot. This key // is returned only if you've configured a customer managed key. KMSKeyArn *string // The date and time that the function was last updated, in ISO-8601 format (https://www.w3.org/TR/NOTE-datetime) // (YYYY-MM-DDThh:mm:ss.sTZD). LastModified *string // The status of the last update that was performed on the function. This is first // set to Successful after function creation completes. LastUpdateStatus types.LastUpdateStatus // The reason for the last update that was performed on the function. LastUpdateStatusReason *string // The reason code for the last update that was performed on the function. LastUpdateStatusReasonCode types.LastUpdateStatusReasonCode // The function's layers (https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) // . Layers []types.Layer // For Lambda@Edge functions, the ARN of the main function. MasterArn *string // The amount of memory available to the function at runtime. MemorySize *int32 // The type of deployment package. Set to Image for container image and set Zip // for .zip file archive. PackageType types.PackageType // The latest updated revision of the function or alias. RevisionId *string // The function's execution role. Role *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. The // following list includes deprecated runtimes. For more information, see Runtime // deprecation policy (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-support-policy) // . Runtime types.Runtime // The ARN of the runtime and any errors that occured. RuntimeVersionConfig *types.RuntimeVersionConfig // The ARN of the signing job. SigningJobArn *string // The ARN of the signing profile version. SigningProfileVersionArn *string // Set ApplyOn to PublishedVersions to create a snapshot of the initialized // execution environment when you publish a function version. For more information, // see Improving startup performance with Lambda SnapStart (https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html) // . SnapStart *types.SnapStartResponse // The current state of the function. When the state is Inactive , you can // reactivate the function by invoking it. State types.State // The reason for the function's current state. StateReason *string // The reason code for the function's current state. When the code is Creating , // you can't invoke or modify the function. StateReasonCode types.StateReasonCode // The amount of time in seconds that Lambda allows a function to run before // stopping it. Timeout *int32 // The function's X-Ray tracing configuration. TracingConfig *types.TracingConfigResponse // The version of the Lambda function. Version *string // The function's networking configuration. VpcConfig *types.VpcConfigResponse // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateFunctionConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateFunctionConfiguration{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateFunctionConfiguration{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateFunctionConfigurationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateFunctionConfiguration(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opUpdateFunctionConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "lambda", OperationName: "UpdateFunctionConfiguration", } }