Step 4: (Optional) Create a trigger to schedule the export job - Amazon Keyspaces (for Apache Cassandra)
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Step 4: (Optional) Create a trigger to schedule the export job

To run the export job created in the previous step on a regular basis, you can create a scheduled trigger. For more information, see Amazon Glue triggers in the Amazon Glue Developer Guide.

Schedule a Amazon Glue job
  1. The following Amazon CLI command is an example of a simple trigger with the name KeyspacesExportWeeklyTrigger that runs the Amazon Glue job with the name AmazonKeyspacesExportToS3-cfn-setup-cfn-glue once per week on Monday at 12:00 UTC.

    aws glue create-trigger \ --name KeyspacesExportWeeklyTrigger \ --type SCHEDULED \ --schedule "cron(0 12 ? * MON *)" \ --start-on-creation \ --actions '[{ "JobName": "AmazonKeyspacesExportToS3-cfn-setup-cfn-glue" }]'
    • To override any of the default settings of the scheduled job, you can pass them as arguments. In this example we override the keyspace name, the table name, the number of workers, and the worker type by passing them as arguments. The following command is an example of this.

      aws glue create-trigger \ --name KeyspacesExportWeeklyTrigger \ --type SCHEDULED \ --schedule "cron(0 12 ? * MON *)" \ --start-on-creation \ --actions '[{ "JobName": "AmazonKeyspacesExportToS3-cfn-setup-cfn-glue", "Arguments": { "--number-of-workers": "8", "--worker-type": "G.2X"}, "--table_name": "my_table", "--keyspace_name": "my_keyspace" }]'
  2. To confirm that the trigger has been created, use the following command.

    aws glue list-triggers

    The output of the command should look similar to this.

    { "TriggerNames": [ "KeyspacesExportWeeklyTrigger" ] }

To clean up the Amazon resources created in this tutorial, proceed to Step 5: (Optional) Cleanup.