| Copyright | (c) 2013-2023 Brendan Hay |
|---|---|
| License | Mozilla Public License, v. 2.0. |
| Maintainer | Brendan Hay |
| Stability | auto-generated |
| Portability | non-portable (GHC extensions) |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Amazonka.CloudFront.CreateFunction
Description
Creates a CloudFront function.
To create a function, you provide the function code and some configuration information about the function. The response contains an Amazon Resource Name (ARN) that uniquely identifies the function.
When you create a function, it's in the DEVELOPMENT stage. In this
stage, you can test the function with TestFunction, and update it with
UpdateFunction.
When you're ready to use your function with a CloudFront distribution,
use PublishFunction to copy the function from the DEVELOPMENT stage
to LIVE. When it's live, you can attach the function to a
distribution's cache behavior, using the function's ARN.
Synopsis
- data CreateFunction = CreateFunction' {}
- newCreateFunction :: Text -> FunctionConfig -> ByteString -> CreateFunction
- createFunction_name :: Lens' CreateFunction Text
- createFunction_functionConfig :: Lens' CreateFunction FunctionConfig
- createFunction_functionCode :: Lens' CreateFunction ByteString
- data CreateFunctionResponse = CreateFunctionResponse' {}
- newCreateFunctionResponse :: Int -> CreateFunctionResponse
- createFunctionResponse_eTag :: Lens' CreateFunctionResponse (Maybe Text)
- createFunctionResponse_functionSummary :: Lens' CreateFunctionResponse (Maybe FunctionSummary)
- createFunctionResponse_location :: Lens' CreateFunctionResponse (Maybe Text)
- createFunctionResponse_httpStatus :: Lens' CreateFunctionResponse Int
Creating a Request
data CreateFunction Source #
See: newCreateFunction smart constructor.
Constructors
| CreateFunction' | |
Fields
| |
Instances
Arguments
| :: Text | |
| -> FunctionConfig | |
| -> ByteString | |
| -> CreateFunction |
Create a value of CreateFunction with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
CreateFunction, createFunction_name - A name to identify the function.
CreateFunction, createFunction_functionConfig - Configuration information about the function, including an optional
comment and the function's runtime.
$sel:functionCode:CreateFunction', createFunction_functionCode - The function code. For more information about writing a CloudFront
function, see
Writing function code for CloudFront Functions
in the Amazon CloudFront Developer Guide.--
-- Note: This Lens automatically encodes and decodes Base64 data.
-- The underlying isomorphism will encode to Base64 representation during
-- serialisation, and decode from Base64 representation during deserialisation.
-- This Lens accepts and returns only raw unencoded data.
Request Lenses
createFunction_name :: Lens' CreateFunction Text Source #
A name to identify the function.
createFunction_functionConfig :: Lens' CreateFunction FunctionConfig Source #
Configuration information about the function, including an optional comment and the function's runtime.
createFunction_functionCode :: Lens' CreateFunction ByteString Source #
The function code. For more information about writing a CloudFront
function, see
Writing function code for CloudFront Functions
in the Amazon CloudFront Developer Guide.--
-- Note: This Lens automatically encodes and decodes Base64 data.
-- The underlying isomorphism will encode to Base64 representation during
-- serialisation, and decode from Base64 representation during deserialisation.
-- This Lens accepts and returns only raw unencoded data.
Destructuring the Response
data CreateFunctionResponse Source #
See: newCreateFunctionResponse smart constructor.
Constructors
| CreateFunctionResponse' | |
Fields
| |
Instances
newCreateFunctionResponse Source #
Create a value of CreateFunctionResponse with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:eTag:CreateFunctionResponse', createFunctionResponse_eTag - The version identifier for the current version of the CloudFront
function.
CreateFunctionResponse, createFunctionResponse_functionSummary - Contains configuration information and metadata about a CloudFront
function.
$sel:location:CreateFunctionResponse', createFunctionResponse_location - The URL of the CloudFront function. Use the URL to manage the function
with the CloudFront API.
$sel:httpStatus:CreateFunctionResponse', createFunctionResponse_httpStatus - The response's http status code.
Response Lenses
createFunctionResponse_eTag :: Lens' CreateFunctionResponse (Maybe Text) Source #
The version identifier for the current version of the CloudFront function.
createFunctionResponse_functionSummary :: Lens' CreateFunctionResponse (Maybe FunctionSummary) Source #
Contains configuration information and metadata about a CloudFront function.
createFunctionResponse_location :: Lens' CreateFunctionResponse (Maybe Text) Source #
The URL of the CloudFront function. Use the URL to manage the function with the CloudFront API.
createFunctionResponse_httpStatus :: Lens' CreateFunctionResponse Int Source #
The response's http status code.