ApiKeyProps Struct
ApiKey Properties.
Example
ts
// Auto-generated name and value
const autoKey = new apigwv2.ApiKey(this, 'AutoKey');
// Explicit name and value
const explicitKey = new apigwv2.ApiKey(this, 'ExplicitKey', {
apiKeyName: 'MyWebSocketApiKey',
value: 'MyApiKeyThatIsAtLeast20Characters',
});
Properties
apiKeyNameoptionalstringapi_key_nameoptionalstrapiKeyNameoptionalStringApiKeyNameoptionalstringApiKeyNameoptional*string#A name for the API key.
Default: automatically generated name
If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the API key name.
customerIdoptionalstringcustomer_idoptionalstrcustomerIdoptionalStringCustomerIdoptionalstringCustomerIdoptional*string= none#An AWS Marketplace customer identifier to use when integrating with the AWS SaaS Marketplace.
descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string= none#A description of the purpose of the API key.
enabledoptionalbooleanenabledoptionalboolenabledoptionalBooleanEnabledoptionalboolEnabledoptional*bool= true#Indicates whether the API key can be used by clients.
generateDistinctIdoptionalbooleangenerate_distinct_idoptionalboolgenerateDistinctIdoptionalBooleanGenerateDistinctIdoptionalboolGenerateDistinctIdoptional*bool= false#Specifies whether the key identifier is distinct from the created API key value.
valueoptionalstringvalueoptionalstrvalueoptionalStringValueoptionalstringValueoptional*string= none#The value of the API key.
Must be at least 20 characters long.