S3TableStorage Class
Where an S3Table stores its data.
The two paths are mutually exclusive: a managed bucket may specify its server-side encryption, while an existing bucket keeps its own encryption — so an encryption choice can never be paired with a bring-your-own bucket.
Example
declare const myDatabase: glue.Database;
new glue.S3Table(this, 'MyTable', {
storage: glue.S3TableStorage.managedBucket(glue.S3TableEncryption.s3Managed()),
// ...
database: myDatabase,
columns: [{
name: 'col1',
type: glue.Schema.STRING,
}],
dataFormat: glue.DataFormat.JSON,
});
# my_database: glue.Database
glue.S3Table(self, "MyTable",
storage=glue.S3TableStorage.managed_bucket(glue.S3TableEncryption.s3_managed()),
# ...
database=my_database,
columns=[glue.Column(
name="col1",
type=glue.Schema.STRING
)],
data_format=glue.DataFormat.JSON
)
Database myDatabase;
S3Table.Builder.create(this, "MyTable")
.storage(S3TableStorage.managedBucket(S3TableEncryption.s3Managed()))
// ...
.database(myDatabase)
.columns(List.of(Column.builder()
.name("col1")
.type(Schema.STRING)
.build()))
.dataFormat(DataFormat.JSON)
.build();
// Install: dotnet add package Amazon.CDK.Lib
Database myDatabase;
new S3Table(this, "MyTable", new S3TableProps {
Storage = S3TableStorage.ManagedBucket(S3TableEncryption.S3Managed()),
// ...
Database = myDatabase,
Columns = new [] { new Column {
Name = "col1",
Type = Schema.STRING
} },
DataFormat = DataFormat.JSON
});
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var myDatabase Database
glue.NewS3Table(this, jsii.String("MyTable"), &S3TableProps{
Storage: glue.S3TableStorage_ManagedBucket(glue.S3TableEncryption_S3Managed()),
// ...
Database: myDatabase,
Columns: []Column{
&Column{
Name: jsii.String("col1"),
Type: glue.Schema_STRING(),
},
},
DataFormat: glue.DataFormat_JSON(),
})
Methods
fromBucket(bucket: IBucket): S3TableStorage // chainable@staticmethod def from_bucket(bucket: IBucket) -> S3TableStoragepublic static S3TableStorage fromBucket(IBucket bucket)public static S3TableStorage FromBucket(IBucket bucket)func FromBucket(Bucket IBucket) S3TableStoragestatic#notes · 1 parameter
The bucket can be one you don't own, imported with Bucket.fromBucketArn() or Bucket.fromBucketAttributes(). If that bucket is KMS-encrypted, import it with Bucket.fromBucketAttributes() and supply the encryptionKey attribute. Otherwise, CDK has no reference to the key, which means that S3Table.grantRead()/grantWrite() will correctly grant S3 access but silently skip the KMS permissions on the key. As a consequence, at runtime, reads and writes will fail with access denied on the key.
Parameters
bucketbucketbucketbucketBucket— the bucket that holds the table's data.
managedBucket(encryption?: S3TableEncryption): S3TableStorage // chainable@staticmethod def managed_bucket(encryption: typing.Optional[S3TableEncryption] = None) -> S3TableStoragepublic static S3TableStorage managedBucket(S3TableEncryption encryption)public static S3TableStorage ManagedBucket(S3TableEncryption? encryption = null)func ManagedBucket(Encryption S3TableEncryption) S3TableStoragestatic#1 parameter
Parameters
encryptionencryptionencryptionencryptionEncryption— the server-side encryption for the created bucket.