Skip to content
v2.274.0

CfnAPIKeyProps Struct ​

Properties for defining a CfnAPIKey.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_location as location } from 'aws-cdk-lib';
const cfnAPIKeyProps: location.CfnAPIKeyProps = {
  keyName: 'keyName',
  restrictions: {
    allowActions: ['allowActions'],
    allowResources: ['allowResources'],

    // the properties below are optional
    allowAndroidApps: [{
      certificateFingerprint: 'certificateFingerprint',
      package: 'package',
    }],
    allowAppleApps: [{
      bundleId: 'bundleId',
    }],
    allowReferers: ['allowReferers'],
  },

  // the properties below are optional
  description: 'description',
  expireTime: 'expireTime',
  forceDelete: false,
  forceUpdate: false,
  noExpiry: false,
  tags: [{
    key: 'key',
    value: 'value',
  }],
};

Properties ​

descriptionstringdescriptionstrdescriptionStringDescriptionstringDescription*string#
Updates the description for the API key resource.
expireTimestringexpire_timestrexpireTimeStringExpireTimestringExpireTime*string#
The optional timestamp for when the API key resource will expire in [ISO 8601 format](https://docs.aws.amazon.com/https://www.iso.org/iso-8601-date-and-time-format.html) .
forceDeleteboolean | IResolvableforce_deletetyping.Union[bool, IResolvable]forceDeleteBooleanForceDeleteboolForceDeleteinterface{}#
ForceDelete bypasses an API key's expiry conditions and deletes the key.

Set the parameter true to delete the key or to false to not preemptively delete the API key.

Valid values: true , or false .

This action is irreversible. Only use ForceDelete if you are certain the key is no longer in use.

forceUpdateboolean | IResolvableforce_updatetyping.Union[bool, IResolvable]forceUpdateBooleanForceUpdateboolForceUpdateinterface{}#
The boolean flag to be included for updating `ExpireTime` or Restrictions details.

Must be set to true to update an API key resource that has been used in the past 7 days. False if force update is not preferred.

keyNamestringkey_namestrkeyNameStringKeyNamestringKeyName*stringrequired#
A custom name for the API key resource.

Requirements:

  • Contain only alphanumeric characters (A–Z, a–z, 0–9), hyphens (-), periods (.), and underscores (_).
  • Must be a unique API key name.
  • No spaces allowed. For example, ExampleAPIKey .
noExpiryboolean | IResolvableno_expirytyping.Union[bool, IResolvable]noExpiryBooleanNoExpiryboolNoExpiryinterface{}#
Whether the API key should expire.

Set to true to set the API key to have no expiration time.

restrictionsIResolvable | CfnAPIKey.ApiKeyRestrictionsPropertyrestrictionstyping.Union[IResolvable, ApiKeyRestrictionsProperty]restrictionsIResolvableRestrictionsIResolvableRestrictionsinterface{}required#
The API key restrictions for the API key resource.
tagsCfnTag[]tagstyping.List[CfnTag]tagsList<CfnTag>TagsCfnTag[]Tags*[]CfnTag#
Applies one or more tags to the map resource.

A tag is a key-value pair that helps manage, identify, search, and filter your resources by labelling them.