Class ApiKey
An API Gateway ApiKey.
Inherited Members
Namespace: Amazon.CDK.AWS.APIGateway
Assembly: Amazon.CDK.AWS.APIGateway.dll
Syntax (csharp)
public class ApiKey : Resource, IApiKey, IResource, IConstruct, IDependable
Syntax (vb)
Public Class ApiKey
Inherits Resource
Implements IApiKey, IResource, IConstruct, IDependable
Remarks
An ApiKey can be distributed to API clients that are executing requests for Method resources that require an Api Key.
ExampleMetadata: infused
Examples
var importedKey = ApiKey.FromApiKeyId(this, "imported-key", "<api-key-id>");
Synopsis
Constructors
ApiKey(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
ApiKey(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
ApiKey(Construct, String, IApiKeyProps) |
Properties
KeyArn | The API key ARN. |
KeyId | The API key ID. |
Methods
FromApiKeyId(Construct, String, String) | Import an ApiKey by its Id. |
GrantRead(IGrantable) | Permits the IAM principal all read operations through this key. |
GrantReadWrite(IGrantable) | Permits the IAM principal all read and write operations through this key. |
GrantWrite(IGrantable) | Permits the IAM principal all write operations through this key. |
Constructors
ApiKey(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected ApiKey(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
ApiKey(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected ApiKey(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
ApiKey(Construct, String, IApiKeyProps)
public ApiKey(Construct scope, string id, IApiKeyProps props = null)
Parameters
- scope Constructs.Construct
- id System.String
- props IApiKeyProps
Properties
KeyArn
The API key ARN.
public virtual string KeyArn { get; }
Property Value
System.String
KeyId
The API key ID.
public virtual string KeyId { get; }
Property Value
System.String
Methods
FromApiKeyId(Construct, String, String)
Import an ApiKey by its Id.
public static IApiKey FromApiKeyId(Construct scope, string id, string apiKeyId)
Parameters
- scope Constructs.Construct
- id System.String
- apiKeyId System.String
Returns
GrantRead(IGrantable)
Permits the IAM principal all read operations through this key.
public virtual Grant GrantRead(IGrantable grantee)
Parameters
- grantee IGrantable
The principal to grant access to.
Returns
GrantReadWrite(IGrantable)
Permits the IAM principal all read and write operations through this key.
public virtual Grant GrantReadWrite(IGrantable grantee)
Parameters
- grantee IGrantable
The principal to grant access to.
Returns
GrantWrite(IGrantable)
Permits the IAM principal all write operations through this key.
public virtual Grant GrantWrite(IGrantable grantee)
Parameters
- grantee IGrantable
The principal to grant access to.
Returns