Class Table
(experimental) An S3 Table with helpers.
Inherited Members
Namespace: Amazon.CDK.AWS.S3Tables.Alpha
Assembly: Amazon.CDK.AWS.S3Tables.Alpha.dll
Syntax (csharp)
public class Table : Resource, ITable, IResource, IConstruct, IDependable, IEnvironmentAware
Syntax (vb)
Public Class Table Inherits Resource Implements ITable, IResource, IConstruct, IDependable, IEnvironmentAware
Remarks
Stability: Experimental
ExampleMetadata: infused
Examples
// Build a table
var sampleTable = new Table(scope, "ExampleTable", new TableProps {
TableName = "example_table",
Namespace = namespace,
OpenTableFormat = OpenTableFormat.ICEBERG,
WithoutMetadata = true
});
// Build a table with an Iceberg Schema
var sampleTableWithSchema = new Table(scope, "ExampleSchemaTable", new TableProps {
TableName = "example_table_with_schema",
Namespace = namespace,
OpenTableFormat = OpenTableFormat.ICEBERG,
IcebergMetadata = new IcebergMetadataProperty {
IcebergSchema = new IcebergSchemaProperty {
SchemaFieldList = new [] { new SchemaFieldProperty {
Name = "id",
Type = "int",
Required = true
}, new SchemaFieldProperty {
Name = "name",
Type = "string"
} }
}
},
Compaction = new CompactionProperty {
Status = Status.ENABLED,
TargetFileSizeMb = 128
},
SnapshotManagement = new SnapshotManagementProperty {
Status = Status.ENABLED,
MaxSnapshotAgeHours = 48,
MinSnapshotsToKeep = 5
}
});
Synopsis
Constructors
| Table(Construct, string, ITableProps) | (experimental) An S3 Table with helpers. |
Properties
| AutoCreatePolicy | (experimental) Indicates if a table resource policy should automatically created upon the first call to |
| Namespace | (experimental) The namespace containing this table. |
| PROPERTY_INJECTION_ID | (experimental) Uniquely identifies this class. |
| TableArn | (experimental) The unique Amazon Resource Name (arn) of this table. |
| TableName | (experimental) The name of this table. |
| TablePolicy | (experimental) The resource policy for this table. |
Methods
| AddToResourcePolicy(PolicyStatement) | (experimental) Adds a statement to the resource policy for a principal (i.e. account/role/service) to perform actions on this table. |
| FromTableAttributes(Construct, string, ITableAttributes) | (experimental) Defines a Table construct that represents an external table. |
| GrantRead(IGrantable) | (experimental) Grant read permissions for this table to an IAM principal (Role/Group/User). |
| GrantReadWrite(IGrantable) | (experimental) Grant read and write permissions for this table to an IAM principal (Role/Group/User). |
| GrantWrite(IGrantable) | (experimental) Grant write permissions for this table to an IAM principal (Role/Group/User). |
| ValidateTableName(string) | (experimental) See https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-buckets-naming.html. |
Constructors
Table(Construct, string, ITableProps)
(experimental) An S3 Table with helpers.
public Table(Construct scope, string id, ITableProps props)
Parameters
- scope Construct
- id string
- props ITableProps
Remarks
Stability: Experimental
Properties
AutoCreatePolicy
(experimental) Indicates if a table resource policy should automatically created upon the first call to addToResourcePolicy.
protected virtual bool AutoCreatePolicy { get; set; }
Property Value
Remarks
Stability: Experimental
Namespace
(experimental) The namespace containing this table.
public virtual INamespace Namespace { get; }
Property Value
Remarks
Stability: Experimental
PROPERTY_INJECTION_ID
(experimental) Uniquely identifies this class.
public static string PROPERTY_INJECTION_ID { get; }
Property Value
Remarks
Stability: Experimental
TableArn
(experimental) The unique Amazon Resource Name (arn) of this table.
public virtual string TableArn { get; }
Property Value
Remarks
Stability: Experimental
TableName
(experimental) The name of this table.
public virtual string TableName { get; }
Property Value
Remarks
Stability: Experimental
TablePolicy
(experimental) The resource policy for this table.
public virtual CfnTablePolicy? TablePolicy { get; }
Property Value
Remarks
Stability: Experimental
Methods
AddToResourcePolicy(PolicyStatement)
(experimental) Adds a statement to the resource policy for a principal (i.e. account/role/service) to perform actions on this table.
public virtual IAddToResourcePolicyResult AddToResourcePolicy(PolicyStatement statement)
Parameters
- statement PolicyStatement
Returns
Remarks
Note that the policy statement may or may not be added to the policy.
For example, when an ITable is created from an existing table,
it's not possible to tell whether the table already has a policy
attached, let alone to re-use that policy to add more statements to it.
So it's safest to do nothing in these cases.
Stability: Experimental
FromTableAttributes(Construct, string, ITableAttributes)
(experimental) Defines a Table construct that represents an external table.
public static ITable FromTableAttributes(Construct scope, string id, ITableAttributes attrs)
Parameters
- scope Construct
The parent creating construct (usually
this).- id string
The construct's name.
- attrs ITableAttributes
A
TableAttributesobject containing the table name and ARN.
Returns
Remarks
Stability: Experimental
GrantRead(IGrantable)
(experimental) Grant read permissions for this table to an IAM principal (Role/Group/User).
public virtual Grant GrantRead(IGrantable identity)
Parameters
- identity IGrantable
Returns
Remarks
If the parent TableBucket of this table has encryption, you should grant kms:Decrypt permission to use this key to the same principal.
Stability: Experimental
GrantReadWrite(IGrantable)
(experimental) Grant read and write permissions for this table to an IAM principal (Role/Group/User).
public virtual Grant GrantReadWrite(IGrantable identity)
Parameters
- identity IGrantable
Returns
Remarks
If the parent TableBucket of this table has encryption, you should grant kms:GenerateDataKey and kms:Decrypt permission to use this key to the same principal.
Stability: Experimental
GrantWrite(IGrantable)
(experimental) Grant write permissions for this table to an IAM principal (Role/Group/User).
public virtual Grant GrantWrite(IGrantable identity)
Parameters
- identity IGrantable
Returns
Remarks
If the parent TableBucket of this table has encryption, you should grant kms:GenerateDataKey and kms:Decrypt permission to use this key to the same principal.
Stability: Experimental
ValidateTableName(string)
(experimental) See https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-buckets-naming.html.
public static void ValidateTableName(string tableName)
Parameters
- tableName string
Name of the table.
Remarks
Stability: Experimental
Throws: UnscopedValidationError if any naming errors are detected