Aws_glue_script - how to output to S3?

The bare minimum description of this topic leaves much to be desired. I would like to use aws_glue_script to take the data from the glue catalog database and put it out as a CSV file on a S3 bucket.

The DataSink4 configuration needs to be like this (from a python script @

##Write Dynamic Frames to S3 in CSV format. You can write it to any rds/redshift, by using the connection that you have defined previously in Glue

datasink4 = glueContext.write_dynamic_frame.from_options(frame = dynamic_dframe, connection_type = “s3”, connection_options = {“path”: “s3://glueuserdata”}, format = “csv”, transformation_ctx = “datasink4”)

I don’t see any way to do dynamic frames in terriform. Any ideas? Thanks