@Generated(value="jsii-pacmak/1.21.0 (build 4262b22)", date="2021-02-23T11:52:28.574Z") public class Table extends Resource implements ITable
Modifier and Type | Class and Description |
---|---|
static class |
Table.Builder
A fluent builder for
Table . |
ITable.Jsii$Default, ITable.Jsii$Proxy
Modifier | Constructor and Description |
---|---|
protected |
Table(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Table(software.amazon.jsii.JsiiObjectRef objRef) |
|
Table(software.constructs.Construct scope,
java.lang.String id,
TableProps props) |
Modifier and Type | Method and Description |
---|---|
void |
addGlobalSecondaryIndex(GlobalSecondaryIndexProps props)
Add a global secondary index of table.
|
void |
addLocalSecondaryIndex(LocalSecondaryIndexProps props)
Add a local secondary index of table.
|
IScalableTableAttribute |
autoScaleGlobalSecondaryIndexReadCapacity(java.lang.String indexName,
EnableScalingProps props)
Enable read capacity scaling for the given GSI.
|
IScalableTableAttribute |
autoScaleGlobalSecondaryIndexWriteCapacity(java.lang.String indexName,
EnableScalingProps props)
Enable write capacity scaling for the given GSI.
|
IScalableTableAttribute |
autoScaleReadCapacity(EnableScalingProps props)
Enable read capacity scaling for this table.
|
IScalableTableAttribute |
autoScaleWriteCapacity(EnableScalingProps props)
Enable write capacity scaling for this table.
|
static ITable |
fromTableArn(software.constructs.Construct scope,
java.lang.String id,
java.lang.String tableArn)
Creates a Table construct that represents an external table via table arn.
|
static ITable |
fromTableAttributes(software.constructs.Construct scope,
java.lang.String id,
TableAttributes attrs)
Creates a Table construct that represents an external table.
|
static ITable |
fromTableName(software.constructs.Construct scope,
java.lang.String id,
java.lang.String tableName)
Creates a Table construct that represents an external table via table name.
|
IKey |
getEncryptionKey()
KMS encryption key, if this table uses a customer-managed encryption key.
|
protected java.lang.Boolean |
getHasIndex()
Whether this table has indexes.
|
protected java.util.List<java.lang.String> |
getRegionalArns() |
java.lang.String |
getTableArn()
Arn of the dynamodb table.
|
java.lang.String |
getTableName()
Table name of the dynamodb table.
|
java.lang.String |
getTableStreamArn()
ARN of the table's stream, if there is one.
|
Grant |
grant(IGrantable grantee,
java.lang.String... actions)
Adds an IAM policy statement associated with this table to an IAM principal's policy.
|
Grant |
grantFullAccess(IGrantable grantee)
Permits all DynamoDB operations ("dynamodb:*") to an IAM principal.
|
static Grant |
grantListStreams(IGrantable grantee)
Deprecated.
Use
grantTableListStreams(software.amazon.awscdk.services.iam.IGrantable) for more granular permission |
Grant |
grantReadData(IGrantable grantee)
Permits an IAM principal all data read operations from this table: BatchGetItem, GetRecords, GetShardIterator, Query, GetItem, Scan.
|
Grant |
grantReadWriteData(IGrantable grantee)
Permits an IAM principal to all data read/write operations to this table.
|
Grant |
grantStream(IGrantable grantee,
java.lang.String... actions)
Adds an IAM policy statement associated with this table's stream to an IAM principal's policy.
|
Grant |
grantStreamRead(IGrantable grantee)
Permits an IAM principal all stream data read operations for this table's stream: DescribeStream, GetRecords, GetShardIterator, ListStreams.
|
Grant |
grantTableListStreams(IGrantable grantee)
Permits an IAM Principal to list streams attached to current dynamodb table.
|
Grant |
grantWriteData(IGrantable grantee)
Permits an IAM principal all data write operations to this table: BatchWriteItem, PutItem, UpdateItem, DeleteItem.
|
Metric |
metric(java.lang.String metricName)
Return the given named metric for this Table.
|
Metric |
metric(java.lang.String metricName,
MetricOptions props)
Return the given named metric for this Table.
|
Metric |
metricConditionalCheckFailedRequests()
Metric for the conditional check failed requests this table.
|
Metric |
metricConditionalCheckFailedRequests(MetricOptions props)
Metric for the conditional check failed requests this table.
|
Metric |
metricConsumedReadCapacityUnits()
Metric for the consumed read capacity units this table.
|
Metric |
metricConsumedReadCapacityUnits(MetricOptions props)
Metric for the consumed read capacity units this table.
|
Metric |
metricConsumedWriteCapacityUnits()
Metric for the consumed write capacity units this table.
|
Metric |
metricConsumedWriteCapacityUnits(MetricOptions props)
Metric for the consumed write capacity units this table.
|
Metric |
metricSuccessfulRequestLatency()
Metric for the successful request latency this table.
|
Metric |
metricSuccessfulRequestLatency(MetricOptions props)
Metric for the successful request latency this table.
|
Metric |
metricSystemErrors()
Deprecated.
use `metricSystemErrorsForOperations`.
|
Metric |
metricSystemErrors(MetricOptions props)
Deprecated.
use `metricSystemErrorsForOperations`.
|
IMetric |
metricSystemErrorsForOperations()
Metric for the system errors this table.
|
IMetric |
metricSystemErrorsForOperations(SystemErrorsForOperationsMetricOptions props)
Metric for the system errors this table.
|
Metric |
metricThrottledRequests()
How many requests are throttled on this table.
|
Metric |
metricThrottledRequests(MetricOptions props)
How many requests are throttled on this table.
|
Metric |
metricUserErrors()
Metric for the user errors.
|
Metric |
metricUserErrors(MetricOptions props)
Metric for the user errors.
|
protected java.util.List<java.lang.String> |
validate()
Validate the table construct.
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getNode
protected Table(software.amazon.jsii.JsiiObjectRef objRef)
protected Table(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public Table(software.constructs.Construct scope, java.lang.String id, TableProps props)
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.public static ITable fromTableArn(software.constructs.Construct scope, java.lang.String id, java.lang.String tableArn)
scope
- The parent creating construct (usually `this`). This parameter is required.id
- The construct's name. This parameter is required.tableArn
- The table's ARN. This parameter is required.public static ITable fromTableAttributes(software.constructs.Construct scope, java.lang.String id, TableAttributes attrs)
scope
- The parent creating construct (usually `this`). This parameter is required.id
- The construct's name. This parameter is required.attrs
- A `TableAttributes` object. This parameter is required.public static ITable fromTableName(software.constructs.Construct scope, java.lang.String id, java.lang.String tableName)
scope
- The parent creating construct (usually `this`). This parameter is required.id
- The construct's name. This parameter is required.tableName
- The table's name. This parameter is required.@Deprecated public static Grant grantListStreams(IGrantable grantee)
grantTableListStreams(software.amazon.awscdk.services.iam.IGrantable)
for more granular permissiongrantee
- The principal (no-op if undefined). This parameter is required.public void addGlobalSecondaryIndex(GlobalSecondaryIndexProps props)
props
- the property of global secondary index. This parameter is required.public void addLocalSecondaryIndex(LocalSecondaryIndexProps props)
props
- the property of local secondary index. This parameter is required.public IScalableTableAttribute autoScaleGlobalSecondaryIndexReadCapacity(java.lang.String indexName, EnableScalingProps props)
indexName
- This parameter is required.props
- This parameter is required.public IScalableTableAttribute autoScaleGlobalSecondaryIndexWriteCapacity(java.lang.String indexName, EnableScalingProps props)
indexName
- This parameter is required.props
- This parameter is required.public IScalableTableAttribute autoScaleReadCapacity(EnableScalingProps props)
props
- This parameter is required.public IScalableTableAttribute autoScaleWriteCapacity(EnableScalingProps props)
props
- This parameter is required.public Grant grant(IGrantable grantee, java.lang.String... actions)
If encryptionKey
is present, appropriate grants to the key needs to be added
separately using the table.encryptionKey.grant*
methods.
public Grant grantFullAccess(IGrantable grantee)
Appropriate grants will also be added to the customer-managed KMS key if one was configured.
grantFullAccess
in interface ITable
grantee
- The principal to grant access to. This parameter is required.public Grant grantReadData(IGrantable grantee)
Appropriate grants will also be added to the customer-managed KMS key if one was configured.
grantReadData
in interface ITable
grantee
- The principal to grant access to. This parameter is required.public Grant grantReadWriteData(IGrantable grantee)
BatchGetItem, GetRecords, GetShardIterator, Query, GetItem, Scan, BatchWriteItem, PutItem, UpdateItem, DeleteItem
Appropriate grants will also be added to the customer-managed KMS key if one was configured.
grantReadWriteData
in interface ITable
grantee
- The principal to grant access to. This parameter is required.public Grant grantStream(IGrantable grantee, java.lang.String... actions)
If encryptionKey
is present, appropriate grants to the key needs to be added
separately using the table.encryptionKey.grant*
methods.
grantStream
in interface ITable
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.public Grant grantStreamRead(IGrantable grantee)
Appropriate grants will also be added to the customer-managed KMS key if one was configured.
grantStreamRead
in interface ITable
grantee
- The principal to grant access to. This parameter is required.public Grant grantTableListStreams(IGrantable grantee)
grantTableListStreams
in interface ITable
grantee
- The principal (no-op if undefined). This parameter is required.public Grant grantWriteData(IGrantable grantee)
Appropriate grants will also be added to the customer-managed KMS key if one was configured.
grantWriteData
in interface ITable
grantee
- The principal to grant access to. This parameter is required.public Metric metric(java.lang.String metricName, MetricOptions props)
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.
public Metric metric(java.lang.String metricName)
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.
public Metric metricConditionalCheckFailedRequests(MetricOptions props)
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.
metricConditionalCheckFailedRequests
in interface ITable
props
- public Metric metricConditionalCheckFailedRequests()
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.
metricConditionalCheckFailedRequests
in interface ITable
public Metric metricConsumedReadCapacityUnits(MetricOptions props)
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.
metricConsumedReadCapacityUnits
in interface ITable
props
- public Metric metricConsumedReadCapacityUnits()
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.
metricConsumedReadCapacityUnits
in interface ITable
public Metric metricConsumedWriteCapacityUnits(MetricOptions props)
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.
metricConsumedWriteCapacityUnits
in interface ITable
props
- public Metric metricConsumedWriteCapacityUnits()
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.
metricConsumedWriteCapacityUnits
in interface ITable
public Metric metricSuccessfulRequestLatency(MetricOptions props)
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.
metricSuccessfulRequestLatency
in interface ITable
props
- public Metric metricSuccessfulRequestLatency()
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.
metricSuccessfulRequestLatency
in interface ITable
@Deprecated public Metric metricSystemErrors(MetricOptions props)
metricSystemErrors
in interface ITable
props
- @Deprecated public Metric metricSystemErrors()
metricSystemErrors
in interface ITable
public IMetric metricSystemErrorsForOperations(SystemErrorsForOperationsMetricOptions props)
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.
metricSystemErrorsForOperations
in interface ITable
props
- public IMetric metricSystemErrorsForOperations()
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.
metricSystemErrorsForOperations
in interface ITable
public Metric metricThrottledRequests(MetricOptions props)
Default: sum over 5 minutes
metricThrottledRequests
in interface ITable
props
- public Metric metricThrottledRequests()
Default: sum over 5 minutes
metricThrottledRequests
in interface ITable
public Metric metricUserErrors(MetricOptions props)
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.
metricUserErrors
in interface ITable
props
- public Metric metricUserErrors()
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.
metricUserErrors
in interface ITable
protected java.util.List<java.lang.String> validate()
protected java.lang.Boolean getHasIndex()
protected java.util.List<java.lang.String> getRegionalArns()
public java.lang.String getTableArn()
getTableArn
in interface ITable
public java.lang.String getTableName()
getTableName
in interface ITable
public IKey getEncryptionKey()
getEncryptionKey
in interface ITable
public java.lang.String getTableStreamArn()
getTableStreamArn
in interface ITable