1
我目前正在尝试访问另一个VPC中的S3文件,并且我能够成功。但是当文件进入时,它们全部仍然是加密的。AWS S3文件跨账户不解密
我有VPC A中的机器尝试读取VPC B中的S3文件。这些文件在VPC B中转到存储桶时进行了服务器端加密。我成功承担了角色并让文件来自S3存储桶VPC B到VPC A.但是,我的机器中的VPC A中的文件应该以json形式进入,但似乎仍然是加密的。
当我有机器在VPC A读取服务器端加密文件从VPC A中的S3存储桶,那么我没有这个问题。这些文件似乎被自动解密。
通过CLI命令的命令看起来类似于这样(在VPC A):
aws sts assume-role --role-arn ROLEARN --role-session-name s3-cloudtrail-access
aws s3 cp s3://LOCATIONOFFILE.json.gz test.json.gz --profile crossaccountrole
在Java SDK是这样的(在VPC A):
ClientConfiguration config = new ClientConfiguration();
AWSSecurityTokenService securityTokenService = new AWSSecurityTokenServiceClient(config);
AssumeRoleResult assumeRoleResult = securityTokenService.assumeRole(new AssumeRoleRequest()
.withRoleArn(roleArn).withDurationSeconds(3600)
.withRoleSessionName("s3-cloudtrail-access"));
Credentials stsCredentials = assumeRoleResult.getCredentials();
System.out.println("stsCredentials: " + stsCredentials);
AWSSessionCredentials tempCredentials = new BasicSessionCredentials(
stsCredentials.getAccessKeyId(), stsCredentials.getSecretAccessKey(),
stsCredentials.getSessionToken()
);
AmazonS3 tempClient = new AmazonS3Client(tempCredentials, config);
tempClient.getObject(
new GetObjectRequest(horizBucketName, horizFileNameInS3),
new File("/home/ec2-user/test-horiz.json.gz")
);
任何想法我如何确保在解密的VPC之间生成文件?
最佳, 可人