amazonka-lambda-2.0: Amazon Lambda SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.Lambda.Types.Cors

Description

 
Synopsis

Documentation

data Cors Source #

The cross-origin resource sharing (CORS) settings for your Lambda function URL. Use CORS to grant access to your function URL from any origin. You can also use CORS to control access for specific HTTP headers and methods in requests to your function URL.

See: newCors smart constructor.

Constructors

Cors' 

Fields

  • allowCredentials :: Maybe Bool

    Whether to allow cookies or other credentials in requests to your function URL. The default is false.

  • allowHeaders :: Maybe [Text]

    The HTTP headers that origins can include in requests to your function URL. For example: Date, Keep-Alive, X-Custom-Header.

  • allowMethods :: Maybe [Text]

    The HTTP methods that are allowed when calling your function URL. For example: GET, POST, DELETE, or the wildcard character (*).

  • allowOrigins :: Maybe [Text]

    The origins that can access your function URL. You can list any number of specific origins, separated by a comma. For example: https://www.example.com, http://localhost:60905.

    Alternatively, you can grant access to all origins using the wildcard character (*).

  • exposeHeaders :: Maybe [Text]

    The HTTP headers in your function response that you want to expose to origins that call your function URL. For example: Date, Keep-Alive, X-Custom-Header.

  • maxAge :: Maybe Natural

    The maximum amount of time, in seconds, that web browsers can cache results of a preflight request. By default, this is set to 0, which means that the browser doesn't cache results.

Instances

Instances details
FromJSON Cors Source # 
Instance details

Defined in Amazonka.Lambda.Types.Cors

ToJSON Cors Source # 
Instance details

Defined in Amazonka.Lambda.Types.Cors

Generic Cors Source # 
Instance details

Defined in Amazonka.Lambda.Types.Cors

Associated Types

type Rep Cors :: Type -> Type #

Methods

from :: Cors -> Rep Cors x #

to :: Rep Cors x -> Cors #

Read Cors Source # 
Instance details

Defined in Amazonka.Lambda.Types.Cors

Show Cors Source # 
Instance details

Defined in Amazonka.Lambda.Types.Cors

Methods

showsPrec :: Int -> Cors -> ShowS #

show :: Cors -> String #

showList :: [Cors] -> ShowS #

NFData Cors Source # 
Instance details

Defined in Amazonka.Lambda.Types.Cors

Methods

rnf :: Cors -> () #

Eq Cors Source # 
Instance details

Defined in Amazonka.Lambda.Types.Cors

Methods

(==) :: Cors -> Cors -> Bool #

(/=) :: Cors -> Cors -> Bool #

Hashable Cors Source # 
Instance details

Defined in Amazonka.Lambda.Types.Cors

Methods

hashWithSalt :: Int -> Cors -> Int #

hash :: Cors -> Int #

type Rep Cors Source # 
Instance details

Defined in Amazonka.Lambda.Types.Cors

type Rep Cors = D1 ('MetaData "Cors" "Amazonka.Lambda.Types.Cors" "amazonka-lambda-2.0-FcjxCCKaCGK94C2lDO9alC" 'False) (C1 ('MetaCons "Cors'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "allowCredentials") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool)) :*: (S1 ('MetaSel ('Just "allowHeaders") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Text])) :*: S1 ('MetaSel ('Just "allowMethods") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Text])))) :*: (S1 ('MetaSel ('Just "allowOrigins") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Text])) :*: (S1 ('MetaSel ('Just "exposeHeaders") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Text])) :*: S1 ('MetaSel ('Just "maxAge") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Natural))))))

newCors :: Cors Source #

Create a value of Cors 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:allowCredentials:Cors', cors_allowCredentials - Whether to allow cookies or other credentials in requests to your function URL. The default is false.

$sel:allowHeaders:Cors', cors_allowHeaders - The HTTP headers that origins can include in requests to your function URL. For example: Date, Keep-Alive, X-Custom-Header.

$sel:allowMethods:Cors', cors_allowMethods - The HTTP methods that are allowed when calling your function URL. For example: GET, POST, DELETE, or the wildcard character (*).

$sel:allowOrigins:Cors', cors_allowOrigins - The origins that can access your function URL. You can list any number of specific origins, separated by a comma. For example: https://www.example.com, http://localhost:60905.

Alternatively, you can grant access to all origins using the wildcard character (*).

$sel:exposeHeaders:Cors', cors_exposeHeaders - The HTTP headers in your function response that you want to expose to origins that call your function URL. For example: Date, Keep-Alive, X-Custom-Header.

$sel:maxAge:Cors', cors_maxAge - The maximum amount of time, in seconds, that web browsers can cache results of a preflight request. By default, this is set to 0, which means that the browser doesn't cache results.

cors_allowCredentials :: Lens' Cors (Maybe Bool) Source #

Whether to allow cookies or other credentials in requests to your function URL. The default is false.

cors_allowHeaders :: Lens' Cors (Maybe [Text]) Source #

The HTTP headers that origins can include in requests to your function URL. For example: Date, Keep-Alive, X-Custom-Header.

cors_allowMethods :: Lens' Cors (Maybe [Text]) Source #

The HTTP methods that are allowed when calling your function URL. For example: GET, POST, DELETE, or the wildcard character (*).

cors_allowOrigins :: Lens' Cors (Maybe [Text]) Source #

The origins that can access your function URL. You can list any number of specific origins, separated by a comma. For example: https://www.example.com, http://localhost:60905.

Alternatively, you can grant access to all origins using the wildcard character (*).

cors_exposeHeaders :: Lens' Cors (Maybe [Text]) Source #

The HTTP headers in your function response that you want to expose to origins that call your function URL. For example: Date, Keep-Alive, X-Custom-Header.

cors_maxAge :: Lens' Cors (Maybe Natural) Source #

The maximum amount of time, in seconds, that web browsers can cache results of a preflight request. By default, this is set to 0, which means that the browser doesn't cache results.