Skip to content
v2.278.0

ApiKeyOptions Struct ​

The options for creating an API Key.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_apigatewayv2 as apigatewayv2 } from 'aws-cdk-lib';
const apiKeyOptions: apigatewayv2.ApiKeyOptions = {
  apiKeyName: 'apiKeyName',
  description: 'description',
  value: 'value',
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_apigatewayv2 as apigatewayv2

api_key_options = apigatewayv2.ApiKeyOptions(
    api_key_name="apiKeyName",
    description="description",
    value="value"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.apigatewayv2.*;

ApiKeyOptions apiKeyOptions = ApiKeyOptions.builder()
        .apiKeyName("apiKeyName")
        .description("description")
        .value("value")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Apigatewayv2;

var apiKeyOptions = new ApiKeyOptions {
    ApiKeyName = "apiKeyName",
    Description = "description",
    Value = "value"
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

apiKeyOptions := &ApiKeyOptions{
	ApiKeyName: jsii.String("apiKeyName"),
	Description: jsii.String("description"),
	Value: jsii.String("value"),
}

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.

descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string = none #
A description of the purpose of the API key.
valueoptionalstringvalueoptionalstrvalueoptionalStringValueoptionalstringValueoptional*string = none #
The value of the API key.

Must be at least 20 characters long.