@Generated(value="jsii-pacmak/1.63.2 (build a8a8833)", date="2022-08-09T19:16:41.842Z") public class ApiKey extends Resource implements IApiKey
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>");
Modifier and Type | Class and Description |
---|---|
static class |
ApiKey.Builder
A fluent builder for
ApiKey . |
IApiKey.Jsii$Default, IApiKey.Jsii$Proxy
Modifier | Constructor and Description |
---|---|
protected |
ApiKey(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
ApiKey(software.amazon.jsii.JsiiObjectRef objRef) |
|
ApiKey(software.constructs.Construct scope,
java.lang.String id) |
|
ApiKey(software.constructs.Construct scope,
java.lang.String id,
ApiKeyProps props) |
Modifier and Type | Method and Description |
---|---|
static IApiKey |
fromApiKeyId(software.constructs.Construct scope,
java.lang.String id,
java.lang.String apiKeyId)
Import an ApiKey by its Id.
|
java.lang.String |
getKeyArn()
The API key ARN.
|
java.lang.String |
getKeyId()
The API key ID.
|
Grant |
grantRead(IGrantable grantee)
Permits the IAM principal all read operations through this key.
|
Grant |
grantReadWrite(IGrantable grantee)
Permits the IAM principal all read and write operations through this key.
|
Grant |
grantWrite(IGrantable grantee)
Permits the IAM principal all write operations through this key.
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applyRemovalPolicy, getEnv, getStack
getNode
protected ApiKey(software.amazon.jsii.JsiiObjectRef objRef)
protected ApiKey(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public ApiKey(software.constructs.Construct scope, java.lang.String id, ApiKeyProps props)
scope
- This parameter is required.id
- This parameter is required.props
- public ApiKey(software.constructs.Construct scope, java.lang.String id)
scope
- This parameter is required.id
- This parameter is required.public static IApiKey fromApiKeyId(software.constructs.Construct scope, java.lang.String id, java.lang.String apiKeyId)
scope
- This parameter is required.id
- This parameter is required.apiKeyId
- This parameter is required.public Grant grantRead(IGrantable grantee)
grantee
- The principal to grant access to. This parameter is required.public Grant grantReadWrite(IGrantable grantee)
grantee
- The principal to grant access to. This parameter is required.public Grant grantWrite(IGrantable grantee)
grantee
- The principal to grant access to. This parameter is required.public java.lang.String getKeyArn()