TableBase L2 construct
Initializer
new TableBase(scope: Construct, id: string, props?: ResourceProps)
TableBase(scope: Construct, id: str, props: typing.Optional[ResourceProps] = None)
new TableBase(Construct scope, String id, ResourceProps props)
new TableBase(Construct scope, string id, ResourceProps? props = null)
NewTableBase(Scope Construct, Id *string, Props ResourceProps)
Construct Props
accountoptionalstringaccountoptionalstraccountoptionalStringAccountoptionalstringAccountoptional*string#Default: the resource is in the same account as the stack it belongs to
environmentFromArnoptionalstringenvironment_from_arnoptionalstrenvironmentFromArnoptionalStringEnvironmentFromArnoptionalstringEnvironmentFromArnoptional*string#Default: take environment from account, region parameters, or use Stack environment.
The ARN is parsed and the account and region are taken from the ARN. This should be used for imported resources.
Cannot be supplied together with either account or region.
physicalNameoptionalstringphysical_nameoptionalstrphysicalNameoptionalStringPhysicalNameoptionalstringPhysicalNameoptional*string#Default: The physical name will be allocated by CloudFormation at deployment time
notes
undefinedimplies that a physical name will be allocated by CloudFormation during deployment.- a concrete value implies a specific physical name
PhysicalName.GENERATE_IF_NEEDEDis a marker that indicates that a physical will only be generated by the CDK if it is needed for cross-environment references. Otherwise, it will be allocated by CloudFormation.
Default: the resource is in the same region as the stack it belongs to
Properties
encryptionKeymay be undefinedIKeyencryption_keymay be undefinedIKeyencryptionKeymay be undefinedIKeyEncryptionKeymay be undefinedIKeyEncryptionKeymay be undefinedIKey#envResourceEnvironmentenvResourceEnvironmentenvResourceEnvironmentEnvResourceEnvironmentEnvResourceEnvironmentrequired#notes
For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.
For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.
regionsmay be undefinedstring[]regionsmay be undefinedtyping.List[str]regionsmay be undefinedList<String>Regionsmay be undefinedstring[]Regionsmay be undefined*[]*string#resourcePolicymay be undefinedPolicyDocumentresource_policymay be undefinedPolicyDocumentresourcePolicymay be undefinedPolicyDocumentResourcePolicymay be undefinedPolicyDocumentResourcePolicymay be undefinedPolicyDocument#streamGrantsStreamGrantsstream_grantsStreamGrantsstreamGrantsStreamGrantsStreamGrantsStreamGrantsStreamGrantsStreamGrantsrequired#Will throw if the Table has not been configured for streaming.
tableRefTableReferencetable_refTableReferencetableRefTableReferenceTableRefTableReferenceTableRefTableReferencerequired#tableStreamArnmay be undefinedstringtable_stream_arnmay be undefinedstrtableStreamArnmay be undefinedStringTableStreamArnmay be undefinedstringTableStreamArnmay be undefined*string#Methods
addToResourcePolicy(statement: PolicyStatement): AddToResourcePolicyResultdef add_to_resource_policy(self, statement: PolicyStatement) -> AddToResourcePolicyResultpublic AddToResourcePolicyResult addToResourcePolicy(PolicyStatement statement)public AddToResourcePolicyResult AddToResourcePolicy(PolicyStatement statement)func AddToResourcePolicy(Statement PolicyStatement) AddToResourcePolicyResult#applyCrossStackReferenceStrength(strength: ReferenceStrength): voiddef apply_cross_stack_reference_strength(self, strength: ReferenceStrength) -> Nonepublic void applyCrossStackReferenceStrength(ReferenceStrength strength)public void ApplyCrossStackReferenceStrength(ReferenceStrength strength)func ApplyCrossStackReferenceStrength(Strength ReferenceStrength)#notes · 1 parameter
When set, any cross-stack reference to this resource will use the specified mechanism instead of the global default determined by the @aws-cdk/core:defaultCrossStackReferences context key. This is useful for selectively weakening specific references to avoid the "deadly embrace" problem without changing the app-wide default.
Parameters
strengthstrengthstrengthstrengthStrength— - The reference strength to use for this resource.
applyRemovalPolicy(policy: RemovalPolicy): voiddef apply_removal_policy(self, policy: RemovalPolicy) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy)public void ApplyRemovalPolicy(RemovalPolicy policy)func ApplyRemovalPolicy(Policy RemovalPolicy)#notes
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).
grant(grantee: IGrantable, ...actions: string[]): Grantdef grant(self, grantee: IGrantable, actions: str) -> Grantpublic Grant grant(IGrantable grantee, String actions)public Grant Grant(IGrantable grantee, string actions)func Grant(Grantee IGrantable, Actions *string) Grant#If encryptionKey is present, appropriate grants to the key needs to be added separately using the table.encryptionKey.grant* methods. [disable-awslint:no-grants]
2 parameters
Parameters
granteegranteegranteegranteeGrantee— The principal (no-op if undefined).actionsactionsactionsactionsActions— The set of actions to allow (i.e. "dynamodb:PutItem", "dynamodb:GetItem", ...).
grantFullAccess(grantee: IGrantable): Grantdef grant_full_access(self, grantee: IGrantable) -> Grantpublic Grant grantFullAccess(IGrantable grantee)public Grant GrantFullAccess(IGrantable grantee)func GrantFullAccess(Grantee IGrantable) Grant#Appropriate grants will also be added to the customer-managed KMS key if one was configured.
The use of this method is discouraged. Please use grants.fullAccess() instead.
[disable-awslint:no-grants]
1 parameter
Parameters
granteegranteegranteegranteeGrantee— The principal to grant access to.
grantOnKey(grantee: IGrantable, ...actions: string[]): GrantOnKeyResultdef grant_on_key(self, grantee: IGrantable, actions: str) -> GrantOnKeyResultpublic GrantOnKeyResult grantOnKey(IGrantable grantee, String actions)public GrantOnKeyResult GrantOnKey(IGrantable grantee, string actions)func GrantOnKey(Grantee IGrantable, Actions *string) GrantOnKeyResult#grantReadData(grantee: IGrantable): Grantdef grant_read_data(self, grantee: IGrantable) -> Grantpublic Grant grantReadData(IGrantable grantee)public Grant GrantReadData(IGrantable grantee)func GrantReadData(Grantee IGrantable) Grant#Appropriate grants will also be added to the customer-managed KMS key if one was configured.
The use of this method is discouraged. Please use grants.readData() instead.
[disable-awslint:no-grants]
1 parameter
Parameters
granteegranteegranteegranteeGrantee— The principal to grant access to.
grantReadWriteData(grantee: IGrantable): Grantdef grant_read_write_data(self, grantee: IGrantable) -> Grantpublic Grant grantReadWriteData(IGrantable grantee)public Grant GrantReadWriteData(IGrantable grantee)func GrantReadWriteData(Grantee IGrantable) Grant#notes · 1 parameter
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.
The use of this method is discouraged. Please use grants.readWriteData() instead.
[disable-awslint:no-grants]
Parameters
granteegranteegranteegranteeGrantee— The principal to grant access to.
grantStream(grantee: IGrantable, ...actions: string[]): Grantdef grant_stream(self, grantee: IGrantable, actions: str) -> Grantpublic Grant grantStream(IGrantable grantee, String actions)public Grant GrantStream(IGrantable grantee, string actions)func GrantStream(Grantee IGrantable, Actions *string) Grant#notes · 2 parameters
If encryptionKey is present, appropriate grants to the key needs to be added separately using the table.encryptionKey.grant* methods.
The use of this method is discouraged. Please use streamGrants.stream() instead.
[disable-awslint:no-grants]
Parameters
granteegranteegranteegranteeGrantee— The principal (no-op if undefined).actionsactionsactionsactionsActions— The set of actions to allow (i.e. "dynamodb:DescribeStream", "dynamodb:GetRecords", ...).
grantStreamRead(grantee: IGrantable): Grantdef grant_stream_read(self, grantee: IGrantable) -> Grantpublic Grant grantStreamRead(IGrantable grantee)public Grant GrantStreamRead(IGrantable grantee)func GrantStreamRead(Grantee IGrantable) Grant#Appropriate grants will also be added to the customer-managed KMS key if one was configured.
The use of this method is discouraged. Please use streamGrants.streamRead() instead.
[disable-awslint:no-grants]
1 parameter
Parameters
granteegranteegranteegranteeGrantee— The principal to grant access to.
grantTableListStreams(grantee: IGrantable): Grantdef grant_table_list_streams(self, grantee: IGrantable) -> Grantpublic Grant grantTableListStreams(IGrantable grantee)public Grant GrantTableListStreams(IGrantable grantee)func GrantTableListStreams(Grantee IGrantable) Grant#The use of this method is discouraged. Please use streamGrants.tableListStreams() instead.
[disable-awslint:no-grants]
1 parameter
Parameters
granteegranteegranteegranteeGrantee— The principal (no-op if undefined).
grantWriteData(grantee: IGrantable): Grantdef grant_write_data(self, grantee: IGrantable) -> Grantpublic Grant grantWriteData(IGrantable grantee)public Grant GrantWriteData(IGrantable grantee)func GrantWriteData(Grantee IGrantable) Grant#Appropriate grants will also be added to the customer-managed KMS key if one was configured.
The use of this method is discouraged. Please use grants.writeData() instead.
[disable-awslint:no-grants]
1 parameter
Parameters
granteegranteegranteegranteeGrantee— The principal to grant access to.
isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#notes · 1 parameter · returns
Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.
Parameters
xxxxX— Any object.
Returns: true if x is an object created from a class which extends Construct.
isOwnedResource(construct: IConstruct): boolean@staticmethod def is_owned_resource(construct: IConstruct) -> boolpublic static Boolean isOwnedResource(IConstruct construct)public static bool IsOwnedResource(IConstruct construct)func IsOwnedResource(Construct IConstruct) *boolstatic#isResource(construct: IConstruct): boolean@staticmethod def is_resource(construct: IConstruct) -> boolpublic static Boolean isResource(IConstruct construct)public static bool IsResource(IConstruct construct)func IsResource(Construct IConstruct) *boolstatic#metric(metricName: string, props?: MetricOptions): Metricdef metric(self, metric_name: str, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metric(String metricName, MetricOptions props)public Metric Metric(string metricName, MetricOptions? props = null)func Metric(MetricName *string, Props MetricOptions) Metric#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(props?: MetricOptions): Metricdef metric_conditional_check_failed_requests(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricConditionalCheckFailedRequests(MetricOptions props)public Metric MetricConditionalCheckFailedRequests(MetricOptions? props = null)func MetricConditionalCheckFailedRequests(Props MetricOptions) Metric#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(props?: MetricOptions): Metricdef metric_consumed_read_capacity_units(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricConsumedReadCapacityUnits(MetricOptions props)public Metric MetricConsumedReadCapacityUnits(MetricOptions? props = null)func MetricConsumedReadCapacityUnits(Props MetricOptions) Metric#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(props?: MetricOptions): Metricdef metric_consumed_write_capacity_units(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricConsumedWriteCapacityUnits(MetricOptions props)public Metric MetricConsumedWriteCapacityUnits(MetricOptions? props = null)func MetricConsumedWriteCapacityUnits(Props MetricOptions) Metric#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.
metricSuccessfulRequestLatency(props?: MetricOptions): Metricdef metric_successful_request_latency(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricSuccessfulRequestLatency(MetricOptions props)public Metric MetricSuccessfulRequestLatency(MetricOptions? props = null)func MetricSuccessfulRequestLatency(Props MetricOptions) Metric#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.
metricSystemErrors(props?: MetricOptions): Metricdef metric_system_errors(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricSystemErrors(MetricOptions props)public Metric MetricSystemErrors(MetricOptions? props = null)func MetricSystemErrors(Props MetricOptions) Metricdeprecated#metricSystemErrorsForOperations(props?: SystemErrorsForOperationsMetricOptions): IMetricdef metric_system_errors_for_operations(self, props: typing.Optional[SystemErrorsForOperationsMetricOptions] = None) -> IMetricpublic IMetric metricSystemErrorsForOperations(SystemErrorsForOperationsMetricOptions props)public IMetric MetricSystemErrorsForOperations(SystemErrorsForOperationsMetricOptions? props = null)func MetricSystemErrorsForOperations(Props SystemErrorsForOperationsMetricOptions) IMetric#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.
metricThrottledRequests(props?: MetricOptions): Metricdef metric_throttled_requests(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricThrottledRequests(MetricOptions props)public Metric MetricThrottledRequests(MetricOptions? props = null)func MetricThrottledRequests(Props MetricOptions) Metricdeprecated#Default: sum over 5 minutes
metricThrottledRequestsForOperation(operation: string, props?: MetricOptions): Metricdef metric_throttled_requests_for_operation(self, operation: str, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricThrottledRequestsForOperation(String operation, MetricOptions props)public Metric MetricThrottledRequestsForOperation(string operation, MetricOptions? props = null)func MetricThrottledRequestsForOperation(Operation *string, Props MetricOptions) Metric#Default: sum over 5 minutes
metricThrottledRequestsForOperations(props?: OperationsMetricOptions): IMetricdef metric_throttled_requests_for_operations(self, props: typing.Optional[OperationsMetricOptions] = None) -> IMetricpublic IMetric metricThrottledRequestsForOperations(OperationsMetricOptions props)public IMetric MetricThrottledRequestsForOperations(OperationsMetricOptions? props = null)func MetricThrottledRequestsForOperations(Props OperationsMetricOptions) IMetric#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.
metricUserErrors(props?: MetricOptions): Metricdef metric_user_errors(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricUserErrors(MetricOptions props)public Metric MetricUserErrors(MetricOptions? props = null)func MetricUserErrors(Props MetricOptions) Metric#notes
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.
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.