Class ApiKeyOptions
- Namespace
- Amazon.CDK.AWS.APIGateway
- Assembly
- Amazon.CDK.AWS.APIGateway.dll
The options for creating an API Key.
public class ApiKeyOptions : IApiKeyOptions, IResourceOptions
- Inheritance
-
ApiKeyOptions
- Implements
- Inherited Members
Examples
RestApi api;
var key = api.AddApiKey("ApiKey", new ApiKeyOptions {
ApiKeyName = "myApiKey1",
Value = "MyApiKeyThatIsAtLeast20Characters"
});
Remarks
ExampleMetadata: infused
Constructors
ApiKeyOptions()
public ApiKeyOptions()
Properties
ApiKeyName
A name for the API key.
public string? ApiKeyName { get; set; }
Property Value
Remarks
If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the API key name.
Default: automically generated name
DefaultCorsPreflightOptions
Adds a CORS preflight OPTIONS method to this resource and all child resources.
public ICorsOptions? DefaultCorsPreflightOptions { get; set; }
Property Value
Remarks
You can add CORS at the resource-level using addCorsPreflight
.
Default: - CORS is disabled
DefaultIntegration
An integration to use as a default for all methods created within this API unless an integration is specified.
public Integration? DefaultIntegration { get; set; }
Property Value
Remarks
Default: - Inherited from parent.
DefaultMethodOptions
Method options to use as a default for all methods created within this API unless custom options are specified.
public IMethodOptions? DefaultMethodOptions { get; set; }
Property Value
Remarks
Default: - Inherited from parent.
Description
A description of the purpose of the API key.
public string? Description { get; set; }
Property Value
Remarks
Default: none
Value
The value of the API key.
public string? Value { get; set; }
Property Value
Remarks
Must be at least 20 characters long.
Default: none