Skip to content

CloudFront  >  Operations  >  get_function

get_function

Operation

get_function async

get_function(input: GetFunctionInput, plugins: list[Plugin] | None = None) -> GetFunctionOutput

Gets the code of a CloudFront function. To get configuration information and metadata about a function, use DescribeFunction.

To get a function's code, you must provide the function's name and stage. To get these values, you can use ListFunctions.

Parameters:

Name Type Description Default
input GetFunctionInput

An instance of GetFunctionInput.

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
GetFunctionOutput

An instance of GetFunctionOutput.

Input

GetFunctionInput dataclass

Bases: _SerdeShape

Dataclass for GetFunctionInput structure.

Attributes

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

The name of the function whose code you are getting.

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

The function's stage, either DEVELOPMENT or LIVE.

Output

GetFunctionOutput dataclass

Bases: _SerdeShape

Dataclass for GetFunctionOutput structure.

Attributes

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

The content type (media type) of the response.

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

The version identifier for the current version of the CloudFront function.

function_code class-attribute instance-attribute
function_code: bytes | None = ...

The function code of a CloudFront function.

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.