@Generated(value="jsii-pacmak/1.73.0 (build 6faeda3)", date="2023-01-31T18:36:57.990Z") public class CfnApiKey extends CfnResource implements IInspectable
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();
Modifier and Type | Class and Description |
---|---|
static class |
CfnApiKey.Builder
A fluent builder for
CfnApiKey . |
static interface |
CfnApiKey.StageKeyProperty
`StageKey` is a property of the [AWS::ApiGateway::ApiKey](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-apikey.html) resource that specifies the stage to associate with the API key.
|
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
IConstruct.Jsii$Default
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
Modifier | Constructor and Description |
---|---|
|
CfnApiKey(Construct scope,
java.lang.String id)
Create a new `AWS::ApiGateway::ApiKey`.
|
|
CfnApiKey(Construct scope,
java.lang.String id,
CfnApiKeyProps props)
Create a new `AWS::ApiGateway::ApiKey`.
|
protected |
CfnApiKey(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnApiKey(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAttrApiKeyId()
The ID for the API key.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getCfnProperties() |
java.lang.String |
getCustomerId()
An AWS Marketplace customer identifier, when integrating with the AWS SaaS Marketplace.
|
java.lang.String |
getDescription()
The description of the ApiKey.
|
java.lang.Object |
getEnabled()
Specifies whether the ApiKey can be used by callers.
|
java.lang.Object |
getGenerateDistinctId()
Specifies whether ( `true` ) or not ( `false` ) the key identifier is distinct from the created API key value.
|
java.lang.String |
getName()
A name for the API key.
|
java.lang.Object |
getStageKeys()
DEPRECATED FOR USAGE PLANS - Specifies stages associated with the API key.
|
TagManager |
getTags()
The key-value map of strings.
|
java.lang.String |
getValue()
Specifies a value of the API key.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
renderProperties(java.util.Map<java.lang.String,java.lang.Object> props) |
void |
setCustomerId(java.lang.String value)
An AWS Marketplace customer identifier, when integrating with the AWS SaaS Marketplace.
|
void |
setDescription(java.lang.String value)
The description of the ApiKey.
|
void |
setEnabled(java.lang.Boolean value)
Specifies whether the ApiKey can be used by callers.
|
void |
setEnabled(IResolvable value)
Specifies whether the ApiKey can be used by callers.
|
void |
setGenerateDistinctId(java.lang.Boolean value)
Specifies whether ( `true` ) or not ( `false` ) the key identifier is distinct from the created API key value.
|
void |
setGenerateDistinctId(IResolvable value)
Specifies whether ( `true` ) or not ( `false` ) the key identifier is distinct from the created API key value.
|
void |
setName(java.lang.String value)
A name for the API key.
|
void |
setStageKeys(IResolvable value)
DEPRECATED FOR USAGE PLANS - Specifies stages associated with the API key.
|
void |
setStageKeys(java.util.List<java.lang.Object> value)
DEPRECATED FOR USAGE PLANS - Specifies stages associated with the API key.
|
void |
setValue(java.lang.String value)
Specifies a value of the API key.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
getRef
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
public static final java.lang.String CFN_RESOURCE_TYPE_NAME
protected CfnApiKey(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnApiKey(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnApiKey(Construct scope, java.lang.String id, CfnApiKeyProps props)
scope
- - scope in which this resource is defined. This parameter is required.id
- - scoped id of the resource. This parameter is required.props
- - resource properties.public CfnApiKey(Construct scope, java.lang.String id)
scope
- - scope in which this resource is defined. This parameter is required.id
- - scoped id of the resource. This parameter is required.public void inspect(TreeInspector inspector)
inspect
in interface IInspectable
inspector
- - tree inspector to collect and process attributes. This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> renderProperties(java.util.Map<java.lang.String,java.lang.Object> props)
renderProperties
in class CfnResource
props
- This parameter is required.public java.lang.String getAttrApiKeyId()
For example: abc123
.
protected java.util.Map<java.lang.String,java.lang.Object> getCfnProperties()
getCfnProperties
in class CfnResource
public TagManager getTags()
The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with aws:
. The tag value can be up to 256 characters.
public java.lang.String getCustomerId()
public void setCustomerId(java.lang.String value)
public java.lang.String getDescription()
public void setDescription(java.lang.String value)
public java.lang.Object getEnabled()
public void setEnabled(java.lang.Boolean value)
public void setEnabled(IResolvable value)
public java.lang.Object getGenerateDistinctId()
This parameter is deprecated and should not be used.
public void setGenerateDistinctId(java.lang.Boolean value)
This parameter is deprecated and should not be used.
public void setGenerateDistinctId(IResolvable value)
This parameter is deprecated and should not be used.
public java.lang.String getName()
If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the API key name. For more information, see Name Type .
If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.
public void setName(java.lang.String value)
If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the API key name. For more information, see Name Type .
If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.
public java.lang.Object getStageKeys()
public void setStageKeys(IResolvable value)
public void setStageKeys(java.util.List<java.lang.Object> value)
public java.lang.String getValue()
public void setValue(java.lang.String value)