question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Configuration warning at 'functions.import': unrecognized property 'iamRoleStatementsInherit'

See original GitHub issue
> serverless deploy --verbose
Serverless: Configuration warning at 'functions.import': unrecognized property 'iamRoleStatementsInherit'
Serverless:  
Serverless: Learn more about configuration validation here: http://slss.io/configuration-validation
Serverless:  
serverless -v
Framework Core: 2.11.1
Plugin: 4.1.2
SDK: 2.3.2
Components: 3.3.0
  "devDependencies": {
    "serverless-iam-roles-per-function": "^2.0.2"
  },

serverless.yml

plugins:
  - serverless-iam-roles-per-function # Define IAM roles per function

...

  iamRoleStatements:
    - Effect: Allow
      Action:
        - dynamodb:Query
        - dynamodb:Scan
        - dynamodb:GetItem
        - dynamodb:PutItem
        - dynamodb:UpdateItem
        - dynamodb:DeleteItem
      Resource: "arn:aws:dynamodb:${self:provider.region}:*:table/${self:provider.environment.IMPORTER_DYNAMODB_TABLE}"

...

functions:
  import:
    handler: handlers/import.handler
    iamRoleStatementsInherit: true
    iamRoleStatements:
      - Effect: "Allow"
        Action:
          - s3:GetObject
          - s3:PutObject 
        Resource:
          - Fn::Join:
            - ""
            - - !GetAtt ImporterS3Bucket.Arn
              - "/*"

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

8reactions
Enasecommented, Apr 17, 2021

@prachi24cross7 It’s expected behaviour. Serverless informs you that iamRoleStatements won’t be supported in version 3.

In order to fix it replace:

provider:
   iamRoleStatements
        - your statements here

with

provider:
  iam:
    role:
      statements:
        - your statements here
3reactions
glichtcommented, Nov 28, 2020

@BartusZak @tcastelli @davidfells @wujekbogdan can you try using version 3.0.1. Installing it by running:

npm install --save-dev serverless-iam-roles-per-function@next

It contains the a fix #63 from @Enase which may help

Read more comments on GitHub >

github_iconTop Results From Across the Web

Serverless IAM Roles Per Function Plugin
A Serverless plugin to easily define IAM roles per function via the use of iamRoleStatements at the function definition block.
Read more >
Serverless: Configuration error at root: unrecognized property ...
This is just a bug with the package serverless-step-functions. This can be resolved by updating the library :) "serverless-step-functions": ...
Read more >
serverless-iam-roles-per-function - npm
A Serverless plugin to define IAM Role statements as part of the function definition block. Latest version: 3.2.0, last published: 2 years ...
Read more >
iamRoleStatements should be an array of objects - Seed.run
Specifically, statement 0 is missing the following properties: Resource. ... An IAM role statement block in your serverless.yml should have Effect , Action ......
Read more >
Serverless Framework: Defining Per-Function IAM Roles
Separate IAM roles per Lambda function are key for achieving a least privilege setup. We've recently released a new serverless plugin to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found