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

Configuration error: at 'provider.iam.role.statements.1.Action.0': must be string #120

Open
hari5udhan opened this issue Nov 23, 2022 · 1 comment

Comments

@hari5udhan
Copy link

provider:
name: aws
runtime: nodejs12.x
stage: dev
region: ap-south-1
iam:
role:
statements:
- Effect: Allow
Action:
- excute-api:Invoke
Resource: arn:aws:execute-api:::*
- Effect: Allow
Action:
- dynamodb: UpdateItem
- dynamodb: PutItem
Resource: arn:aws*****************

Console Error is
Error:
Configuration error:
at 'provider.iam.role.statements.1.Action.0': must be string
at 'provider.iam.role.statements.1.Action.1': must be string

Learn more about configuration validation here: http://slss.io/configuration-validation

@henhal
Copy link

henhal commented Apr 17, 2023

IAM actions are on the form service:action. In your example however, you have a space after the colon, making this into an object per the YAML specification. If converting your YAML to JSON, you would see that it has become:

"action": [{"dynamodb": "UpdateItem"}, {"dynamodb": "PutItem"}]

instead of

"action": ["dynamodb:UpdateItem", "dynamodb:PutItem"]

Removing the space should do the trick.

Action:
  - dynamodb:UpdateItem
  - dynamodb:PutItem

Sometimes it's also wise to quote strings containing special characters in YAML.

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

2 participants