Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing s3 policy for lambda typescript tutorial #21

Open
slnowak opened this issue May 16, 2022 · 0 comments
Open

Missing s3 policy for lambda typescript tutorial #21

slnowak opened this issue May 16, 2022 · 0 comments

Comments

@slnowak
Copy link
Contributor

slnowak commented May 16, 2022

Hi,
I've been trying to port the typescript lambda tutorial (https://pulumi.awsworkshop.io/40_lambda_microservices_ts/20_getting_started_with_pulumi.html) to java and encountered some issues during the process.

There seems to be some permission issues - my thumbnailer lambda was not able to manipulate s3 bucket without explicitly adding the following policy:

            var s3AccessPolicy = new Policy("lambdaS3Access", PolicyArgs.builder()
                    .policy(bucket.arn().applyValue(buketArn -> """
                            {
                              "Version": "2012-10-17",
                              "Statement": [
                                {
                                  "Effect": "Allow",
                                  "Action": "s3:*",
                                  "Resource": ["%s", "%s/*"]
                                }
                              ]
                            }""".formatted(buketArn, buketArn)))
                    .build());

So basically, I needed to grant explicit access to both the bucket and all the elements of the bucket and aws.iam.ManagedPolicy.LambdaFullAccess was not enough to cover this.

Can anyone please check if this particular example actually works as it is?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant