Class CfnAPIKey

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, ITaggableV2, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)", date="2024-10-05T03:43:45.853Z") @Stability(Stable) public class CfnAPIKey extends CfnResource implements IInspectable, ITaggableV2
The API key resource in your AWS account, which lets you grant actions for Amazon Location resources to the API key bearer.

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.location.*;
 CfnAPIKey cfnAPIKey = CfnAPIKey.Builder.create(this, "MyCfnAPIKey")
         .keyName("keyName")
         .restrictions(ApiKeyRestrictionsProperty.builder()
                 .allowActions(List.of("allowActions"))
                 .allowResources(List.of("allowResources"))
                 // the properties below are optional
                 .allowReferers(List.of("allowReferers"))
                 .build())
         // the properties below are optional
         .description("description")
         .expireTime("expireTime")
         .forceDelete(false)
         .forceUpdate(false)
         .noExpiry(false)
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .build();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnAPIKey

      protected CfnAPIKey(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnAPIKey

      protected CfnAPIKey(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnAPIKey

      @Stability(Stable) public CfnAPIKey(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnAPIKeyProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties. This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrArn

      @Stability(Stable) @NotNull public String getAttrArn()
      The Amazon Resource Name (ARN) for the resource.

      Used when you need to specify a resource across all AWS .

    • getAttrCreateTime

      @Stability(Stable) @NotNull public String getAttrCreateTime()
      The timestamp for when the API key resource was created in ISO 8601 format: YYYY-MM-DDThh:mm:ss.sssZ.
    • getAttrKeyArn

      @Stability(Stable) @NotNull public String getAttrKeyArn()
      The Amazon Resource Name (ARN) for the API key resource.

      Used when you need to specify a resource across all AWS .

    • getAttrUpdateTime

      @Stability(Stable) @NotNull public String getAttrUpdateTime()
      The timestamp for when the API key resource was last updated in ISO 8601 format: YYYY-MM-DDThh:mm:ss.sssZ .
    • getCdkTagManager

      @Stability(Stable) @NotNull public TagManager getCdkTagManager()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getCdkTagManager in interface ITaggableV2
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getKeyName

      @Stability(Stable) @NotNull public String getKeyName()
      A custom name for the API key resource.
    • setKeyName

      @Stability(Stable) public void setKeyName(@NotNull String value)
      A custom name for the API key resource.
    • getRestrictions

      @Stability(Stable) @NotNull public Object getRestrictions()
      The API key restrictions for the API key resource.
    • setRestrictions

      @Stability(Stable) public void setRestrictions(@NotNull IResolvable value)
      The API key restrictions for the API key resource.
    • setRestrictions

      @Stability(Stable) public void setRestrictions(@NotNull CfnAPIKey.ApiKeyRestrictionsProperty value)
      The API key restrictions for the API key resource.
    • getDescription

      @Stability(Stable) @Nullable public String getDescription()
      Updates the description for the API key resource.
    • setDescription

      @Stability(Stable) public void setDescription(@Nullable String value)
      Updates the description for the API key resource.
    • getExpireTime

      @Stability(Stable) @Nullable public String getExpireTime()
      The optional timestamp for when the API key resource will expire in ISO 8601 format .
    • setExpireTime

      @Stability(Stable) public void setExpireTime(@Nullable String value)
      The optional timestamp for when the API key resource will expire in ISO 8601 format .
    • getForceDelete

      @Stability(Stable) @Nullable public Object getForceDelete()
      ForceDelete bypasses an API key's expiry conditions and deletes the key.
    • setForceDelete

      @Stability(Stable) public void setForceDelete(@Nullable Boolean value)
      ForceDelete bypasses an API key's expiry conditions and deletes the key.
    • setForceDelete

      @Stability(Stable) public void setForceDelete(@Nullable IResolvable value)
      ForceDelete bypasses an API key's expiry conditions and deletes the key.
    • getForceUpdate

      @Stability(Stable) @Nullable public Object getForceUpdate()
      The boolean flag to be included for updating ExpireTime or Restrictions details.
    • setForceUpdate

      @Stability(Stable) public void setForceUpdate(@Nullable Boolean value)
      The boolean flag to be included for updating ExpireTime or Restrictions details.
    • setForceUpdate

      @Stability(Stable) public void setForceUpdate(@Nullable IResolvable value)
      The boolean flag to be included for updating ExpireTime or Restrictions details.
    • getNoExpiry

      @Stability(Stable) @Nullable public Object getNoExpiry()
      Whether the API key should expire.
    • setNoExpiry

      @Stability(Stable) public void setNoExpiry(@Nullable Boolean value)
      Whether the API key should expire.
    • setNoExpiry

      @Stability(Stable) public void setNoExpiry(@Nullable IResolvable value)
      Whether the API key should expire.
    • getTags

      @Stability(Stable) @Nullable public List<CfnTag> getTags()
      Applies one or more tags to the map resource.
    • setTags

      @Stability(Stable) public void setTags(@Nullable List<CfnTag> value)
      Applies one or more tags to the map resource.