@aws-cdk/aws-glue-alpha 2.116.1-alpha.0 → 2.118.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.jsii CHANGED
@@ -8,7 +8,7 @@
8
8
  "url": "https://aws.amazon.com"
9
9
  },
10
10
  "dependencies": {
11
- "aws-cdk-lib": "^2.116.1",
11
+ "aws-cdk-lib": "^2.118.0",
12
12
  "constructs": "^10.0.0"
13
13
  },
14
14
  "dependencyClosure": {
@@ -2344,6 +2344,19 @@
2344
2344
  }
2345
2345
  }
2346
2346
  },
2347
+ "aws-cdk-lib.aws_neptunegraph": {
2348
+ "targets": {
2349
+ "dotnet": {
2350
+ "package": "Amazon.CDK.AWS.NeptuneGraph"
2351
+ },
2352
+ "java": {
2353
+ "package": "software.amazon.awscdk.services.neptunegraph"
2354
+ },
2355
+ "python": {
2356
+ "module": "aws_cdk.aws_neptunegraph"
2357
+ }
2358
+ }
2359
+ },
2347
2360
  "aws-cdk-lib.aws_networkfirewall": {
2348
2361
  "targets": {
2349
2362
  "dotnet": {
@@ -3645,7 +3658,7 @@
3645
3658
  },
3646
3659
  "name": "@aws-cdk/aws-glue-alpha",
3647
3660
  "readme": {
3648
- "markdown": "# AWS Glue Construct Library\n<!--BEGIN STABILITY BANNER-->\n\n---\n\n![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge)\n\n> The APIs of higher level constructs in this module are experimental and under active development.\n> They are subject to non-backward compatible changes or removal in any future version. These are\n> not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be\n> announced in the release notes. This means that while you may use them, you may need to update\n> your source code when upgrading to a newer version of this package.\n\n---\n\n<!--END STABILITY BANNER-->\n\nThis module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project.\n\n## Job\n\nA `Job` encapsulates a script that connects to data sources, processes them, and then writes output to a data target.\n\nThere are 3 types of jobs supported by AWS Glue: Spark ETL, Spark Streaming, and Python Shell jobs.\n\nThe `glue.JobExecutable` allows you to specify the type of job, the language to use and the code assets required by the job.\n\n`glue.Code` allows you to refer to the different code assets required by the job, either from an existing S3 location or from a local file path.\n\n`glue.ExecutionClass` allows you to specify `FLEX` or `STANDARD`. `FLEX` is appropriate for non-urgent jobs such as pre-production jobs, testing, and one-time data loads.\n\n### Spark Jobs\n\nThese jobs run in an Apache Spark environment managed by AWS Glue.\n\n#### ETL Jobs\n\nAn ETL job processes data in batches using Apache Spark.\n\n```ts\ndeclare const bucket: s3.Bucket;\nnew glue.Job(this, 'ScalaSparkEtlJob', {\n executable: glue.JobExecutable.scalaEtl({\n glueVersion: glue.GlueVersion.V4_0,\n script: glue.Code.fromBucket(bucket, 'src/com/example/HelloWorld.scala'),\n className: 'com.example.HelloWorld',\n extraJars: [glue.Code.fromBucket(bucket, 'jars/HelloWorld.jar')],\n }),\n workerType: glue.WorkerType.G_8X,\n description: 'an example Scala ETL job',\n});\n```\n\n#### Streaming Jobs\n\nA Streaming job is similar to an ETL job, except that it performs ETL on data streams. It uses the Apache Spark Structured Streaming framework. Some Spark job features are not available to streaming ETL jobs.\n\n```ts\nnew glue.Job(this, 'PythonSparkStreamingJob', {\n executable: glue.JobExecutable.pythonStreaming({\n glueVersion: glue.GlueVersion.V4_0,\n pythonVersion: glue.PythonVersion.THREE,\n script: glue.Code.fromAsset(path.join(__dirname, 'job-script/hello_world.py')),\n }),\n description: 'an example Python Streaming job',\n});\n```\n\n### Python Shell Jobs\n\nA Python shell job runs Python scripts as a shell and supports a Python version that depends on the AWS Glue version you are using.\nThis can be used to schedule and run tasks that don't require an Apache Spark environment. Currently, three flavors are supported:\n\n* PythonVersion.TWO (2.7; EOL)\n* PythonVersion.THREE (3.6)\n* PythonVersion.THREE_NINE (3.9)\n\n```ts\ndeclare const bucket: s3.Bucket;\nnew glue.Job(this, 'PythonShellJob', {\n executable: glue.JobExecutable.pythonShell({\n glueVersion: glue.GlueVersion.V1_0,\n pythonVersion: glue.PythonVersion.THREE,\n script: glue.Code.fromBucket(bucket, 'script.py'),\n }),\n description: 'an example Python Shell job',\n});\n```\n\n### Ray Jobs\n\nThese jobs run in a Ray environment managed by AWS Glue.\n\n```ts\nnew glue.Job(this, 'RayJob', {\n executable: glue.JobExecutable.pythonRay({\n glueVersion: glue.GlueVersion.V4_0,\n pythonVersion: glue.PythonVersion.THREE_NINE,\n runtime: glue.Runtime.RAY_TWO_FOUR,\n script: glue.Code.fromAsset(path.join(__dirname, 'job-script/hello_world.py')),\n }),\n workerType: glue.WorkerType.Z_2X,\n workerCount: 2,\n description: 'an example Ray job'\n});\n```\n\n### Enable Spark UI\n\nEnable Spark UI setting the `sparkUI` property.\n\n```ts\nnew glue.Job(this, 'EnableSparkUI', {\n jobName: 'EtlJobWithSparkUIPrefix',\n sparkUI: {\n enabled: true,\n },\n executable: glue.JobExecutable.pythonEtl({\n glueVersion: glue.GlueVersion.V3_0,\n pythonVersion: glue.PythonVersion.THREE,\n script: glue.Code.fromAsset(path.join(__dirname, 'job-script/hello_world.py')),\n }),\n});\n```\n\nThe `sparkUI` property also allows the specification of an s3 bucket and a bucket prefix.\n\nSee [documentation](https://docs.aws.amazon.com/glue/latest/dg/add-job.html) for more information on adding jobs in Glue.\n\n## Connection\n\nA `Connection` allows Glue jobs, crawlers and development endpoints to access certain types of data stores. For example, to create a network connection to connect to a data source within a VPC:\n\n```ts\ndeclare const securityGroup: ec2.SecurityGroup;\ndeclare const subnet: ec2.Subnet;\nnew glue.Connection(this, 'MyConnection', {\n type: glue.ConnectionType.NETWORK,\n // The security groups granting AWS Glue inbound access to the data source within the VPC\n securityGroups: [securityGroup],\n // The VPC subnet which contains the data source\n subnet,\n});\n```\n\nFor RDS `Connection` by JDBC, it is recommended to manage credentials using AWS Secrets Manager. To use Secret, specify `SECRET_ID` in `properties` like the following code. Note that in this case, the subnet must have a route to the AWS Secrets Manager VPC endpoint or to the AWS Secrets Manager endpoint through a NAT gateway.\n\n```ts\ndeclare const securityGroup: ec2.SecurityGroup;\ndeclare const subnet: ec2.Subnet;\ndeclare const db: rds.DatabaseCluster;\nnew glue.Connection(this, \"RdsConnection\", {\n type: glue.ConnectionType.JDBC,\n securityGroups: [securityGroup],\n subnet,\n properties: {\n JDBC_CONNECTION_URL: `jdbc:mysql://${db.clusterEndpoint.socketAddress}/databasename`,\n JDBC_ENFORCE_SSL: \"false\",\n SECRET_ID: db.secret!.secretName,\n },\n});\n```\n\nIf you need to use a connection type that doesn't exist as a static member on `ConnectionType`, you can instantiate a `ConnectionType` object, e.g: `new glue.ConnectionType('NEW_TYPE')`.\n\nSee [Adding a Connection to Your Data Store](https://docs.aws.amazon.com/glue/latest/dg/populate-add-connection.html) and [Connection Structure](https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-catalog-connections.html#aws-glue-api-catalog-connections-Connection) documentation for more information on the supported data stores and their configurations.\n\n## SecurityConfiguration\n\nA `SecurityConfiguration` is a set of security properties that can be used by AWS Glue to encrypt data at rest.\n\n```ts\nnew glue.SecurityConfiguration(this, 'MySecurityConfiguration', {\n cloudWatchEncryption: {\n mode: glue.CloudWatchEncryptionMode.KMS,\n },\n jobBookmarksEncryption: {\n mode: glue.JobBookmarksEncryptionMode.CLIENT_SIDE_KMS,\n },\n s3Encryption: {\n mode: glue.S3EncryptionMode.KMS,\n },\n});\n```\n\nBy default, a shared KMS key is created for use with the encryption configurations that require one. You can also supply your own key for each encryption config, for example, for CloudWatch encryption:\n\n```ts\ndeclare const key: kms.Key;\nnew glue.SecurityConfiguration(this, 'MySecurityConfiguration', {\n cloudWatchEncryption: {\n mode: glue.CloudWatchEncryptionMode.KMS,\n kmsKey: key,\n },\n});\n```\n\nSee [documentation](https://docs.aws.amazon.com/glue/latest/dg/encryption-security-configuration.html) for more info for Glue encrypting data written by Crawlers, Jobs, and Development Endpoints.\n\n## Database\n\nA `Database` is a logical grouping of `Tables` in the Glue Catalog.\n\n```ts\nnew glue.Database(this, 'MyDatabase');\n```\n\n## Table\n\nA Glue table describes a table of data in S3: its structure (column names and types), location of data (S3 objects with a common prefix in a S3 bucket), and format for the files (Json, Avro, Parquet, etc.):\n\n```ts\ndeclare const myDatabase: glue.Database;\nnew glue.S3Table(this, 'MyTable', {\n database: myDatabase,\n columns: [{\n name: 'col1',\n type: glue.Schema.STRING,\n }, {\n name: 'col2',\n type: glue.Schema.array(glue.Schema.STRING),\n comment: 'col2 is an array of strings' // comment is optional\n }],\n dataFormat: glue.DataFormat.JSON,\n});\n```\n\nBy default, a S3 bucket will be created to store the table's data but you can manually pass the `bucket` and `s3Prefix`:\n\n```ts\ndeclare const myBucket: s3.Bucket;\ndeclare const myDatabase: glue.Database;\nnew glue.S3Table(this, 'MyTable', {\n bucket: myBucket,\n s3Prefix: 'my-table/',\n // ...\n database: myDatabase,\n columns: [{\n name: 'col1',\n type: glue.Schema.STRING,\n }],\n dataFormat: glue.DataFormat.JSON,\n});\n```\n\nGlue tables can be configured to contain user-defined properties, to describe the physical storage of table data, through the `storageParameters` property:\n\n```ts\ndeclare const myDatabase: glue.Database;\nnew glue.S3Table(this, 'MyTable', {\n storageParameters: [\n glue.StorageParameter.skipHeaderLineCount(1),\n glue.StorageParameter.compressionType(glue.CompressionType.GZIP),\n glue.StorageParameter.custom('separatorChar', ',')\n ],\n // ...\n database: myDatabase,\n columns: [{\n name: 'col1',\n type: glue.Schema.STRING,\n }],\n dataFormat: glue.DataFormat.JSON,\n});\n```\n\n### Partition Keys\n\nTo improve query performance, a table can specify `partitionKeys` on which data is stored and queried separately. For example, you might partition a table by `year` and `month` to optimize queries based on a time window:\n\n```ts\ndeclare const myDatabase: glue.Database;\nnew glue.S3Table(this, 'MyTable', {\n database: myDatabase,\n columns: [{\n name: 'col1',\n type: glue.Schema.STRING,\n }],\n partitionKeys: [{\n name: 'year',\n type: glue.Schema.SMALL_INT,\n }, {\n name: 'month',\n type: glue.Schema.SMALL_INT,\n }],\n dataFormat: glue.DataFormat.JSON,\n});\n```\n\n### Partition Indexes\n\nAnother way to improve query performance is to specify partition indexes. If no partition indexes are\npresent on the table, AWS Glue loads all partitions of the table and filters the loaded partitions using\nthe query expression. The query takes more time to run as the number of partitions increase. With an\nindex, the query will try to fetch a subset of the partitions instead of loading all partitions of the\ntable.\n\nThe keys of a partition index must be a subset of the partition keys of the table. You can have a\nmaximum of 3 partition indexes per table. To specify a partition index, you can use the `partitionIndexes`\nproperty:\n\n```ts\ndeclare const myDatabase: glue.Database;\nnew glue.S3Table(this, 'MyTable', {\n database: myDatabase,\n columns: [{\n name: 'col1',\n type: glue.Schema.STRING,\n }],\n partitionKeys: [{\n name: 'year',\n type: glue.Schema.SMALL_INT,\n }, {\n name: 'month',\n type: glue.Schema.SMALL_INT,\n }],\n partitionIndexes: [{\n indexName: 'my-index', // optional\n keyNames: ['year'],\n }], // supply up to 3 indexes\n dataFormat: glue.DataFormat.JSON,\n});\n```\n\nAlternatively, you can call the `addPartitionIndex()` function on a table:\n\n```ts\ndeclare const myTable: glue.Table;\nmyTable.addPartitionIndex({\n indexName: 'my-index',\n keyNames: ['year'],\n});\n```\n\n### Partition Filtering\n\nIf you have a table with a large number of partitions that grows over time, consider using AWS Glue partition indexing and filtering.\n\n```ts\ndeclare const myDatabase: glue.Database;\nnew glue.S3Table(this, 'MyTable', {\n database: myDatabase,\n columns: [{\n name: 'col1',\n type: glue.Schema.STRING,\n }],\n partitionKeys: [{\n name: 'year',\n type: glue.Schema.SMALL_INT,\n }, {\n name: 'month',\n type: glue.Schema.SMALL_INT,\n }],\n dataFormat: glue.DataFormat.JSON,\n enablePartitionFiltering: true,\n});\n```\n\n### Glue Connections\n\nGlue connections allow external data connections to third party databases and data warehouses. However, these connections can also be assigned to Glue Tables, allowing you to query external data sources using the Glue Data Catalog.\n\nWhereas `S3Table` will point to (and if needed, create) a bucket to store the tables' data, `ExternalTable` will point to an existing table in a data source. For example, to create a table in Glue that points to a table in Redshift:\n\n```ts\ndeclare const myConnection: glue.Connection;\ndeclare const myDatabase: glue.Database;\nnew glue.ExternalTable(this, 'MyTable', {\n connection: myConnection,\n externalDataLocation: 'default_db_public_example', // A table in Redshift\n // ...\n database: myDatabase,\n columns: [{\n name: 'col1',\n type: glue.Schema.STRING,\n }],\n dataFormat: glue.DataFormat.JSON,\n});\n```\n\n## [Encryption](https://docs.aws.amazon.com/athena/latest/ug/encryption.html)\n\nYou can enable encryption on a Table's data:\n\n* [S3Managed](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html) - (default) Server side encryption (`SSE-S3`) with an Amazon S3-managed key.\n\n```ts\ndeclare const myDatabase: glue.Database;\nnew glue.S3Table(this, 'MyTable', {\n encryption: glue.TableEncryption.S3_MANAGED,\n // ...\n database: myDatabase,\n columns: [{\n name: 'col1',\n type: glue.Schema.STRING,\n }],\n dataFormat: glue.DataFormat.JSON,\n});\n```\n\n* [Kms](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html) - Server-side encryption (`SSE-KMS`) with an AWS KMS Key managed by the account owner.\n\n```ts\ndeclare const myDatabase: glue.Database;\n// KMS key is created automatically\nnew glue.S3Table(this, 'MyTable', {\n encryption: glue.TableEncryption.KMS,\n // ...\n database: myDatabase,\n columns: [{\n name: 'col1',\n type: glue.Schema.STRING,\n }],\n dataFormat: glue.DataFormat.JSON,\n});\n\n// with an explicit KMS key\nnew glue.S3Table(this, 'MyTable', {\n encryption: glue.TableEncryption.KMS,\n encryptionKey: new kms.Key(this, 'MyKey'),\n // ...\n database: myDatabase,\n columns: [{\n name: 'col1',\n type: glue.Schema.STRING,\n }],\n dataFormat: glue.DataFormat.JSON,\n});\n```\n\n* [KmsManaged](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html) - Server-side encryption (`SSE-KMS`), like `Kms`, except with an AWS KMS Key managed by the AWS Key Management Service.\n\n```ts\ndeclare const myDatabase: glue.Database;\nnew glue.S3Table(this, 'MyTable', {\n encryption: glue.TableEncryption.KMS_MANAGED,\n // ...\n database: myDatabase,\n columns: [{\n name: 'col1',\n type: glue.Schema.STRING,\n }],\n dataFormat: glue.DataFormat.JSON,\n});\n```\n\n* [ClientSideKms](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingClientSideEncryption.html#client-side-encryption-kms-managed-master-key-intro) - Client-side encryption (`CSE-KMS`) with an AWS KMS Key managed by the account owner.\n\n```ts\ndeclare const myDatabase: glue.Database;\n// KMS key is created automatically\nnew glue.S3Table(this, 'MyTable', {\n encryption: glue.TableEncryption.CLIENT_SIDE_KMS,\n // ...\n database: myDatabase,\n columns: [{\n name: 'col1',\n type: glue.Schema.STRING,\n }],\n dataFormat: glue.DataFormat.JSON,\n});\n\n// with an explicit KMS key\nnew glue.S3Table(this, 'MyTable', {\n encryption: glue.TableEncryption.CLIENT_SIDE_KMS,\n encryptionKey: new kms.Key(this, 'MyKey'),\n // ...\n database: myDatabase,\n columns: [{\n name: 'col1',\n type: glue.Schema.STRING,\n }],\n dataFormat: glue.DataFormat.JSON,\n});\n```\n\n*Note: you cannot provide a `Bucket` when creating the `S3Table` if you wish to use server-side encryption (`KMS`, `KMS_MANAGED` or `S3_MANAGED`)*.\n\n## Types\n\nA table's schema is a collection of columns, each of which have a `name` and a `type`. Types are recursive structures, consisting of primitive and complex types:\n\n```ts\ndeclare const myDatabase: glue.Database;\nnew glue.S3Table(this, 'MyTable', {\n columns: [{\n name: 'primitive_column',\n type: glue.Schema.STRING,\n }, {\n name: 'array_column',\n type: glue.Schema.array(glue.Schema.INTEGER),\n comment: 'array<integer>',\n }, {\n name: 'map_column',\n type: glue.Schema.map(\n glue.Schema.STRING,\n glue.Schema.TIMESTAMP),\n comment: 'map<string,string>',\n }, {\n name: 'struct_column',\n type: glue.Schema.struct([{\n name: 'nested_column',\n type: glue.Schema.DATE,\n comment: 'nested comment',\n }]),\n comment: \"struct<nested_column:date COMMENT 'nested comment'>\",\n }],\n // ...\n database: myDatabase,\n dataFormat: glue.DataFormat.JSON,\n});\n```\n\n### Primitives\n\n#### Numeric\n\n| Name \t| Type \t| Comments |\n|-----------\t|----------\t|------------------------------------------------------------------------------------------------------------------\t|\n| FLOAT \t| Constant \t| A 32-bit single-precision floating point number |\n| INTEGER \t| Constant \t| A 32-bit signed value in two's complement format, with a minimum value of -2^31 and a maximum value of 2^31-1 \t|\n| DOUBLE \t| Constant \t| A 64-bit double-precision floating point number |\n| BIG_INT \t| Constant \t| A 64-bit signed INTEGER in two’s complement format, with a minimum value of -2^63 and a maximum value of 2^63 -1 |\n| SMALL_INT \t| Constant \t| A 16-bit signed INTEGER in two’s complement format, with a minimum value of -2^15 and a maximum value of 2^15-1 |\n| TINY_INT \t| Constant \t| A 8-bit signed INTEGER in two’s complement format, with a minimum value of -2^7 and a maximum value of 2^7-1 |\n\n#### Date and time\n\n| Name \t| Type \t| Comments \t|\n|-----------\t|----------\t|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------\t|\n| DATE \t| Constant \t| A date in UNIX format, such as YYYY-MM-DD. \t|\n| TIMESTAMP \t| Constant \t| Date and time instant in the UNiX format, such as yyyy-mm-dd hh:mm:ss[.f...]. For example, TIMESTAMP '2008-09-15 03:04:05.324'. This format uses the session time zone. \t|\n\n#### String\n\n| Name \t| Type \t| Comments \t|\n|--------------------------------------------\t|----------\t|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\t|\n| STRING \t| Constant \t| A string literal enclosed in single or double quotes \t|\n| decimal(precision: number, scale?: number) \t| Function \t| `precision` is the total number of digits. `scale` (optional) is the number of digits in fractional part with a default of 0. For example, use these type definitions: decimal(11,5), decimal(15) \t|\n| char(length: number) \t| Function \t| Fixed length character data, with a specified length between 1 and 255, such as char(10) \t|\n| varchar(length: number) \t| Function \t| Variable length character data, with a specified length between 1 and 65535, such as varchar(10) \t|\n\n#### Miscellaneous\n\n| Name \t| Type \t| Comments \t|\n|---------\t|----------\t|-------------------------------\t|\n| BOOLEAN \t| Constant \t| Values are `true` and `false` \t|\n| BINARY \t| Constant \t| Value is in binary \t|\n\n### Complex\n\n| Name \t| Type \t| Comments \t|\n|-------------------------------------\t|----------\t|-------------------------------------------------------------------\t|\n| array(itemType: Type) \t| Function \t| An array of some other type \t|\n| map(keyType: Type, valueType: Type) \t| Function \t| A map of some primitive key type to any value type \t|\n| struct(collumns: Column[]) \t| Function \t| Nested structure containing individually named and typed collumns \t|\n\n## Data Quality Ruleset\n\nA `DataQualityRuleset` specifies a data quality ruleset with DQDL rules applied to a specified AWS Glue table. For example, to create a data quality ruleset for a given table:\n\n```ts\nnew glue.DataQualityRuleset(this, 'MyDataQualityRuleset', {\n clientToken: 'client_token',\n description: 'description',\n rulesetName: 'ruleset_name',\n rulesetDqdl: 'ruleset_dqdl',\n tags: {\n key1: 'value1',\n key2: 'value2',\n },\n targetTable: new glue.DataQualityTargetTable('database_name', 'table_name'),\n});\n```\n\nFor more information, see [AWS Glue Data Quality](https://docs.aws.amazon.com/glue/latest/dg/glue-data-quality.html).\n"
3661
+ "markdown": "# AWS Glue Construct Library\n<!--BEGIN STABILITY BANNER-->\n\n---\n\n![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge)\n\n> The APIs of higher level constructs in this module are experimental and under active development.\n> They are subject to non-backward compatible changes or removal in any future version. These are\n> not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be\n> announced in the release notes. This means that while you may use them, you may need to update\n> your source code when upgrading to a newer version of this package.\n\n---\n\n<!--END STABILITY BANNER-->\n\nThis module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project.\n\n## Job\n\nA `Job` encapsulates a script that connects to data sources, processes them, and then writes output to a data target.\n\nThere are 3 types of jobs supported by AWS Glue: Spark ETL, Spark Streaming, and Python Shell jobs.\n\nThe `glue.JobExecutable` allows you to specify the type of job, the language to use and the code assets required by the job.\n\n`glue.Code` allows you to refer to the different code assets required by the job, either from an existing S3 location or from a local file path.\n\n`glue.ExecutionClass` allows you to specify `FLEX` or `STANDARD`. `FLEX` is appropriate for non-urgent jobs such as pre-production jobs, testing, and one-time data loads.\n\n### Spark Jobs\n\nThese jobs run in an Apache Spark environment managed by AWS Glue.\n\n#### ETL Jobs\n\nAn ETL job processes data in batches using Apache Spark.\n\n```ts\ndeclare const bucket: s3.Bucket;\nnew glue.Job(this, 'ScalaSparkEtlJob', {\n executable: glue.JobExecutable.scalaEtl({\n glueVersion: glue.GlueVersion.V4_0,\n script: glue.Code.fromBucket(bucket, 'src/com/example/HelloWorld.scala'),\n className: 'com.example.HelloWorld',\n extraJars: [glue.Code.fromBucket(bucket, 'jars/HelloWorld.jar')],\n }),\n workerType: glue.WorkerType.G_8X,\n description: 'an example Scala ETL job',\n});\n```\n\n#### Streaming Jobs\n\nA Streaming job is similar to an ETL job, except that it performs ETL on data streams. It uses the Apache Spark Structured Streaming framework. Some Spark job features are not available to streaming ETL jobs.\n\n```ts\nnew glue.Job(this, 'PythonSparkStreamingJob', {\n executable: glue.JobExecutable.pythonStreaming({\n glueVersion: glue.GlueVersion.V4_0,\n pythonVersion: glue.PythonVersion.THREE,\n script: glue.Code.fromAsset(path.join(__dirname, 'job-script/hello_world.py')),\n }),\n description: 'an example Python Streaming job',\n});\n```\n\n### Python Shell Jobs\n\nA Python shell job runs Python scripts as a shell and supports a Python version that depends on the AWS Glue version you are using.\nThis can be used to schedule and run tasks that don't require an Apache Spark environment. Currently, three flavors are supported:\n\n* PythonVersion.TWO (2.7; EOL)\n* PythonVersion.THREE (3.6)\n* PythonVersion.THREE_NINE (3.9)\n\n```ts\ndeclare const bucket: s3.Bucket;\nnew glue.Job(this, 'PythonShellJob', {\n executable: glue.JobExecutable.pythonShell({\n glueVersion: glue.GlueVersion.V1_0,\n pythonVersion: glue.PythonVersion.THREE,\n script: glue.Code.fromBucket(bucket, 'script.py'),\n }),\n description: 'an example Python Shell job',\n});\n```\n\n### Ray Jobs\n\nThese jobs run in a Ray environment managed by AWS Glue.\n\n```ts\nnew glue.Job(this, 'RayJob', {\n executable: glue.JobExecutable.pythonRay({\n glueVersion: glue.GlueVersion.V4_0,\n pythonVersion: glue.PythonVersion.THREE_NINE,\n runtime: glue.Runtime.RAY_TWO_FOUR,\n script: glue.Code.fromAsset(path.join(__dirname, 'job-script/hello_world.py')),\n }),\n workerType: glue.WorkerType.Z_2X,\n workerCount: 2,\n description: 'an example Ray job'\n});\n```\n\n### Enable Spark UI\n\nEnable Spark UI setting the `sparkUI` property.\n\n```ts\nnew glue.Job(this, 'EnableSparkUI', {\n jobName: 'EtlJobWithSparkUIPrefix',\n sparkUI: {\n enabled: true,\n },\n executable: glue.JobExecutable.pythonEtl({\n glueVersion: glue.GlueVersion.V3_0,\n pythonVersion: glue.PythonVersion.THREE,\n script: glue.Code.fromAsset(path.join(__dirname, 'job-script/hello_world.py')),\n }),\n});\n```\n\nThe `sparkUI` property also allows the specification of an s3 bucket and a bucket prefix.\n\nSee [documentation](https://docs.aws.amazon.com/glue/latest/dg/add-job.html) for more information on adding jobs in Glue.\n\n## Connection\n\nA `Connection` allows Glue jobs, crawlers and development endpoints to access certain types of data stores. For example, to create a network connection to connect to a data source within a VPC:\n\n```ts\ndeclare const securityGroup: ec2.SecurityGroup;\ndeclare const subnet: ec2.Subnet;\nnew glue.Connection(this, 'MyConnection', {\n type: glue.ConnectionType.NETWORK,\n // The security groups granting AWS Glue inbound access to the data source within the VPC\n securityGroups: [securityGroup],\n // The VPC subnet which contains the data source\n subnet,\n});\n```\n\nFor RDS `Connection` by JDBC, it is recommended to manage credentials using AWS Secrets Manager. To use Secret, specify `SECRET_ID` in `properties` like the following code. Note that in this case, the subnet must have a route to the AWS Secrets Manager VPC endpoint or to the AWS Secrets Manager endpoint through a NAT gateway.\n\n```ts\ndeclare const securityGroup: ec2.SecurityGroup;\ndeclare const subnet: ec2.Subnet;\ndeclare const db: rds.DatabaseCluster;\nnew glue.Connection(this, \"RdsConnection\", {\n type: glue.ConnectionType.JDBC,\n securityGroups: [securityGroup],\n subnet,\n properties: {\n JDBC_CONNECTION_URL: `jdbc:mysql://${db.clusterEndpoint.socketAddress}/databasename`,\n JDBC_ENFORCE_SSL: \"false\",\n SECRET_ID: db.secret!.secretName,\n },\n});\n```\n\nIf you need to use a connection type that doesn't exist as a static member on `ConnectionType`, you can instantiate a `ConnectionType` object, e.g: `new glue.ConnectionType('NEW_TYPE')`.\n\nSee [Adding a Connection to Your Data Store](https://docs.aws.amazon.com/glue/latest/dg/populate-add-connection.html) and [Connection Structure](https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-catalog-connections.html#aws-glue-api-catalog-connections-Connection) documentation for more information on the supported data stores and their configurations.\n\n## SecurityConfiguration\n\nA `SecurityConfiguration` is a set of security properties that can be used by AWS Glue to encrypt data at rest.\n\n```ts\nnew glue.SecurityConfiguration(this, 'MySecurityConfiguration', {\n cloudWatchEncryption: {\n mode: glue.CloudWatchEncryptionMode.KMS,\n },\n jobBookmarksEncryption: {\n mode: glue.JobBookmarksEncryptionMode.CLIENT_SIDE_KMS,\n },\n s3Encryption: {\n mode: glue.S3EncryptionMode.KMS,\n },\n});\n```\n\nBy default, a shared KMS key is created for use with the encryption configurations that require one. You can also supply your own key for each encryption config, for example, for CloudWatch encryption:\n\n```ts\ndeclare const key: kms.Key;\nnew glue.SecurityConfiguration(this, 'MySecurityConfiguration', {\n cloudWatchEncryption: {\n mode: glue.CloudWatchEncryptionMode.KMS,\n kmsKey: key,\n },\n});\n```\n\nSee [documentation](https://docs.aws.amazon.com/glue/latest/dg/encryption-security-configuration.html) for more info for Glue encrypting data written by Crawlers, Jobs, and Development Endpoints.\n\n## Database\n\nA `Database` is a logical grouping of `Tables` in the Glue Catalog.\n\n```ts\nnew glue.Database(this, 'MyDatabase', {\n databaseName: 'my_database',\n description: 'my_database_description',\n});\n```\n\n## Table\n\nA Glue table describes a table of data in S3: its structure (column names and types), location of data (S3 objects with a common prefix in a S3 bucket), and format for the files (Json, Avro, Parquet, etc.):\n\n```ts\ndeclare const myDatabase: glue.Database;\nnew glue.S3Table(this, 'MyTable', {\n database: myDatabase,\n columns: [{\n name: 'col1',\n type: glue.Schema.STRING,\n }, {\n name: 'col2',\n type: glue.Schema.array(glue.Schema.STRING),\n comment: 'col2 is an array of strings' // comment is optional\n }],\n dataFormat: glue.DataFormat.JSON,\n});\n```\n\nBy default, a S3 bucket will be created to store the table's data but you can manually pass the `bucket` and `s3Prefix`:\n\n```ts\ndeclare const myBucket: s3.Bucket;\ndeclare const myDatabase: glue.Database;\nnew glue.S3Table(this, 'MyTable', {\n bucket: myBucket,\n s3Prefix: 'my-table/',\n // ...\n database: myDatabase,\n columns: [{\n name: 'col1',\n type: glue.Schema.STRING,\n }],\n dataFormat: glue.DataFormat.JSON,\n});\n```\n\nGlue tables can be configured to contain user-defined properties, to describe the physical storage of table data, through the `storageParameters` property:\n\n```ts\ndeclare const myDatabase: glue.Database;\nnew glue.S3Table(this, 'MyTable', {\n storageParameters: [\n glue.StorageParameter.skipHeaderLineCount(1),\n glue.StorageParameter.compressionType(glue.CompressionType.GZIP),\n glue.StorageParameter.custom('separatorChar', ',')\n ],\n // ...\n database: myDatabase,\n columns: [{\n name: 'col1',\n type: glue.Schema.STRING,\n }],\n dataFormat: glue.DataFormat.JSON,\n});\n```\n\nGlue tables can also be configured to contain user-defined table properties through the [`parameters`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-table-tableinput.html#cfn-glue-table-tableinput-parameters) property:\n\n```ts\ndeclare const myDatabase: glue.Database;\nnew glue.S3Table(this, 'MyTable', {\n parameters: {\n key1: 'val1',\n key2: 'val2',\n },\n database: myDatabase,\n columns: [{\n name: 'col1',\n type: glue.Schema.STRING,\n }],\n dataFormat: glue.DataFormat.JSON,\n});\n```\n\n### Partition Keys\n\nTo improve query performance, a table can specify `partitionKeys` on which data is stored and queried separately. For example, you might partition a table by `year` and `month` to optimize queries based on a time window:\n\n```ts\ndeclare const myDatabase: glue.Database;\nnew glue.S3Table(this, 'MyTable', {\n database: myDatabase,\n columns: [{\n name: 'col1',\n type: glue.Schema.STRING,\n }],\n partitionKeys: [{\n name: 'year',\n type: glue.Schema.SMALL_INT,\n }, {\n name: 'month',\n type: glue.Schema.SMALL_INT,\n }],\n dataFormat: glue.DataFormat.JSON,\n});\n```\n\n### Partition Indexes\n\nAnother way to improve query performance is to specify partition indexes. If no partition indexes are\npresent on the table, AWS Glue loads all partitions of the table and filters the loaded partitions using\nthe query expression. The query takes more time to run as the number of partitions increase. With an\nindex, the query will try to fetch a subset of the partitions instead of loading all partitions of the\ntable.\n\nThe keys of a partition index must be a subset of the partition keys of the table. You can have a\nmaximum of 3 partition indexes per table. To specify a partition index, you can use the `partitionIndexes`\nproperty:\n\n```ts\ndeclare const myDatabase: glue.Database;\nnew glue.S3Table(this, 'MyTable', {\n database: myDatabase,\n columns: [{\n name: 'col1',\n type: glue.Schema.STRING,\n }],\n partitionKeys: [{\n name: 'year',\n type: glue.Schema.SMALL_INT,\n }, {\n name: 'month',\n type: glue.Schema.SMALL_INT,\n }],\n partitionIndexes: [{\n indexName: 'my-index', // optional\n keyNames: ['year'],\n }], // supply up to 3 indexes\n dataFormat: glue.DataFormat.JSON,\n});\n```\n\nAlternatively, you can call the `addPartitionIndex()` function on a table:\n\n```ts\ndeclare const myTable: glue.Table;\nmyTable.addPartitionIndex({\n indexName: 'my-index',\n keyNames: ['year'],\n});\n```\n\n### Partition Filtering\n\nIf you have a table with a large number of partitions that grows over time, consider using AWS Glue partition indexing and filtering.\n\n```ts\ndeclare const myDatabase: glue.Database;\nnew glue.S3Table(this, 'MyTable', {\n database: myDatabase,\n columns: [{\n name: 'col1',\n type: glue.Schema.STRING,\n }],\n partitionKeys: [{\n name: 'year',\n type: glue.Schema.SMALL_INT,\n }, {\n name: 'month',\n type: glue.Schema.SMALL_INT,\n }],\n dataFormat: glue.DataFormat.JSON,\n enablePartitionFiltering: true,\n});\n```\n\n### Glue Connections\n\nGlue connections allow external data connections to third party databases and data warehouses. However, these connections can also be assigned to Glue Tables, allowing you to query external data sources using the Glue Data Catalog.\n\nWhereas `S3Table` will point to (and if needed, create) a bucket to store the tables' data, `ExternalTable` will point to an existing table in a data source. For example, to create a table in Glue that points to a table in Redshift:\n\n```ts\ndeclare const myConnection: glue.Connection;\ndeclare const myDatabase: glue.Database;\nnew glue.ExternalTable(this, 'MyTable', {\n connection: myConnection,\n externalDataLocation: 'default_db_public_example', // A table in Redshift\n // ...\n database: myDatabase,\n columns: [{\n name: 'col1',\n type: glue.Schema.STRING,\n }],\n dataFormat: glue.DataFormat.JSON,\n});\n```\n\n## [Encryption](https://docs.aws.amazon.com/athena/latest/ug/encryption.html)\n\nYou can enable encryption on a Table's data:\n\n* [S3Managed](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html) - (default) Server side encryption (`SSE-S3`) with an Amazon S3-managed key.\n\n```ts\ndeclare const myDatabase: glue.Database;\nnew glue.S3Table(this, 'MyTable', {\n encryption: glue.TableEncryption.S3_MANAGED,\n // ...\n database: myDatabase,\n columns: [{\n name: 'col1',\n type: glue.Schema.STRING,\n }],\n dataFormat: glue.DataFormat.JSON,\n});\n```\n\n* [Kms](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html) - Server-side encryption (`SSE-KMS`) with an AWS KMS Key managed by the account owner.\n\n```ts\ndeclare const myDatabase: glue.Database;\n// KMS key is created automatically\nnew glue.S3Table(this, 'MyTable', {\n encryption: glue.TableEncryption.KMS,\n // ...\n database: myDatabase,\n columns: [{\n name: 'col1',\n type: glue.Schema.STRING,\n }],\n dataFormat: glue.DataFormat.JSON,\n});\n\n// with an explicit KMS key\nnew glue.S3Table(this, 'MyTable', {\n encryption: glue.TableEncryption.KMS,\n encryptionKey: new kms.Key(this, 'MyKey'),\n // ...\n database: myDatabase,\n columns: [{\n name: 'col1',\n type: glue.Schema.STRING,\n }],\n dataFormat: glue.DataFormat.JSON,\n});\n```\n\n* [KmsManaged](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html) - Server-side encryption (`SSE-KMS`), like `Kms`, except with an AWS KMS Key managed by the AWS Key Management Service.\n\n```ts\ndeclare const myDatabase: glue.Database;\nnew glue.S3Table(this, 'MyTable', {\n encryption: glue.TableEncryption.KMS_MANAGED,\n // ...\n database: myDatabase,\n columns: [{\n name: 'col1',\n type: glue.Schema.STRING,\n }],\n dataFormat: glue.DataFormat.JSON,\n});\n```\n\n* [ClientSideKms](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingClientSideEncryption.html#client-side-encryption-kms-managed-master-key-intro) - Client-side encryption (`CSE-KMS`) with an AWS KMS Key managed by the account owner.\n\n```ts\ndeclare const myDatabase: glue.Database;\n// KMS key is created automatically\nnew glue.S3Table(this, 'MyTable', {\n encryption: glue.TableEncryption.CLIENT_SIDE_KMS,\n // ...\n database: myDatabase,\n columns: [{\n name: 'col1',\n type: glue.Schema.STRING,\n }],\n dataFormat: glue.DataFormat.JSON,\n});\n\n// with an explicit KMS key\nnew glue.S3Table(this, 'MyTable', {\n encryption: glue.TableEncryption.CLIENT_SIDE_KMS,\n encryptionKey: new kms.Key(this, 'MyKey'),\n // ...\n database: myDatabase,\n columns: [{\n name: 'col1',\n type: glue.Schema.STRING,\n }],\n dataFormat: glue.DataFormat.JSON,\n});\n```\n\n*Note: you cannot provide a `Bucket` when creating the `S3Table` if you wish to use server-side encryption (`KMS`, `KMS_MANAGED` or `S3_MANAGED`)*.\n\n## Types\n\nA table's schema is a collection of columns, each of which have a `name` and a `type`. Types are recursive structures, consisting of primitive and complex types:\n\n```ts\ndeclare const myDatabase: glue.Database;\nnew glue.S3Table(this, 'MyTable', {\n columns: [{\n name: 'primitive_column',\n type: glue.Schema.STRING,\n }, {\n name: 'array_column',\n type: glue.Schema.array(glue.Schema.INTEGER),\n comment: 'array<integer>',\n }, {\n name: 'map_column',\n type: glue.Schema.map(\n glue.Schema.STRING,\n glue.Schema.TIMESTAMP),\n comment: 'map<string,string>',\n }, {\n name: 'struct_column',\n type: glue.Schema.struct([{\n name: 'nested_column',\n type: glue.Schema.DATE,\n comment: 'nested comment',\n }]),\n comment: \"struct<nested_column:date COMMENT 'nested comment'>\",\n }],\n // ...\n database: myDatabase,\n dataFormat: glue.DataFormat.JSON,\n});\n```\n\n### Primitives\n\n#### Numeric\n\n| Name \t| Type \t| Comments |\n|-----------\t|----------\t|------------------------------------------------------------------------------------------------------------------\t|\n| FLOAT \t| Constant \t| A 32-bit single-precision floating point number |\n| INTEGER \t| Constant \t| A 32-bit signed value in two's complement format, with a minimum value of -2^31 and a maximum value of 2^31-1 \t|\n| DOUBLE \t| Constant \t| A 64-bit double-precision floating point number |\n| BIG_INT \t| Constant \t| A 64-bit signed INTEGER in two’s complement format, with a minimum value of -2^63 and a maximum value of 2^63 -1 |\n| SMALL_INT \t| Constant \t| A 16-bit signed INTEGER in two’s complement format, with a minimum value of -2^15 and a maximum value of 2^15-1 |\n| TINY_INT \t| Constant \t| A 8-bit signed INTEGER in two’s complement format, with a minimum value of -2^7 and a maximum value of 2^7-1 |\n\n#### Date and time\n\n| Name \t| Type \t| Comments \t|\n|-----------\t|----------\t|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------\t|\n| DATE \t| Constant \t| A date in UNIX format, such as YYYY-MM-DD. \t|\n| TIMESTAMP \t| Constant \t| Date and time instant in the UNiX format, such as yyyy-mm-dd hh:mm:ss[.f...]. For example, TIMESTAMP '2008-09-15 03:04:05.324'. This format uses the session time zone. \t|\n\n#### String\n\n| Name \t| Type \t| Comments \t|\n|--------------------------------------------\t|----------\t|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\t|\n| STRING \t| Constant \t| A string literal enclosed in single or double quotes \t|\n| decimal(precision: number, scale?: number) \t| Function \t| `precision` is the total number of digits. `scale` (optional) is the number of digits in fractional part with a default of 0. For example, use these type definitions: decimal(11,5), decimal(15) \t|\n| char(length: number) \t| Function \t| Fixed length character data, with a specified length between 1 and 255, such as char(10) \t|\n| varchar(length: number) \t| Function \t| Variable length character data, with a specified length between 1 and 65535, such as varchar(10) \t|\n\n#### Miscellaneous\n\n| Name \t| Type \t| Comments \t|\n|---------\t|----------\t|-------------------------------\t|\n| BOOLEAN \t| Constant \t| Values are `true` and `false` \t|\n| BINARY \t| Constant \t| Value is in binary \t|\n\n### Complex\n\n| Name \t| Type \t| Comments \t|\n|-------------------------------------\t|----------\t|-------------------------------------------------------------------\t|\n| array(itemType: Type) \t| Function \t| An array of some other type \t|\n| map(keyType: Type, valueType: Type) \t| Function \t| A map of some primitive key type to any value type \t|\n| struct(collumns: Column[]) \t| Function \t| Nested structure containing individually named and typed collumns \t|\n\n## Data Quality Ruleset\n\nA `DataQualityRuleset` specifies a data quality ruleset with DQDL rules applied to a specified AWS Glue table. For example, to create a data quality ruleset for a given table:\n\n```ts\nnew glue.DataQualityRuleset(this, 'MyDataQualityRuleset', {\n clientToken: 'client_token',\n description: 'description',\n rulesetName: 'ruleset_name',\n rulesetDqdl: 'ruleset_dqdl',\n tags: {\n key1: 'value1',\n key2: 'value2',\n },\n targetTable: new glue.DataQualityTargetTable('database_name', 'table_name'),\n});\n```\n\nFor more information, see [AWS Glue Data Quality](https://docs.aws.amazon.com/glue/latest/dg/glue-data-quality.html).\n"
3649
3662
  },
3650
3663
  "repository": {
3651
3664
  "directory": "packages/@aws-cdk/aws-glue-alpha",
@@ -5737,7 +5750,7 @@
5737
5750
  },
5738
5751
  "locationInModule": {
5739
5752
  "filename": "lib/database.ts",
5740
- "line": 91
5753
+ "line": 98
5741
5754
  },
5742
5755
  "parameters": [
5743
5756
  {
@@ -5767,7 +5780,7 @@
5767
5780
  "kind": "class",
5768
5781
  "locationInModule": {
5769
5782
  "filename": "lib/database.ts",
5770
- "line": 51
5783
+ "line": 58
5771
5784
  },
5772
5785
  "methods": [
5773
5786
  {
@@ -5776,7 +5789,7 @@
5776
5789
  },
5777
5790
  "locationInModule": {
5778
5791
  "filename": "lib/database.ts",
5779
- "line": 53
5792
+ "line": 60
5780
5793
  },
5781
5794
  "name": "fromDatabaseArn",
5782
5795
  "parameters": [
@@ -5817,7 +5830,7 @@
5817
5830
  "immutable": true,
5818
5831
  "locationInModule": {
5819
5832
  "filename": "lib/database.ts",
5820
- "line": 69
5833
+ "line": 76
5821
5834
  },
5822
5835
  "name": "catalogArn",
5823
5836
  "overrides": "@aws-cdk/aws-glue-alpha.IDatabase",
@@ -5833,7 +5846,7 @@
5833
5846
  "immutable": true,
5834
5847
  "locationInModule": {
5835
5848
  "filename": "lib/database.ts",
5836
- "line": 74
5849
+ "line": 81
5837
5850
  },
5838
5851
  "name": "catalogId",
5839
5852
  "overrides": "@aws-cdk/aws-glue-alpha.IDatabase",
@@ -5849,7 +5862,7 @@
5849
5862
  "immutable": true,
5850
5863
  "locationInModule": {
5851
5864
  "filename": "lib/database.ts",
5852
- "line": 79
5865
+ "line": 86
5853
5866
  },
5854
5867
  "name": "databaseArn",
5855
5868
  "overrides": "@aws-cdk/aws-glue-alpha.IDatabase",
@@ -5865,7 +5878,7 @@
5865
5878
  "immutable": true,
5866
5879
  "locationInModule": {
5867
5880
  "filename": "lib/database.ts",
5868
- "line": 84
5881
+ "line": 91
5869
5882
  },
5870
5883
  "name": "databaseName",
5871
5884
  "overrides": "@aws-cdk/aws-glue-alpha.IDatabase",
@@ -5881,7 +5894,7 @@
5881
5894
  "immutable": true,
5882
5895
  "locationInModule": {
5883
5896
  "filename": "lib/database.ts",
5884
- "line": 89
5897
+ "line": 96
5885
5898
  },
5886
5899
  "name": "locationUri",
5887
5900
  "optional": true,
@@ -5897,9 +5910,9 @@
5897
5910
  "datatype": true,
5898
5911
  "docs": {
5899
5912
  "stability": "experimental",
5900
- "example": "// The code below shows an example of how to instantiate this type.\n// The values are placeholders you should change.\nimport * as glue_alpha from '@aws-cdk/aws-glue-alpha';\nconst databaseProps: glue_alpha.DatabaseProps = {\n databaseName: 'databaseName',\n locationUri: 'locationUri',\n};",
5913
+ "example": "new glue.Database(this, 'MyDatabase', {\n databaseName: 'my_database',\n description: 'my_database_description',\n});",
5901
5914
  "custom": {
5902
- "exampleMetadata": "fixture=_generated"
5915
+ "exampleMetadata": "infused"
5903
5916
  }
5904
5917
  },
5905
5918
  "fqn": "@aws-cdk/aws-glue-alpha.DatabaseProps",
@@ -5928,6 +5941,24 @@
5928
5941
  "primitive": "string"
5929
5942
  }
5930
5943
  },
5944
+ {
5945
+ "abstract": true,
5946
+ "docs": {
5947
+ "default": "- no database description",
5948
+ "stability": "experimental",
5949
+ "summary": "A description of the database."
5950
+ },
5951
+ "immutable": true,
5952
+ "locationInModule": {
5953
+ "filename": "lib/database.ts",
5954
+ "line": 52
5955
+ },
5956
+ "name": "description",
5957
+ "optional": true,
5958
+ "type": {
5959
+ "primitive": "string"
5960
+ }
5961
+ },
5931
5962
  {
5932
5963
  "abstract": true,
5933
5964
  "docs": {
@@ -6037,7 +6068,7 @@
6037
6068
  },
6038
6069
  "locationInModule": {
6039
6070
  "filename": "lib/external-table.ts",
6040
- "line": 117
6071
+ "line": 118
6041
6072
  },
6042
6073
  "name": "grantRead",
6043
6074
  "overrides": "@aws-cdk/aws-glue-alpha.TableBase",
@@ -6065,7 +6096,7 @@
6065
6096
  },
6066
6097
  "locationInModule": {
6067
6098
  "filename": "lib/external-table.ts",
6068
- "line": 137
6099
+ "line": 138
6069
6100
  },
6070
6101
  "name": "grantReadWrite",
6071
6102
  "overrides": "@aws-cdk/aws-glue-alpha.TableBase",
@@ -6093,7 +6124,7 @@
6093
6124
  },
6094
6125
  "locationInModule": {
6095
6126
  "filename": "lib/external-table.ts",
6096
- "line": 127
6127
+ "line": 128
6097
6128
  },
6098
6129
  "name": "grantWrite",
6099
6130
  "overrides": "@aws-cdk/aws-glue-alpha.TableBase",
@@ -10074,7 +10105,7 @@
10074
10105
  },
10075
10106
  "stability": "experimental",
10076
10107
  "summary": "A Glue table that targets a S3 dataset.",
10077
- "example": "declare const myDatabase: glue.Database;\nnew glue.S3Table(this, 'MyTable', {\n database: myDatabase,\n columns: [{\n name: 'col1',\n type: glue.Schema.STRING,\n }],\n partitionKeys: [{\n name: 'year',\n type: glue.Schema.SMALL_INT,\n }, {\n name: 'month',\n type: glue.Schema.SMALL_INT,\n }],\n partitionIndexes: [{\n indexName: 'my-index', // optional\n keyNames: ['year'],\n }], // supply up to 3 indexes\n dataFormat: glue.DataFormat.JSON,\n});"
10108
+ "example": "declare const myDatabase: glue.Database;\nnew glue.S3Table(this, 'MyTable', {\n database: myDatabase,\n columns: [{\n name: 'col1',\n type: glue.Schema.STRING,\n }],\n partitionKeys: [{\n name: 'year',\n type: glue.Schema.SMALL_INT,\n }, {\n name: 'month',\n type: glue.Schema.SMALL_INT,\n }],\n dataFormat: glue.DataFormat.JSON,\n enablePartitionFiltering: true,\n});"
10078
10109
  },
10079
10110
  "fqn": "@aws-cdk/aws-glue-alpha.S3Table",
10080
10111
  "initializer": {
@@ -10118,7 +10149,7 @@
10118
10149
  },
10119
10150
  "locationInModule": {
10120
10151
  "filename": "lib/s3-table.ts",
10121
- "line": 220
10152
+ "line": 221
10122
10153
  },
10123
10154
  "name": "generateS3PrefixForGrant",
10124
10155
  "protected": true,
@@ -10135,7 +10166,7 @@
10135
10166
  },
10136
10167
  "locationInModule": {
10137
10168
  "filename": "lib/s3-table.ts",
10138
- "line": 189
10169
+ "line": 190
10139
10170
  },
10140
10171
  "name": "grantRead",
10141
10172
  "overrides": "@aws-cdk/aws-glue-alpha.TableBase",
@@ -10163,7 +10194,7 @@
10163
10194
  },
10164
10195
  "locationInModule": {
10165
10196
  "filename": "lib/s3-table.ts",
10166
- "line": 213
10197
+ "line": 214
10167
10198
  },
10168
10199
  "name": "grantReadWrite",
10169
10200
  "overrides": "@aws-cdk/aws-glue-alpha.TableBase",
@@ -10191,7 +10222,7 @@
10191
10222
  },
10192
10223
  "locationInModule": {
10193
10224
  "filename": "lib/s3-table.ts",
10194
- "line": 201
10225
+ "line": 202
10195
10226
  },
10196
10227
  "name": "grantWrite",
10197
10228
  "overrides": "@aws-cdk/aws-glue-alpha.TableBase",
@@ -12493,7 +12524,7 @@
12493
12524
  },
12494
12525
  "locationInModule": {
12495
12526
  "filename": "lib/table-base.ts",
12496
- "line": 224
12527
+ "line": 240
12497
12528
  },
12498
12529
  "parameters": [
12499
12530
  {
@@ -12522,7 +12553,7 @@
12522
12553
  "kind": "class",
12523
12554
  "locationInModule": {
12524
12555
  "filename": "lib/table-base.ts",
12525
- "line": 155
12556
+ "line": 165
12526
12557
  },
12527
12558
  "methods": [
12528
12559
  {
@@ -12531,7 +12562,7 @@
12531
12562
  },
12532
12563
  "locationInModule": {
12533
12564
  "filename": "lib/table-base.ts",
12534
- "line": 157
12565
+ "line": 167
12535
12566
  },
12536
12567
  "name": "fromTableArn",
12537
12568
  "parameters": [
@@ -12568,7 +12599,7 @@
12568
12599
  },
12569
12600
  "locationInModule": {
12570
12601
  "filename": "lib/table-base.ts",
12571
- "line": 173
12602
+ "line": 183
12572
12603
  },
12573
12604
  "name": "fromTableAttributes",
12574
12605
  "parameters": [
@@ -12616,7 +12647,7 @@
12616
12647
  },
12617
12648
  "locationInModule": {
12618
12649
  "filename": "lib/table-base.ts",
12619
- "line": 254
12650
+ "line": 271
12620
12651
  },
12621
12652
  "name": "addPartitionIndex",
12622
12653
  "parameters": [
@@ -12635,7 +12666,7 @@
12635
12666
  },
12636
12667
  "locationInModule": {
12637
12668
  "filename": "lib/table-base.ts",
12638
- "line": 317
12669
+ "line": 334
12639
12670
  },
12640
12671
  "name": "grant",
12641
12672
  "parameters": [
@@ -12670,7 +12701,7 @@
12670
12701
  },
12671
12702
  "locationInModule": {
12672
12703
  "filename": "lib/table-base.ts",
12673
- "line": 243
12704
+ "line": 260
12674
12705
  },
12675
12706
  "name": "grantRead",
12676
12707
  "parameters": [
@@ -12694,7 +12725,7 @@
12694
12725
  },
12695
12726
  "locationInModule": {
12696
12727
  "filename": "lib/table-base.ts",
12697
- "line": 245
12728
+ "line": 262
12698
12729
  },
12699
12730
  "name": "grantReadWrite",
12700
12731
  "parameters": [
@@ -12719,7 +12750,7 @@
12719
12750
  },
12720
12751
  "locationInModule": {
12721
12752
  "filename": "lib/table-base.ts",
12722
- "line": 329
12753
+ "line": 346
12723
12754
  },
12724
12755
  "name": "grantToUnderlyingResources",
12725
12756
  "parameters": [
@@ -12754,7 +12785,7 @@
12754
12785
  },
12755
12786
  "locationInModule": {
12756
12787
  "filename": "lib/table-base.ts",
12757
- "line": 244
12788
+ "line": 261
12758
12789
  },
12759
12790
  "name": "grantWrite",
12760
12791
  "parameters": [
@@ -12782,7 +12813,7 @@
12782
12813
  "immutable": true,
12783
12814
  "locationInModule": {
12784
12815
  "filename": "lib/table-base.ts",
12785
- "line": 205
12816
+ "line": 215
12786
12817
  },
12787
12818
  "name": "columns",
12788
12819
  "type": {
@@ -12802,7 +12833,7 @@
12802
12833
  "immutable": true,
12803
12834
  "locationInModule": {
12804
12835
  "filename": "lib/table-base.ts",
12805
- "line": 195
12836
+ "line": 205
12806
12837
  },
12807
12838
  "name": "compressed",
12808
12839
  "type": {
@@ -12817,7 +12848,7 @@
12817
12848
  "immutable": true,
12818
12849
  "locationInModule": {
12819
12850
  "filename": "lib/table-base.ts",
12820
- "line": 190
12851
+ "line": 200
12821
12852
  },
12822
12853
  "name": "database",
12823
12854
  "type": {
@@ -12832,13 +12863,35 @@
12832
12863
  "immutable": true,
12833
12864
  "locationInModule": {
12834
12865
  "filename": "lib/table-base.ts",
12835
- "line": 200
12866
+ "line": 210
12836
12867
  },
12837
12868
  "name": "dataFormat",
12838
12869
  "type": {
12839
12870
  "fqn": "@aws-cdk/aws-glue-alpha.DataFormat"
12840
12871
  }
12841
12872
  },
12873
+ {
12874
+ "docs": {
12875
+ "see": "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-table-tableinput.html#cfn-glue-table-tableinput-parameters",
12876
+ "stability": "experimental",
12877
+ "summary": "The tables' properties associated with the table."
12878
+ },
12879
+ "immutable": true,
12880
+ "locationInModule": {
12881
+ "filename": "lib/table-base.ts",
12882
+ "line": 231
12883
+ },
12884
+ "name": "parameters",
12885
+ "protected": true,
12886
+ "type": {
12887
+ "collection": {
12888
+ "elementtype": {
12889
+ "primitive": "string"
12890
+ },
12891
+ "kind": "map"
12892
+ }
12893
+ }
12894
+ },
12842
12895
  {
12843
12896
  "abstract": true,
12844
12897
  "docs": {
@@ -12847,7 +12900,7 @@
12847
12900
  "immutable": true,
12848
12901
  "locationInModule": {
12849
12902
  "filename": "lib/table-base.ts",
12850
- "line": 184
12903
+ "line": 194
12851
12904
  },
12852
12905
  "name": "tableArn",
12853
12906
  "overrides": "@aws-cdk/aws-glue-alpha.ITable",
@@ -12863,7 +12916,7 @@
12863
12916
  "immutable": true,
12864
12917
  "locationInModule": {
12865
12918
  "filename": "lib/table-base.ts",
12866
- "line": 183
12919
+ "line": 193
12867
12920
  },
12868
12921
  "name": "tableName",
12869
12922
  "overrides": "@aws-cdk/aws-glue-alpha.ITable",
@@ -12879,7 +12932,7 @@
12879
12932
  "immutable": true,
12880
12933
  "locationInModule": {
12881
12934
  "filename": "lib/table-base.ts",
12882
- "line": 182
12935
+ "line": 192
12883
12936
  },
12884
12937
  "name": "tableResource",
12885
12938
  "protected": true,
@@ -12895,7 +12948,7 @@
12895
12948
  "immutable": true,
12896
12949
  "locationInModule": {
12897
12950
  "filename": "lib/table-base.ts",
12898
- "line": 185
12951
+ "line": 195
12899
12952
  },
12900
12953
  "name": "partitionIndexes",
12901
12954
  "optional": true,
@@ -12916,7 +12969,7 @@
12916
12969
  "immutable": true,
12917
12970
  "locationInModule": {
12918
12971
  "filename": "lib/table-base.ts",
12919
- "line": 210
12972
+ "line": 220
12920
12973
  },
12921
12974
  "name": "partitionKeys",
12922
12975
  "optional": true,
@@ -12937,7 +12990,7 @@
12937
12990
  "immutable": true,
12938
12991
  "locationInModule": {
12939
12992
  "filename": "lib/table-base.ts",
12940
- "line": 215
12993
+ "line": 225
12941
12994
  },
12942
12995
  "name": "storageParameters",
12943
12996
  "optional": true,
@@ -12958,7 +13011,7 @@
12958
13011
  "datatype": true,
12959
13012
  "docs": {
12960
13013
  "stability": "experimental",
12961
- "example": "// The code below shows an example of how to instantiate this type.\n// The values are placeholders you should change.\nimport * as glue_alpha from '@aws-cdk/aws-glue-alpha';\n\ndeclare const database: glue_alpha.Database;\ndeclare const dataFormat: glue_alpha.DataFormat;\ndeclare const storageParameter: glue_alpha.StorageParameter;\nconst tableBaseProps: glue_alpha.TableBaseProps = {\n columns: [{\n name: 'name',\n type: {\n inputString: 'inputString',\n isPrimitive: false,\n },\n\n // the properties below are optional\n comment: 'comment',\n }],\n database: database,\n dataFormat: dataFormat,\n\n // the properties below are optional\n compressed: false,\n description: 'description',\n enablePartitionFiltering: false,\n partitionIndexes: [{\n keyNames: ['keyNames'],\n\n // the properties below are optional\n indexName: 'indexName',\n }],\n partitionKeys: [{\n name: 'name',\n type: {\n inputString: 'inputString',\n isPrimitive: false,\n },\n\n // the properties below are optional\n comment: 'comment',\n }],\n storageParameters: [storageParameter],\n storedAsSubDirectories: false,\n tableName: 'tableName',\n};",
13014
+ "example": "// The code below shows an example of how to instantiate this type.\n// The values are placeholders you should change.\nimport * as glue_alpha from '@aws-cdk/aws-glue-alpha';\n\ndeclare const database: glue_alpha.Database;\ndeclare const dataFormat: glue_alpha.DataFormat;\ndeclare const storageParameter: glue_alpha.StorageParameter;\nconst tableBaseProps: glue_alpha.TableBaseProps = {\n columns: [{\n name: 'name',\n type: {\n inputString: 'inputString',\n isPrimitive: false,\n },\n\n // the properties below are optional\n comment: 'comment',\n }],\n database: database,\n dataFormat: dataFormat,\n\n // the properties below are optional\n compressed: false,\n description: 'description',\n enablePartitionFiltering: false,\n parameters: {\n parametersKey: 'parameters',\n },\n partitionIndexes: [{\n keyNames: ['keyNames'],\n\n // the properties below are optional\n indexName: 'indexName',\n }],\n partitionKeys: [{\n name: 'name',\n type: {\n inputString: 'inputString',\n isPrimitive: false,\n },\n\n // the properties below are optional\n comment: 'comment',\n }],\n storageParameters: [storageParameter],\n storedAsSubDirectories: false,\n tableName: 'tableName',\n};",
12962
13015
  "custom": {
12963
13016
  "exampleMetadata": "fixture=_generated"
12964
13017
  }
@@ -13079,6 +13132,31 @@
13079
13132
  "primitive": "boolean"
13080
13133
  }
13081
13134
  },
13135
+ {
13136
+ "abstract": true,
13137
+ "docs": {
13138
+ "default": "- The parameter is not defined",
13139
+ "remarks": "The key/value pairs that are allowed to be submitted are not limited, however their functionality is not guaranteed.",
13140
+ "see": "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-table-tableinput.html#cfn-glue-table-tableinput-parameters",
13141
+ "stability": "experimental",
13142
+ "summary": "The key/value pairs define properties associated with the table."
13143
+ },
13144
+ "immutable": true,
13145
+ "locationInModule": {
13146
+ "filename": "lib/table-base.ts",
13147
+ "line": 159
13148
+ },
13149
+ "name": "parameters",
13150
+ "optional": true,
13151
+ "type": {
13152
+ "collection": {
13153
+ "elementtype": {
13154
+ "primitive": "string"
13155
+ },
13156
+ "kind": "map"
13157
+ }
13158
+ }
13159
+ },
13082
13160
  {
13083
13161
  "abstract": true,
13084
13162
  "docs": {
@@ -13249,7 +13327,7 @@
13249
13327
  "datatype": true,
13250
13328
  "docs": {
13251
13329
  "stability": "experimental",
13252
- "example": "// The code below shows an example of how to instantiate this type.\n// The values are placeholders you should change.\nimport * as glue_alpha from '@aws-cdk/aws-glue-alpha';\nimport { aws_kms as kms } from 'aws-cdk-lib';\nimport { aws_s3 as s3 } from 'aws-cdk-lib';\n\ndeclare const bucket: s3.Bucket;\ndeclare const database: glue_alpha.Database;\ndeclare const dataFormat: glue_alpha.DataFormat;\ndeclare const key: kms.Key;\ndeclare const storageParameter: glue_alpha.StorageParameter;\nconst tableProps: glue_alpha.TableProps = {\n columns: [{\n name: 'name',\n type: {\n inputString: 'inputString',\n isPrimitive: false,\n },\n\n // the properties below are optional\n comment: 'comment',\n }],\n database: database,\n dataFormat: dataFormat,\n\n // the properties below are optional\n bucket: bucket,\n compressed: false,\n description: 'description',\n enablePartitionFiltering: false,\n encryption: glue_alpha.TableEncryption.S3_MANAGED,\n encryptionKey: key,\n partitionIndexes: [{\n keyNames: ['keyNames'],\n\n // the properties below are optional\n indexName: 'indexName',\n }],\n partitionKeys: [{\n name: 'name',\n type: {\n inputString: 'inputString',\n isPrimitive: false,\n },\n\n // the properties below are optional\n comment: 'comment',\n }],\n s3Prefix: 's3Prefix',\n storageParameters: [storageParameter],\n storedAsSubDirectories: false,\n tableName: 'tableName',\n};",
13330
+ "example": "// The code below shows an example of how to instantiate this type.\n// The values are placeholders you should change.\nimport * as glue_alpha from '@aws-cdk/aws-glue-alpha';\nimport { aws_kms as kms } from 'aws-cdk-lib';\nimport { aws_s3 as s3 } from 'aws-cdk-lib';\n\ndeclare const bucket: s3.Bucket;\ndeclare const database: glue_alpha.Database;\ndeclare const dataFormat: glue_alpha.DataFormat;\ndeclare const key: kms.Key;\ndeclare const storageParameter: glue_alpha.StorageParameter;\nconst tableProps: glue_alpha.TableProps = {\n columns: [{\n name: 'name',\n type: {\n inputString: 'inputString',\n isPrimitive: false,\n },\n\n // the properties below are optional\n comment: 'comment',\n }],\n database: database,\n dataFormat: dataFormat,\n\n // the properties below are optional\n bucket: bucket,\n compressed: false,\n description: 'description',\n enablePartitionFiltering: false,\n encryption: glue_alpha.TableEncryption.S3_MANAGED,\n encryptionKey: key,\n parameters: {\n parametersKey: 'parameters',\n },\n partitionIndexes: [{\n keyNames: ['keyNames'],\n\n // the properties below are optional\n indexName: 'indexName',\n }],\n partitionKeys: [{\n name: 'name',\n type: {\n inputString: 'inputString',\n isPrimitive: false,\n },\n\n // the properties below are optional\n comment: 'comment',\n }],\n s3Prefix: 's3Prefix',\n storageParameters: [storageParameter],\n storedAsSubDirectories: false,\n tableName: 'tableName',\n};",
13253
13331
  "custom": {
13254
13332
  "exampleMetadata": "fixture=_generated"
13255
13333
  }
@@ -13545,6 +13623,6 @@
13545
13623
  "symbolId": "lib/storage-parameter:WriteParallel"
13546
13624
  }
13547
13625
  },
13548
- "version": "2.116.1-alpha.0",
13626
+ "version": "2.118.0-alpha.0",
13549
13627
  "fingerprint": "**********"
13550
13628
  }
Binary file
package/LICENSE CHANGED
@@ -186,7 +186,7 @@
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
189
+ Copyright 2018-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
190
190
 
191
191
  Licensed under the Apache License, Version 2.0 (the "License");
192
192
  you may not use this file except in compliance with the License.
package/NOTICE CHANGED
@@ -1,2 +1,2 @@
1
1
  AWS Cloud Development Kit (AWS CDK)
2
- Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ Copyright 2018-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
package/README.md CHANGED
@@ -202,7 +202,10 @@ See [documentation](https://docs.aws.amazon.com/glue/latest/dg/encryption-securi
202
202
  A `Database` is a logical grouping of `Tables` in the Glue Catalog.
203
203
 
204
204
  ```ts
205
- new glue.Database(this, 'MyDatabase');
205
+ new glue.Database(this, 'MyDatabase', {
206
+ databaseName: 'my_database',
207
+ description: 'my_database_description',
208
+ });
206
209
  ```
207
210
 
208
211
  ## Table
@@ -263,6 +266,24 @@ new glue.S3Table(this, 'MyTable', {
263
266
  });
264
267
  ```
265
268
 
269
+ Glue tables can also be configured to contain user-defined table properties through the [`parameters`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-table-tableinput.html#cfn-glue-table-tableinput-parameters) property:
270
+
271
+ ```ts
272
+ declare const myDatabase: glue.Database;
273
+ new glue.S3Table(this, 'MyTable', {
274
+ parameters: {
275
+ key1: 'val1',
276
+ key2: 'val2',
277
+ },
278
+ database: myDatabase,
279
+ columns: [{
280
+ name: 'col1',
281
+ type: glue.Schema.STRING,
282
+ }],
283
+ dataFormat: glue.DataFormat.JSON,
284
+ });
285
+ ```
286
+
266
287
  ### Partition Keys
267
288
 
268
289
  To improve query performance, a table can specify `partitionKeys` on which data is stored and queried separately. For example, you might partition a table by `year` and `month` to optimize queries based on a time window: