Class TableBaseV2

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.dynamodb.TableBaseV2
All Implemented Interfaces:
IResource, ITable, ITableV2, IResourceWithPolicy, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable
Direct Known Subclasses:
TableV2

@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)", date="2024-10-25T14:21:13.486Z") @Stability(Stable) public abstract class TableBaseV2 extends Resource implements ITableV2, IResourceWithPolicy
Base class for a DynamoDB table.
  • Constructor Details

    • TableBaseV2

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

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

      @Stability(Stable) protected TableBaseV2(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable ResourceProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props -
    • TableBaseV2

      @Stability(Stable) protected TableBaseV2(@NotNull software.constructs.Construct scope, @NotNull String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
  • Method Details

    • addToResourcePolicy

      @Stability(Stable) @NotNull public AddToResourcePolicyResult addToResourcePolicy(@NotNull PolicyStatement statement)
      Adds a statement to the resource policy associated with this file system.

      A resource policy will be automatically created upon the first call to addToResourcePolicy.

      Note that this does not work with imported file systems.

      Specified by:
      addToResourcePolicy in interface IResourceWithPolicy
      Parameters:
      statement - The policy statement to add. This parameter is required.
    • grant

      @Stability(Stable) @NotNull public Grant grant(@NotNull IGrantable grantee, @NotNull @NotNull String... actions)
      Adds an IAM policy statement associated with this table to an IAM principal's policy.

      Note: If encryptionKey is present, appropriate grants to the key needs to be added separately using the table.encryptionKey.grant* methods.

      Specified by:
      grant in interface ITable
      Parameters:
      grantee - the principal (no-op if undefined). This parameter is required.
      actions - the set of actions to allow (i.e., 'dynamodb:PutItem', 'dynamodb:GetItem', etc.). This parameter is required.
    • grantFullAccess

      @Stability(Stable) @NotNull public Grant grantFullAccess(@NotNull IGrantable grantee)
      Permits an IAM principal to all DynamoDB operations ('dynamodb:*') on this table.

      Note: Appropriate grants will also be added to the customer-managed KMS keys associated with this table if one was configured.

      Specified by:
      grantFullAccess in interface ITable
      Parameters:
      grantee - the principal to grant access to. This parameter is required.
    • grantReadData

      @Stability(Stable) @NotNull public Grant grantReadData(@NotNull IGrantable grantee)
      Permits an IAM principal all data read operations on this table.

      Actions: BatchGetItem, GetRecords, GetShardIterator, Query, GetItem, Scan, DescribeTable.

      Note: Appropriate grants will also be added to the customer-managed KMS keys associated with this table if one was configured.

      Specified by:
      grantReadData in interface ITable
      Parameters:
      grantee - the principal to grant access to. This parameter is required.
    • grantReadWriteData

      @Stability(Stable) @NotNull public Grant grantReadWriteData(@NotNull IGrantable grantee)
      Permits an IAM principal to all data read/write operations on this table.

      Actions: BatchGetItem, GetRecords, GetShardIterator, Query, GetItem, Scan, BatchWriteItem, PutItem, UpdateItem, DeleteItem, DescribeTable.

      Note: Appropriate grants will also be added to the customer-managed KMS keys associated with this table if one was configured.

      Specified by:
      grantReadWriteData in interface ITable
      Parameters:
      grantee - the principal to grant access to. This parameter is required.
    • grantStream

      @Stability(Stable) @NotNull public Grant grantStream(@NotNull IGrantable grantee, @NotNull @NotNull String... actions)
      Adds an IAM policy statement associated with this table to an IAM principal's policy.

      Note: If encryptionKey is present, appropriate grants to the key needs to be added separately using the table.encryptionKey.grant* methods.

      Specified by:
      grantStream in interface ITable
      Parameters:
      grantee - the principal (no-op if undefined). This parameter is required.
      actions - the set of actions to allow (i.e., 'dynamodb:DescribeStream', 'dynamodb:GetRecords', etc.). This parameter is required.
    • grantStreamRead

      @Stability(Stable) @NotNull public Grant grantStreamRead(@NotNull IGrantable grantee)
      Adds an IAM policy statement associated with this table to an IAM principal's policy.

      Actions: DescribeStream, GetRecords, GetShardIterator, ListStreams.

      Note: Appropriate grants will also be added to the customer-managed KMS keys associated with this table if one was configured.

      Specified by:
      grantStreamRead in interface ITable
      Parameters:
      grantee - the principal to grant access to. This parameter is required.
    • grantTableListStreams

      @Stability(Stable) @NotNull public Grant grantTableListStreams(@NotNull IGrantable grantee)
      Permits an IAM principal to list streams attached to this table.

      Specified by:
      grantTableListStreams in interface ITable
      Parameters:
      grantee - the principal to grant access to. This parameter is required.
    • grantWriteData

      @Stability(Stable) @NotNull public Grant grantWriteData(@NotNull IGrantable grantee)
      Permits an IAM principal all data write operations on this table.

      Actions: BatchWriteItem, PutItem, UpdateItem, DeleteItem, DescribeTable.

      Note: Appropriate grants will also be added to the customer-managed KMS keys associated with this table if one was configured.

      Specified by:
      grantWriteData in interface ITable
      Parameters:
      grantee - the principal to grant access to. This parameter is required.
    • metric

      @Stability(Stable) @NotNull public Metric metric(@NotNull String metricName, @Nullable MetricOptions props)
      Return the given named metric for this table.

      By default, the metric will be calculated as a sum over a period of 5 minutes. You can customize this by using the statistic and period properties.

      Specified by:
      metric in interface ITable
      Parameters:
      metricName - This parameter is required.
      props -
    • metric

      @Stability(Stable) @NotNull public Metric metric(@NotNull String metricName)
      Return the given named metric for this table.

      By default, the metric will be calculated as a sum over a period of 5 minutes. You can customize this by using the statistic and period properties.

      Specified by:
      metric in interface ITable
      Parameters:
      metricName - This parameter is required.
    • metricConditionalCheckFailedRequests

      @Stability(Stable) @NotNull public Metric metricConditionalCheckFailedRequests(@Nullable MetricOptions props)
      Metric for the conditional check failed requests for this table.

      By default, the metric will be calculated as a sum over a period of 5 minutes. You can customize this by using the statistic and period properties.

      Specified by:
      metricConditionalCheckFailedRequests in interface ITable
      Parameters:
      props -
    • metricConditionalCheckFailedRequests

      @Stability(Stable) @NotNull public Metric metricConditionalCheckFailedRequests()
      Metric for the conditional check failed requests for this table.

      By default, the metric will be calculated as a sum over a period of 5 minutes. You can customize this by using the statistic and period properties.

      Specified by:
      metricConditionalCheckFailedRequests in interface ITable
    • metricConsumedReadCapacityUnits

      @Stability(Stable) @NotNull public Metric metricConsumedReadCapacityUnits(@Nullable MetricOptions props)
      Metric for the consumed read capacity units for this table.

      By default, the metric will be calculated as a sum over a period of 5 minutes. You can customize this by using the statistic and period properties.

      Specified by:
      metricConsumedReadCapacityUnits in interface ITable
      Parameters:
      props -
    • metricConsumedReadCapacityUnits

      @Stability(Stable) @NotNull public Metric metricConsumedReadCapacityUnits()
      Metric for the consumed read capacity units for this table.

      By default, the metric will be calculated as a sum over a period of 5 minutes. You can customize this by using the statistic and period properties.

      Specified by:
      metricConsumedReadCapacityUnits in interface ITable
    • metricConsumedWriteCapacityUnits

      @Stability(Stable) @NotNull public Metric metricConsumedWriteCapacityUnits(@Nullable MetricOptions props)
      Metric for the consumed write capacity units for this table.

      By default, the metric will be calculated as a sum over a period of 5 minutes. You can customize this by using the statistic and period properties.

      Specified by:
      metricConsumedWriteCapacityUnits in interface ITable
      Parameters:
      props -
    • metricConsumedWriteCapacityUnits

      @Stability(Stable) @NotNull public Metric metricConsumedWriteCapacityUnits()
      Metric for the consumed write capacity units for this table.

      By default, the metric will be calculated as a sum over a period of 5 minutes. You can customize this by using the statistic and period properties.

      Specified by:
      metricConsumedWriteCapacityUnits in interface ITable
    • metricSuccessfulRequestLatency

      @Stability(Stable) @NotNull public Metric metricSuccessfulRequestLatency(@Nullable MetricOptions props)
      Metric for the successful request latency for this table.

      By default, the metric will be calculated as an average over a period of 5 minutes. You can customize this by using the statistic and period properties.

      Specified by:
      metricSuccessfulRequestLatency in interface ITable
      Parameters:
      props -
    • metricSuccessfulRequestLatency

      @Stability(Stable) @NotNull public Metric metricSuccessfulRequestLatency()
      Metric for the successful request latency for this table.

      By default, the metric will be calculated as an average over a period of 5 minutes. You can customize this by using the statistic and period properties.

      Specified by:
      metricSuccessfulRequestLatency in interface ITable
    • metricSystemErrors

      @Stability(Deprecated) @Deprecated @NotNull public Metric metricSystemErrors(@Nullable MetricOptions props)
      Deprecated.
      use metricSystemErrorsForOperations.
      (deprecated) Metric for the system errors this table.

      Parameters:
      props -
    • metricSystemErrors

      @Stability(Deprecated) @Deprecated @NotNull public Metric metricSystemErrors()
      Deprecated.
      use metricSystemErrorsForOperations.
      (deprecated) Metric for the system errors this table.

    • metricSystemErrorsForOperations

      @Stability(Stable) @NotNull public IMetric metricSystemErrorsForOperations(@Nullable SystemErrorsForOperationsMetricOptions props)
      Metric for the system errors for this table. This will sum errors across all possible operations.

      By default, each individual metric will be calculated as a sum over a period of 5 minutes. You can customize this by using the statistic and period properties.

      Specified by:
      metricSystemErrorsForOperations in interface ITable
      Parameters:
      props -
    • metricSystemErrorsForOperations

      @Stability(Stable) @NotNull public IMetric metricSystemErrorsForOperations()
      Metric for the system errors for this table. This will sum errors across all possible operations.

      By default, each individual metric will be calculated as a sum over a period of 5 minutes. You can customize this by using the statistic and period properties.

      Specified by:
      metricSystemErrorsForOperations in interface ITable
    • metricThrottledRequests

      @Stability(Deprecated) @Deprecated @NotNull public Metric metricThrottledRequests(@Nullable MetricOptions props)
      Deprecated.
      Do not use this function. It returns an invalid metric. Use metricThrottledRequestsForOperation instead.
      (deprecated) How many requests are throttled on this table.

      By default, each individual metric will be calculated as a sum over a period of 5 minutes. You can customize this by using the statistic and period properties.

      Specified by:
      metricThrottledRequests in interface ITable
      Parameters:
      props -
    • metricThrottledRequests

      @Stability(Deprecated) @Deprecated @NotNull public Metric metricThrottledRequests()
      Deprecated.
      Do not use this function. It returns an invalid metric. Use metricThrottledRequestsForOperation instead.
      (deprecated) How many requests are throttled on this table.

      By default, each individual metric will be calculated as a sum over a period of 5 minutes. You can customize this by using the statistic and period properties.

      Specified by:
      metricThrottledRequests in interface ITable
    • metricThrottledRequestsForOperation

      @Stability(Stable) @NotNull public IMetric metricThrottledRequestsForOperation(@NotNull String operation, @Nullable OperationsMetricOptions props)
      How many requests are throttled on this table for the given operation.

      By default, the metric will be calculated as an average over a period of 5 minutes. You can customize this by using the statistic and period properties.

      Parameters:
      operation - This parameter is required.
      props -
    • metricThrottledRequestsForOperation

      @Stability(Stable) @NotNull public IMetric metricThrottledRequestsForOperation(@NotNull String operation)
      How many requests are throttled on this table for the given operation.

      By default, the metric will be calculated as an average over a period of 5 minutes. You can customize this by using the statistic and period properties.

      Parameters:
      operation - This parameter is required.
    • metricThrottledRequestsForOperations

      @Stability(Stable) @NotNull public IMetric metricThrottledRequestsForOperations(@Nullable OperationsMetricOptions props)
      How many requests are throttled on this table. This will sum errors across all possible operations.

      By default, each individual metric will be calculated as a sum over a period of 5 minutes. You can customize this by using the statistic and period properties.

      Specified by:
      metricThrottledRequestsForOperations in interface ITable
      Parameters:
      props -
    • metricThrottledRequestsForOperations

      @Stability(Stable) @NotNull public IMetric metricThrottledRequestsForOperations()
      How many requests are throttled on this table. This will sum errors across all possible operations.

      By default, each individual metric will be calculated as a sum over a period of 5 minutes. You can customize this by using the statistic and period properties.

      Specified by:
      metricThrottledRequestsForOperations in interface ITable
    • metricUserErrors

      @Stability(Stable) @NotNull public Metric metricUserErrors(@Nullable MetricOptions props)
      Metric for the user errors for this table.

      Note: This metric reports user errors across all the tables in the account and region the table resides in.

      By default, the metric will be calculated as a sum over a period of 5 minutes. You can customize this by using the statistic and period properties.

      Specified by:
      metricUserErrors in interface ITable
      Parameters:
      props -
    • metricUserErrors

      @Stability(Stable) @NotNull public Metric metricUserErrors()
      Metric for the user errors for this table.

      Note: This metric reports user errors across all the tables in the account and region the table resides in.

      By default, the metric will be calculated as a sum over a period of 5 minutes. You can customize this by using the statistic and period properties.

      Specified by:
      metricUserErrors in interface ITable
    • getHasIndex

      @Stability(Stable) @NotNull protected abstract Boolean getHasIndex()
    • getRegion

      @Stability(Stable) @NotNull protected abstract String getRegion()
    • getTableArn

      @Stability(Stable) @NotNull public abstract String getTableArn()
      The ARN of the table.
      Specified by:
      getTableArn in interface ITable
    • getTableName

      @Stability(Stable) @NotNull public abstract String getTableName()
      The name of the table.
      Specified by:
      getTableName in interface ITable
    • getEncryptionKey

      @Stability(Stable) @Nullable public abstract IKey getEncryptionKey()
      The KMS encryption key for the table.
      Specified by:
      getEncryptionKey in interface ITable
    • getTableId

      @Stability(Stable) @Nullable public abstract String getTableId()
      The ID of the table.
      Specified by:
      getTableId in interface ITableV2
    • getTableStreamArn

      @Stability(Stable) @Nullable public abstract String getTableStreamArn()
      The stream ARN of the table.
      Specified by:
      getTableStreamArn in interface ITable
    • getResourcePolicy

      @Stability(Stable) @Nullable public abstract PolicyDocument getResourcePolicy()
      The resource policy for the table.
    • setResourcePolicy

      @Stability(Stable) public abstract void setResourcePolicy(@Nullable PolicyDocument value)
      The resource policy for the table.