aldy120 / s3-note

Note for Amazon S3
0 stars 0 forks source link

MalformedPolicy error when update S3 policy. #12

Open aldy120 opened 4 years ago

aldy120 commented 4 years ago

MalformedPolicy error when update S3 policy

Error Invalid principal in policy

Screen Shot 2020-05-07 at 4 36 24 PM
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>MalformedPolicy</Code><Message>Invalid principal in policy</Message><Detail>"AWS" : "arn:aws:iam::325227931631:user/chenlich"</Detail><RequestId>BEF4A4FFB18F1FDC</RequestId><HostId>ydUcH9UNHfW8vBQyM7IiVZ9G1onNhDgcYIic6DTC+T4LMvZPJlP3PVikaIcyPKtj42m1cKZRMXE=</HostId></Error>

Why

The principal might be wrong. https://aws.amazon.com/premiumsupport/knowledge-center/s3-invalid-principal-in-policy-error/

If you grant another account, but that account is not enable this new opt-in region (e.g. HongKong), the error shows. For example, the account 325227931631 doesn't enable HongKong region.