# API Reference
## Constructs
### GlobalTable
- *Implements:* IGlobalTable
#### Initializers
```typescript
import { GlobalTable } from 'awscdk-dynamodb-global-tables'
new GlobalTable(scope: Construct, id: string, props: GlobalTableProps)
```
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| constructs.Construct
| *No description.* |
| id
| string
| *No description.* |
| props
| GlobalTableProps
| *No description.* |
---
##### `scope`Required
- *Type:* constructs.Construct
---
##### `id`Required
- *Type:* string
---
##### `props`Required
- *Type:* GlobalTableProps
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| toString
| Returns a string representation of this construct. |
| applyRemovalPolicy
| Apply the given removal policy to this resource. |
| grant
| Adds an IAM policy statement associated with this table to an IAM principal's policy. |
| grantReadData
| Permits an IAM principal all data read operations from this table: BatchGetItem, Query, GetItem, Scan, ConditionCheckItem, DescribeTable. |
| grantReadWriteData
| Permits an IAM principal to all data read/write operations to this table. BatchGetItem, Query, GetItem, Scan, ConditionCheckItem, DescribeTable, PutItem. |
| grantWriteData
| Permits an IAM principal all data write operations to this table: PutItem. |
---
##### `toString`
```typescript
public toString(): string
```
Returns a string representation of this construct.
##### `applyRemovalPolicy`
```typescript
public applyRemovalPolicy(policy: RemovalPolicy): void
```
Apply the given removal policy to this resource.
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`).
###### `policy`Required
- *Type:* aws-cdk-lib.RemovalPolicy
---
##### `grant`
```typescript
public grant(grantee: IGrantable, actions: string): Grant
```
Adds an IAM policy statement associated with this table to an IAM principal's policy.
###### `grantee`Required
- *Type:* aws-cdk-lib.aws_iam.IGrantable
---
###### `actions`Required
- *Type:* string
---
##### `grantReadData`
```typescript
public grantReadData(identity: IGrantable): Grant
```
Permits an IAM principal all data read operations from this table: BatchGetItem, Query, GetItem, Scan, ConditionCheckItem, DescribeTable.
###### `identity`Required
- *Type:* aws-cdk-lib.aws_iam.IGrantable
---
##### `grantReadWriteData`
```typescript
public grantReadWriteData(grantee: IGrantable): Grant
```
Permits an IAM principal to all data read/write operations to this table. BatchGetItem, Query, GetItem, Scan, ConditionCheckItem, DescribeTable, PutItem.
Appropriate grants will also be added to the customer-managed KMS key
if one was configured.
###### `grantee`Required
- *Type:* aws-cdk-lib.aws_iam.IGrantable
---
##### `grantWriteData`
```typescript
public grantWriteData(grantee: IGrantable): Grant
```
Permits an IAM principal all data write operations to this table: PutItem.
Appropriate grants will also be added to the customer-managed KMS key
if one was configured.
###### `grantee`Required
- *Type:* aws-cdk-lib.aws_iam.IGrantable
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| isConstruct
| Checks if `x` is a construct. |
| isOwnedResource
| Returns true if the construct was created by CDK, and false otherwise. |
| isResource
| Check whether the given construct is a Resource. |
---
##### ~~`isConstruct`~~
```typescript
import { GlobalTable } from 'awscdk-dynamodb-global-tables'
GlobalTable.isConstruct(x: any)
```
Checks if `x` is a construct.
###### `x`Required
- *Type:* any
Any object.
---
##### `isOwnedResource`
```typescript
import { GlobalTable } from 'awscdk-dynamodb-global-tables'
GlobalTable.isOwnedResource(construct: IConstruct)
```
Returns true if the construct was created by CDK, and false otherwise.
###### `construct`Required
- *Type:* constructs.IConstruct
---
##### `isResource`
```typescript
import { GlobalTable } from 'awscdk-dynamodb-global-tables'
GlobalTable.isResource(construct: IConstruct)
```
Check whether the given construct is a Resource.
###### `construct`Required
- *Type:* constructs.IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| constructs.Node
| The tree node. |
| env
| aws-cdk-lib.ResourceEnvironment
| The environment this resource belongs to. |
| stack
| aws-cdk-lib.Stack
| The stack in which this resource is defined. |
| tableArn
| string
| *No description.* |
| tableName
| string
| *No description.* |
---
##### `node`Required
```typescript
public readonly node: Node;
```
- *Type:* constructs.Node
The tree node.
---
##### `env`Required
```typescript
public readonly env: ResourceEnvironment;
```
- *Type:* aws-cdk-lib.ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK
(generally, those created by creating new class instances like Role, Bucket, etc.),
this is always the same as the environment of the stack they belong to;
however, for imported resources
(those obtained from static methods like fromRoleArn, fromBucketName, etc.),
that might be different than the stack they were imported into.
---
##### `stack`Required
```typescript
public readonly stack: Stack;
```
- *Type:* aws-cdk-lib.Stack
The stack in which this resource is defined.
---
##### `tableArn`Required
```typescript
public readonly tableArn: string;
```
- *Type:* string
---
##### `tableName`Required
```typescript
public readonly tableName: string;
```
- *Type:* string
---
## Structs
### GlobalTableProps
#### Initializer
```typescript
import { GlobalTableProps } from 'awscdk-dynamodb-global-tables'
const globalTableProps: GlobalTableProps = { ... }
```
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| partitionKey
| aws-cdk-lib.aws_dynamodb.Attribute
| *No description.* |
| tableName
| string
| *No description.* |
---
##### `partitionKey`Required
```typescript
public readonly partitionKey: Attribute;
```
- *Type:* aws-cdk-lib.aws_dynamodb.Attribute
---
##### `tableName`Optional
```typescript
public readonly tableName: string;
```
- *Type:* string
---
## Protocols
### IGlobalTable
- *Extends:* aws-cdk-lib.IResource
- *Implemented By:* GlobalTable, IGlobalTable
#### Methods
| **Name** | **Description** |
| --- | --- |
| grant
| Adds an IAM policy statement associated with this table to an IAM principal's policy. |
| grantReadData
| Permits an IAM principal all data read operations from this table: BatchGetItem, Query, GetItem, Scan, ConditionCheckItem, DescribeTable. |
| grantReadWriteData
| Permits an IAM principal to all data read/write operations to this table. BatchGetItem, Query, GetItem, Scan, ConditionCheckItem, DescribeTable, PutItem. |
| grantWriteData
| Permits an IAM principal all data write operations to this table: PutItem. |
---
##### `grant`
```typescript
public grant(grantee: IGrantable, actions: string): Grant
```
Adds an IAM policy statement associated with this table to an IAM principal's policy.
###### `grantee`Required
- *Type:* aws-cdk-lib.aws_iam.IGrantable
The principal.
---
###### `actions`Required
- *Type:* string
The set of actions to allow (i.e. "dynamodb:PutItem", "dynamodb:GetItem", ...).
---
##### `grantReadData`
```typescript
public grantReadData(grantee: IGrantable): Grant
```
Permits an IAM principal all data read operations from this table: BatchGetItem, Query, GetItem, Scan, ConditionCheckItem, DescribeTable.
###### `grantee`Required
- *Type:* aws-cdk-lib.aws_iam.IGrantable
The principal to grant access to.
---
##### `grantReadWriteData`
```typescript
public grantReadWriteData(grantee: IGrantable): Grant
```
Permits an IAM principal to all data read/write operations to this table. BatchGetItem, Query, GetItem, Scan, ConditionCheckItem, DescribeTable, PutItem.
Appropriate grants will also be added to the customer-managed KMS key
if one was configured.
###### `grantee`Required
- *Type:* aws-cdk-lib.aws_iam.IGrantable
The principal to grant access to.
---
##### `grantWriteData`
```typescript
public grantWriteData(grantee: IGrantable): Grant
```
Permits an IAM principal all data write operations to this table: PutItem.
Appropriate grants will also be added to the customer-managed KMS key
if one was configured.
###### `grantee`Required
- *Type:* aws-cdk-lib.aws_iam.IGrantable
The principal to grant access to.
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| constructs.Node
| The tree node. |
| env
| aws-cdk-lib.ResourceEnvironment
| The environment this resource belongs to. |
| stack
| aws-cdk-lib.Stack
| The stack in which this resource is defined. |
---
##### `node`Required
```typescript
public readonly node: Node;
```
- *Type:* constructs.Node
The tree node.
---
##### `env`Required
```typescript
public readonly env: ResourceEnvironment;
```
- *Type:* aws-cdk-lib.ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK
(generally, those created by creating new class instances like Role, Bucket, etc.),
this is always the same as the environment of the stack they belong to;
however, for imported resources
(those obtained from static methods like fromRoleArn, fromBucketName, etc.),
that might be different than the stack they were imported into.
---
##### `stack`Required
```typescript
public readonly stack: Stack;
```
- *Type:* aws-cdk-lib.Stack
The stack in which this resource is defined.
---