Write the syntax to connect to an S3 bucket in PySpark.
Asked in the Technical interview stage. Implement build_s3_connection to return the s3a:// path and Hadoop configuration needed by a Spark session. Use the S3A filesystem, the supplied credentials, and the supplied AWS region.
The function receives four strings: bucket name, access key, secret key, and region. Return a dictionary containing path and config.
def build_s3_connection(bucket, access_key, secret_key, region):