我需要两个来源访问身份云前端(和S3)。 一个只能查看内容,另一个只能放内容(也许另一个只能删除)
我知道我可以创build一个Origin访问身份,并且在我的S3策略中,我可以指定哪个身份拥有多less访问权限。
但是,在签署url时,我没有看到select这个身份的选项。 我正在使用的PHP代码:
$customPolicy = <<<POLICY { "Version":"2012-10-17", "Statement":[ { "Sid":"statement1", "Effect":"Allow", "Action":[ "s3:CreateBucket", "s3:ListAllMyBuckets", "s3:GetBucketLocation" ], "Resource":[ "arn:aws:s3:::*" ] } ] } POLICY; // Create a signed URL for the resource using the canned policy $signedUrlCannedPolicy = $cloudFront->getSignedUrl([ 'url' => $streamHostUrl . '/' . $resourceKey, 'private_key' => base_path().'/'.'cloudfront.pem', 'key_pair_id' => 'my key pair id', 'policy' => $customPolicy ]);
如何告诉谁代表谁签字? 我在http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-trusted-signers.html#private-content-creating-cloudfront-key-pairs上创build了云端的密钥对。