I have a S3 bucket read policy :
{
"Version":"2012-10-17",
"Statement":[
{
"Effect":"Allow",
"Action":["s3:GetObject"],
"Resource":["arn:aws:s3:::examplebucket/*"]
}
]
}
Based on a cloud trail logs when new bucket is created , I am creating an event which will invoke a Lambda function.
Able to read json for the policy and add a new resource (bucket) to the same policy. Is there a direct python API to be invoked which will update an existing IAM policy with new resource ?
foo-24) and grant the Lambda function permission to accessfoo-*. You then won't have to modify the permissions each time. Or, since you're always adding permissions for every new bucket, just grant it access to every bucket in the first place and you won't have to modify the policy.