amazonka-appsync-2.0: Amazon AppSync 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.AppSync.Types.ApiKey

Description

 
Synopsis

Documentation

data ApiKey Source #

Describes an API key.

Customers invoke AppSync GraphQL API operations with API keys as an identity mechanism. There are two key versions:

da1: We introduced this version at launch in November 2017. These keys always expire after 7 days. Amazon DynamoDB TTL manages key expiration. These keys ceased to be valid after February 21, 2018, and they should no longer be used.

  • ListApiKeys returns the expiration time in milliseconds.
  • CreateApiKey returns the expiration time in milliseconds.
  • UpdateApiKey is not available for this key version.
  • DeleteApiKey deletes the item from the table.
  • Expiration is stored in DynamoDB as milliseconds. This results in a bug where keys are not automatically deleted because DynamoDB expects the TTL to be stored in seconds. As a one-time action, we deleted these keys from the table on February 21, 2018.

da2: We introduced this version in February 2018 when AppSync added support to extend key expiration.

  • ListApiKeys returns the expiration time and deletion time in seconds.
  • CreateApiKey returns the expiration time and deletion time in seconds and accepts a user-provided expiration time in seconds.
  • UpdateApiKey returns the expiration time and and deletion time in seconds and accepts a user-provided expiration time in seconds. Expired API keys are kept for 60 days after the expiration time. You can update the key expiration time as long as the key isn't deleted.
  • DeleteApiKey deletes the item from the table.
  • Expiration is stored in DynamoDB as seconds. After the expiration time, using the key to authenticate will fail. However, you can reinstate the key before deletion.
  • Deletion is stored in DynamoDB as seconds. The key is deleted after deletion time.

See: newApiKey smart constructor.

Constructors

ApiKey' 

Fields

  • deletes :: Maybe Integer

    The time after which the API key is deleted. The date is represented as seconds since the epoch, rounded down to the nearest hour.

  • description :: Maybe Text

    A description of the purpose of the API key.

  • expires :: Maybe Integer

    The time after which the API key expires. The date is represented as seconds since the epoch, rounded down to the nearest hour.

  • id :: Maybe Text

    The API key ID.

Instances

Instances details
FromJSON ApiKey Source # 
Instance details

Defined in Amazonka.AppSync.Types.ApiKey

Generic ApiKey Source # 
Instance details

Defined in Amazonka.AppSync.Types.ApiKey

Associated Types

type Rep ApiKey :: Type -> Type #

Methods

from :: ApiKey -> Rep ApiKey x #

to :: Rep ApiKey x -> ApiKey #

Read ApiKey Source # 
Instance details

Defined in Amazonka.AppSync.Types.ApiKey

Show ApiKey Source # 
Instance details

Defined in Amazonka.AppSync.Types.ApiKey

NFData ApiKey Source # 
Instance details

Defined in Amazonka.AppSync.Types.ApiKey

Methods

rnf :: ApiKey -> () #

Eq ApiKey Source # 
Instance details

Defined in Amazonka.AppSync.Types.ApiKey

Methods

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

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

Hashable ApiKey Source # 
Instance details

Defined in Amazonka.AppSync.Types.ApiKey

Methods

hashWithSalt :: Int -> ApiKey -> Int #

hash :: ApiKey -> Int #

type Rep ApiKey Source # 
Instance details

Defined in Amazonka.AppSync.Types.ApiKey

type Rep ApiKey = D1 ('MetaData "ApiKey" "Amazonka.AppSync.Types.ApiKey" "amazonka-appsync-2.0-4Pb6UqteLv1I9NIWaj90bg" 'False) (C1 ('MetaCons "ApiKey'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "deletes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Integer)) :*: S1 ('MetaSel ('Just "description") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "expires") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Integer)) :*: S1 ('MetaSel ('Just "id") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)))))

newApiKey :: ApiKey Source #

Create a value of ApiKey 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:deletes:ApiKey', apiKey_deletes - The time after which the API key is deleted. The date is represented as seconds since the epoch, rounded down to the nearest hour.

$sel:description:ApiKey', apiKey_description - A description of the purpose of the API key.

$sel:expires:ApiKey', apiKey_expires - The time after which the API key expires. The date is represented as seconds since the epoch, rounded down to the nearest hour.

$sel:id:ApiKey', apiKey_id - The API key ID.

apiKey_deletes :: Lens' ApiKey (Maybe Integer) Source #

The time after which the API key is deleted. The date is represented as seconds since the epoch, rounded down to the nearest hour.

apiKey_description :: Lens' ApiKey (Maybe Text) Source #

A description of the purpose of the API key.

apiKey_expires :: Lens' ApiKey (Maybe Integer) Source #

The time after which the API key expires. The date is represented as seconds since the epoch, rounded down to the nearest hour.

apiKey_id :: Lens' ApiKey (Maybe Text) Source #

The API key ID.