Skip to content

CloudFront  >  Operations  >  delete_function

delete_function

Operation

delete_function async

delete_function(input: DeleteFunctionInput, plugins: list[Plugin] | None = None) -> DeleteFunctionOutput

Deletes a CloudFront function.

You cannot delete a function if it's associated with a cache behavior. First, update your distributions to remove the function association from all cache behaviors, then delete the function.

To delete a function, you must provide the function's name and version (ETag value). To get these values, you can use ListFunctions and DescribeFunction.

Parameters:

Name Type Description Default
input DeleteFunctionInput

An instance of DeleteFunctionInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
DeleteFunctionOutput

An instance of DeleteFunctionOutput.

Input

DeleteFunctionInput dataclass

Bases: _SerdeShape

Dataclass for DeleteFunctionInput structure.

Attributes

if_match class-attribute instance-attribute
if_match: str | None = ...

The current version (ETag value) of the function that you are deleting, which you can get using DescribeFunction.

name class-attribute instance-attribute
name: str | None = ...

The name of the function that you are deleting.

Output

DeleteFunctionOutput dataclass

Bases: _SerdeShape

Dataclass for DeleteFunctionOutput structure.

Attributes

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.