不支持在GCS存储桶中复制客户kms加密对象,并且不支持Cloud KMS操作

时间:2019-03-22 16:19:31

标签: google-cloud-python

尝试使用Google Cloud Client python复制带有以下代码的kms加密对象,失败google.api_core.exceptions.BadRequest: 400 POST https://www.googleapis.com/storage/v1/b/source-bucket/file/copyTo/b/target-bucket/o/file.new: Operation with Cloud KMS is not supported.

    source_bucket = storage_client.get_bucket(bucket_name)
    source_blob = source_bucket.blob(blob_name)
    destination_bucket = storage_client.get_bucket(new_bucket_name)

    new_blob = source_bucket.copy_blob(
        source_blob, destination_bucket, new_blob_name)```

The service account has Cloud KMS CryptoKey Encrypter/Decrypter role and Storage Object Creator role. 

0 个答案:

没有答案