java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, ITaggable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-21T06:34:02.495Z") @Stability(Stable) public class CfnApiKey extends CfnResource implements IInspectable, ITaggable
The AWS::ApiGateway::ApiKey resource creates a unique key that you can distribute to clients who are executing API Gateway Method resources that require an API key.

To specify which API key clients must use, map the API key with the RestApi and Stage resources that include the methods that require a key.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.apigateway.*;
 CfnApiKey cfnApiKey = CfnApiKey.Builder.create(this, "MyCfnApiKey")
         .customerId("customerId")
         .description("description")
         .enabled(false)
         .generateDistinctId(false)
         .name("name")
         .stageKeys(List.of(StageKeyProperty.builder()
                 .restApiId("restApiId")
                 .stageName("stageName")
                 .build()))
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .value("value")
         .build();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnApiKey

      protected CfnApiKey(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnApiKey

      protected CfnApiKey(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnApiKey

      @Stability(Stable) public CfnApiKey(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable CfnApiKeyProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties.
    • CfnApiKey

      @Stability(Stable) public CfnApiKey(@NotNull software.constructs.Construct scope, @NotNull String id)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrApiKeyId

      @Stability(Stable) @NotNull public String getAttrApiKeyId()
      The ID for the API key.

      For example: abc123 .

    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getTags in interface ITaggable
    • getCustomerId

      @Stability(Stable) @Nullable public String getCustomerId()
      An AWS Marketplace customer identifier, when integrating with the AWS SaaS Marketplace.
    • setCustomerId

      @Stability(Stable) public void setCustomerId(@Nullable String value)
      An AWS Marketplace customer identifier, when integrating with the AWS SaaS Marketplace.
    • getDescription

      @Stability(Stable) @Nullable public String getDescription()
      The description of the ApiKey.
    • setDescription

      @Stability(Stable) public void setDescription(@Nullable String value)
      The description of the ApiKey.
    • getEnabled

      @Stability(Stable) @Nullable public Object getEnabled()
      Specifies whether the ApiKey can be used by callers.
    • setEnabled

      @Stability(Stable) public void setEnabled(@Nullable Boolean value)
      Specifies whether the ApiKey can be used by callers.
    • setEnabled

      @Stability(Stable) public void setEnabled(@Nullable IResolvable value)
      Specifies whether the ApiKey can be used by callers.
    • getGenerateDistinctId

      @Stability(Stable) @Nullable public Object getGenerateDistinctId()
      Specifies whether ( true ) or not ( false ) the key identifier is distinct from the created API key value.
    • setGenerateDistinctId

      @Stability(Stable) public void setGenerateDistinctId(@Nullable Boolean value)
      Specifies whether ( true ) or not ( false ) the key identifier is distinct from the created API key value.
    • setGenerateDistinctId

      @Stability(Stable) public void setGenerateDistinctId(@Nullable IResolvable value)
      Specifies whether ( true ) or not ( false ) the key identifier is distinct from the created API key value.
    • getName

      @Stability(Stable) @Nullable public String getName()
      A name for the API key.
    • setName

      @Stability(Stable) public void setName(@Nullable String value)
      A name for the API key.
    • getStageKeys

      @Stability(Stable) @Nullable public Object getStageKeys()
      DEPRECATED FOR USAGE PLANS - Specifies stages associated with the API key.
    • setStageKeys

      @Stability(Stable) public void setStageKeys(@Nullable IResolvable value)
      DEPRECATED FOR USAGE PLANS - Specifies stages associated with the API key.
    • setStageKeys

      @Stability(Stable) public void setStageKeys(@Nullable List<Object> value)
      DEPRECATED FOR USAGE PLANS - Specifies stages associated with the API key.
    • getTagsRaw

      @Stability(Stable) @Nullable public List<CfnTag> getTagsRaw()
      The key-value map of strings.
    • setTagsRaw

      @Stability(Stable) public void setTagsRaw(@Nullable List<CfnTag> value)
      The key-value map of strings.
    • getValue

      @Stability(Stable) @Nullable public String getValue()
      Specifies a value of the API key.
    • setValue

      @Stability(Stable) public void setValue(@Nullable String value)
      Specifies a value of the API key.