delete_function

CloudFront.Client.delete_function(**kwargs)

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 .

See also: AWS API Documentation

Request Syntax

response = client.delete_function(
    Name='string',
    IfMatch='string'
)
Parameters
  • Name (string) --

    [REQUIRED]

    The name of the function that you are deleting.

  • IfMatch (string) --

    [REQUIRED]

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

Returns

None

Exceptions

  • CloudFront.Client.exceptions.InvalidIfMatchVersion
  • CloudFront.Client.exceptions.NoSuchFunctionExists
  • CloudFront.Client.exceptions.FunctionInUse
  • CloudFront.Client.exceptions.PreconditionFailed
  • CloudFront.Client.exceptions.UnsupportedOperation