Interface ApiKeyProps

All Superinterfaces:
ApiKeyOptions, software.amazon.jsii.JsiiSerializable, ResourceOptions
All Known Subinterfaces:
RateLimitedApiKeyProps
All Known Implementing Classes:
ApiKeyProps.Jsii$Proxy, RateLimitedApiKeyProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.97.0 (build 729de35)", date="2024-04-18T17:54:11.753Z") @Stability(Stable) public interface ApiKeyProps extends software.amazon.jsii.JsiiSerializable, ApiKeyOptions
ApiKey Properties.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.*;
 import software.amazon.awscdk.services.apigateway.*;
 Authorizer authorizer;
 Integration integration;
 Model model;
 RequestValidator requestValidator;
 RestApi restApi;
 Stage stage;
 ApiKeyProps apiKeyProps = ApiKeyProps.builder()
         .apiKeyName("apiKeyName")
         .customerId("customerId")
         .defaultCorsPreflightOptions(CorsOptions.builder()
                 .allowOrigins(List.of("allowOrigins"))
                 // the properties below are optional
                 .allowCredentials(false)
                 .allowHeaders(List.of("allowHeaders"))
                 .allowMethods(List.of("allowMethods"))
                 .disableCache(false)
                 .exposeHeaders(List.of("exposeHeaders"))
                 .maxAge(Duration.minutes(30))
                 .statusCode(123)
                 .build())
         .defaultIntegration(integration)
         .defaultMethodOptions(MethodOptions.builder()
                 .apiKeyRequired(false)
                 .authorizationScopes(List.of("authorizationScopes"))
                 .authorizationType(AuthorizationType.NONE)
                 .authorizer(authorizer)
                 .methodResponses(List.of(MethodResponse.builder()
                         .statusCode("statusCode")
                         // the properties below are optional
                         .responseModels(Map.of(
                                 "responseModelsKey", model))
                         .responseParameters(Map.of(
                                 "responseParametersKey", false))
                         .build()))
                 .operationName("operationName")
                 .requestModels(Map.of(
                         "requestModelsKey", model))
                 .requestParameters(Map.of(
                         "requestParametersKey", false))
                 .requestValidator(requestValidator)
                 .requestValidatorOptions(RequestValidatorOptions.builder()
                         .requestValidatorName("requestValidatorName")
                         .validateRequestBody(false)
                         .validateRequestParameters(false)
                         .build())
                 .build())
         .description("description")
         .enabled(false)
         .generateDistinctId(false)
         .resources(List.of(restApi))
         .stages(List.of(stage))
         .value("value")
         .build();
 
  • Method Details

    • getCustomerId

      @Stability(Stable) @Nullable default String getCustomerId()
      An AWS Marketplace customer identifier to use when integrating with the AWS SaaS Marketplace.

      Default: none

    • getEnabled

      @Stability(Stable) @Nullable default Boolean getEnabled()
      Indicates whether the API key can be used by clients.

      Default: true

    • getGenerateDistinctId

      @Stability(Stable) @Nullable default Boolean getGenerateDistinctId()
      Specifies whether the key identifier is distinct from the created API key value.

      Default: false

    • getResources

      @Stability(Deprecated) @Deprecated @Nullable default List<IRestApi> getResources()
      Deprecated.
      • use stages instead
      (deprecated) A list of resources this api key is associated with.

      Default: none

    • getStages

      @Stability(Stable) @Nullable default List<IStage> getStages()
      A list of Stages this api key is associated with.

      Default: - the api key is not associated with any stages

    • builder

      @Stability(Stable) static ApiKeyProps.Builder builder()
      Returns:
      a ApiKeyProps.Builder of ApiKeyProps