The cloudFront function requires an input and output ports as a tuple parameter
in order to communicate with the JavaScript handler code.
port module MyModule exposing (..)
import CloudFront exposing (cloudFront)
import Json.Decode as Decode
import Json.Encode as Encode
port inputEvent : (Decode.Value -> msg) -> Sub msg
port outputEvent : Encode.Value -> Cmd msgThe ports must have the same type as the example.
Model contains the decoded InputEvent and the optional flags passed on init.
Msg is used to contain the result/error of decoding the input event from ports.
Create a CloudFront origin handler to handle the request/response of your CloudFront distribution: