在 AWS Glue 作业中写入 S3 时是否可以指定 SSE:KMS 密钥 ID?

Ste*_*ger 4 amazon-web-services amazon-kms aws-glue

如果您按照 AWS Glue 添加作业向导创建一个脚本以将 parquet 文件写入 S3,您最终会生成类似这样的代码。

datasink4 = glueContext.write_dynamic_frame.from_options(
    frame=dropnullfields3,
    connection_type="s3",
    connection_options={"path": "s3://my-s3-bucket/datafile.parquet"},
    format="parquet",
    transformation_ctx="datasink4",
)
Run Code Online (Sandbox Code Playgroud)

是否可以指定KMS密钥,以便数据在存储桶中加密?

Nat*_*lia 5

胶水 scala 作业

val spark: SparkContext = new SparkContext()
val glueContext: GlueContext = new GlueContext(spark)
spark.hadoopConfiguration.set("fs.s3.enableServerSideEncryption", "true")
spark.hadoopConfiguration.set("fs.s3.serverSideEncryption.kms.keyId", args("ENCRYPTION_KEY"))
Run Code Online (Sandbox Code Playgroud)

我认为 Python 的语法应该不同,但想法是一样的