AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::Location::APIKey

CfnAPIKey

The API key resource in your AWS account, which lets you grant actions for Amazon Location resources to the API key bearer.

Import

import { CfnAPIKey } from 'aws-cdk-lib/aws-location';

Or use the module namespace:

import * as location from 'aws-cdk-lib/aws-location';
// location.CfnAPIKey

Properties

Configuration passed to the constructor as CfnAPIKeyProps.

keyNameRequired
string

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` .

restrictionsRequired
IResolvable | ApiKeyRestrictionsProperty

The API key restrictions for the API key resource.

descriptionOptional
string

Updates the description for the API key resource.

expireTimeOptional
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) .

forceDeleteOptional
boolean | IResolvable

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.

forceUpdateOptional
boolean | IResolvable

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.

noExpiryOptional
boolean | IResolvable

Whether the API key should expire. Set to `true` to set the API key to have no expiration time.

tagsOptional
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.

CloudFormation Resource

This L1 construct maps directly to the following CloudFormation resource type.

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter

Quick Facts

LevelL1 (CloudFormation)
Moduleaws-location
CFN TypeAWS::Location::APIKey
Properties8

External Links