Class TableBase

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

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-22T02:24:00.052Z") @Stability(Stable) public abstract class TableBase extends Resource implements ITable, IResourceWithPolicy
  • Constructor Details

    • TableBase

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

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

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

      @Stability(Stable) protected TableBase(@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.

      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", ...). This parameter is required.
    • grantFullAccess

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

      Appropriate grants will also be added to the customer-managed KMS key 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 from this table: BatchGetItem, GetRecords, GetShardIterator, Query, GetItem, Scan, DescribeTable.

      Appropriate grants will also be added to the customer-managed KMS key 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 to this table.

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

      Appropriate grants will also be added to the customer-managed KMS key 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's stream to an IAM principal's policy.

      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", ...). This parameter is required.
    • grantStreamRead

      @Stability(Stable) @NotNull public Grant grantStreamRead(@NotNull IGrantable grantee)
      Permits an IAM principal all stream data read operations for this table's stream: DescribeStream, GetRecords, GetShardIterator, ListStreams.

      Appropriate grants will also be added to the customer-managed KMS key 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 current dynamodb table.

      Specified by:
      grantTableListStreams in interface ITable
      Parameters:
      grantee - The principal (no-op if undefined). This parameter is required.
    • grantWriteData

      @Stability(Stable) @NotNull public Grant grantWriteData(@NotNull IGrantable grantee)
      Permits an IAM principal all data write operations to this table: BatchWriteItem, PutItem, UpdateItem, DeleteItem, DescribeTable.

      Appropriate grants will also be added to the customer-managed KMS key 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 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 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 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 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 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 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 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 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 this table.

      This will sum errors across all possible operations. Note that 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 this table.

      This will sum errors across all possible operations. Note that 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.

      Default: sum over 5 minutes

      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.

      Default: sum over 5 minutes

      Specified by:
      metricThrottledRequests in interface ITable
    • metricThrottledRequestsForOperation

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

      Default: sum over 5 minutes

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

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

      Default: sum over 5 minutes

      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. Note that 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. Note that 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.

      Note that 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.

      Note that 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()
    • getRegionalArns

      @Stability(Stable) @NotNull protected List<String> getRegionalArns()
    • getTableArn

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

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

      @Stability(Stable) @Nullable public abstract IKey getEncryptionKey()
      KMS encryption key, if this table uses a customer-managed encryption key.
      Specified by:
      getEncryptionKey in interface ITable
    • getTableStreamArn

      @Stability(Stable) @Nullable public abstract String getTableStreamArn()
      ARN of the table's stream, if there is one.
      Specified by:
      getTableStreamArn in interface ITable
    • getResourcePolicy

      @Stability(Stable) @Nullable public abstract PolicyDocument getResourcePolicy()
      Resource policy to assign to table.
    • setResourcePolicy

      @Stability(Stable) public abstract void setResourcePolicy(@Nullable PolicyDocument value)
      Resource policy to assign to table.