Class ApiKey
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.Resource
software.amazon.awscdk.services.apigateway.ApiKey
- All Implemented Interfaces:
- IConstruct,- IDependable,- IResource,- IApiKey,- software.amazon.jsii.JsiiSerializable,- software.constructs.IConstruct
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
           date="2023-06-19T16:30:44.695Z")
@Stability(Stable)
public class ApiKey
extends Resource
implements IApiKey
An API Gateway ApiKey.
 
An ApiKey can be distributed to API clients that are executing requests for Method resources that require an Api Key.
Example:
IApiKey importedKey = ApiKey.fromApiKeyId(this, "imported-key", "<api-key-id>");
- 
Nested Class SummaryNested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObjectsoftware.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.services.apigateway.IApiKeyIApiKey.Jsii$Default, IApiKey.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstructIConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstructsoftware.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.core.IResourceIResource.Jsii$Default
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedApiKey(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedApiKey(software.amazon.jsii.JsiiObjectRef objRef) ApiKey(software.constructs.Construct scope, String id, ApiKeyProps props) 
- 
Method SummaryModifier and TypeMethodDescriptionstatic IApiKeyfromApiKeyId(software.constructs.Construct scope, String id, String apiKeyId) Import an ApiKey by its Id.The API key ARN.getKeyId()The API key ID.grantRead(IGrantable grantee) Permits the IAM principal all read operations through this key.grantReadWrite(IGrantable grantee) Permits the IAM principal all read and write operations through this key.grantWrite(IGrantable grantee) Permits the IAM principal all write operations through this key.Methods inherited from class software.amazon.awscdk.core.ResourceapplyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResourceMethods inherited from class software.amazon.awscdk.core.ConstructgetNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods inherited from class software.constructs.ConstructtoStringMethods inherited from class software.amazon.jsii.JsiiObjectjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.awscdk.core.IConstructgetNodeMethods inherited from interface software.amazon.awscdk.core.IResourceapplyRemovalPolicy, getEnv, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable$jsii$toJson
- 
Constructor Details- 
ApiKeyprotected ApiKey(software.amazon.jsii.JsiiObjectRef objRef) 
- 
ApiKeyprotected ApiKey(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) 
- 
ApiKey@Stability(Stable) public ApiKey(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable ApiKeyProps props) - Parameters:
- scope- This parameter is required.
- id- This parameter is required.
- props-
 
- 
ApiKey- Parameters:
- scope- This parameter is required.
- id- This parameter is required.
 
 
- 
- 
Method Details- 
fromApiKeyId@Stability(Stable) @NotNull public static IApiKey fromApiKeyId(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String apiKeyId) Import an ApiKey by its Id.- Parameters:
- scope- This parameter is required.
- id- This parameter is required.
- apiKeyId- This parameter is required.
 
- 
grantReadPermits the IAM principal all read operations through this key.- Parameters:
- grantee- The principal to grant access to. This parameter is required.
 
- 
grantReadWritePermits the IAM principal all read and write operations through this key.- Parameters:
- grantee- The principal to grant access to. This parameter is required.
 
- 
grantWritePermits the IAM principal all write operations through this key.- Parameters:
- grantee- The principal to grant access to. This parameter is required.
 
- 
getKeyArnThe API key ARN.
- 
getKeyIdThe API key ID.
 
-