以下を満たすS3バケットのアクセス許可のポリシーの書き方を教えてください。
- Pythonでupload_file() を使いアップロード: 特定のIPアドレスを持つPCからのみ許可
- API Gateway REST APIでPOST: 全て許可
以下のような書き方では、API Gatewayからのアクセスが不可能でした。
{
"Version": "2012-10-17",
"Statement": {
"Effect": "Deny",
"Action": "",
"Resource": "",
"Condition": {
"NotIpAddress": {
"aws:SourceIp": [
"x.x.x.x/xx"
]
},
"Bool": {"aws:ViaAWSService": "false"}
}
}
}