brefphp / laravel-bridge

Package to use Laravel on AWS Lambda with Bref
https://bref.sh/docs/frameworks/laravel.html
MIT License
314 stars 63 forks source link

How can I set iamRolePolicies for function declared in constructs? #63

Closed hanachan1026 closed 2 years ago

hanachan1026 commented 2 years ago

I'm using bref-php & serverless-lift & laravel-bridge library for SQS + Lambda functions, and I see that iamRoleStatement is not attached to functions declared in constructs.

constructs:
  sqs_function1:
    type: queue
    worker:
      handler: worker.php
      timeout: 600
      layers:
        - ${bref:layer.php-80}
      vpc:
        securityGroupIds:
          - sg-xxxx
        subnetIds:
          - subnet-xxxx
          - subnet-xxxx
      iamRoleStatements:
        - Effect: "Allow"
          Action:
            - "s3:*"
            - "s3-object-lambda:*"
          Resource: "*"

I tried like above but I couldn't make it & I couldn't find the documentation about this.

hanachan1026 commented 2 years ago

Actually I found out inline policy is attached to constructs' functions also