@Generated(value="jsii-pacmak/1.57.0 (build f614666)", date="2022-04-22T09:30:44.730Z") @Stability(value=Stable) 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.
|
software.amazon.jsii.JsiiObject.InitializationMode
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
Modifier and Type | Field and Description |
---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
Modifier | Constructor and Description |
---|---|
|
CfnApiKey(software.constructs.Construct scope,
String id)
Create a new `AWS::ApiGateway::ApiKey`.
|
|
CfnApiKey(software.constructs.Construct scope,
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 |
---|---|
String |
getAttrApiKeyId()
The ID for the API key.
|
protected Map<String,Object> |
getCfnProperties() |
String |
getCustomerId()
An AWS Marketplace customer identifier to use when integrating with the AWS SaaS Marketplace.
|
String |
getDescription()
A description of the purpose of the API key.
|
Object |
getEnabled()
Indicates whether the API key can be used by clients.
|
Object |
getGenerateDistinctId()
Specifies whether the key identifier is distinct from the created API key value.
|
String |
getName()
A name for the API key.
|
Object |
getStageKeys()
A list of stages to associate with this API key.
|
TagManager |
getTags()
An array of arbitrary tags (key-value pairs) to associate with the API key.
|
String |
getValue()
The value of the API key.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setCustomerId(String value)
An AWS Marketplace customer identifier to use when integrating with the AWS SaaS Marketplace.
|
void |
setDescription(String value)
A description of the purpose of the API key.
|
void |
setEnabled(Boolean value)
Indicates whether the API key can be used by clients.
|
void |
setEnabled(IResolvable value)
Indicates whether the API key can be used by clients.
|
void |
setGenerateDistinctId(Boolean value)
Specifies whether the key identifier is distinct from the created API key value.
|
void |
setGenerateDistinctId(IResolvable value)
Specifies whether the key identifier is distinct from the created API key value.
|
void |
setName(String value)
A name for the API key.
|
void |
setStageKeys(IResolvable value)
A list of stages to associate with this API key.
|
void |
setStageKeys(List<Object> value)
A list of stages to associate with this API key.
|
void |
setValue(String value)
The 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
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnApiKey(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnApiKey(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable) public CfnApiKey(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable 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.@Stability(value=Stable) public CfnApiKey(@NotNull software.constructs.Construct scope, @NotNull String id)
scope
- - scope in which this resource is defined. This parameter is required.id
- - scoped id of the resource. This parameter is required.@Stability(value=Stable) public void inspect(@NotNull TreeInspector inspector)
inspect
in interface IInspectable
inspector
- - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties
in class CfnResource
props
- This parameter is required.@Stability(value=Stable) @NotNull public String getAttrApiKeyId()
For example: abc123
.
@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties
in class CfnResource
@Stability(value=Stable) @NotNull public TagManager getTags()
@Stability(value=Stable) @Nullable public String getCustomerId()
@Stability(value=Stable) public void setCustomerId(@Nullable String value)
@Stability(value=Stable) @Nullable public String getDescription()
@Stability(value=Stable) public void setDescription(@Nullable String value)
@Stability(value=Stable) @Nullable public Object getEnabled()
@Stability(value=Stable) public void setEnabled(@Nullable Boolean value)
@Stability(value=Stable) public void setEnabled(@Nullable IResolvable value)
@Stability(value=Stable) @Nullable public Object getGenerateDistinctId()
This parameter is deprecated and should not be used.
@Stability(value=Stable) public void setGenerateDistinctId(@Nullable Boolean value)
This parameter is deprecated and should not be used.
@Stability(value=Stable) public void setGenerateDistinctId(@Nullable IResolvable value)
This parameter is deprecated and should not be used.
@Stability(value=Stable) @Nullable public 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.
@Stability(value=Stable) public void setName(@Nullable 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.
@Stability(value=Stable) @Nullable public Object getStageKeys()
@Stability(value=Stable) public void setStageKeys(@Nullable IResolvable value)
@Stability(value=Stable) public void setStageKeys(@Nullable List<Object> value)
@Stability(value=Stable) @Nullable public String getValue()
Must be at least 20 characters long.
@Stability(value=Stable) public void setValue(@Nullable String value)
Must be at least 20 characters long.
Copyright © 2022. All rights reserved.