I am trying to follow the aws lambda tutorial, currenty at: https://docs.aws.amazon.com/lambda/latest/dg/with-s3-example.html
I am on the step to "add permissions to the function policy"
It says to: " Run the following Lambda CLI add-permission command to grant Amazon S3 service principal (s3.amazonaws.com) permissions to perform the lambda:InvokeFunction action. Note that permission is granted to Amazon S3 to invoke the function only if the following conditions are met:
An object-created event is detected on a specific bucket.
The bucket is owned by your account. If you delete a bucket, it is possible for another account to create a bucket with the same ARN. "
and then it gives a command line command to enter:
aws lambda add-permission --function-name CreateThumbnail --principal s3.amazonaws.com --statement-id s3invoke --action "lambda:InvokeFunction" --source-arn arn:aws:s3:::sourcebucket --source-account account-id
I do not own the bucket I want to trigger on. It is an already established bucket set up by my company and I've been tasked with learning lambda and triggering when a file is uploaded to it.
How do I get the account id to use and can I use an account id other than my own in that command?
Also, is the sourcebucket arn always "arn:aws:s3:::?" Is it diplayed somewhere?