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

Global Role Name is not in expected format #100

Open
ghost opened this issue Jan 26, 2022 · 1 comment
Open

Global Role Name is not in expected format #100

ghost opened this issue Jan 26, 2022 · 1 comment

Comments

@ghost
Copy link

ghost commented Jan 26, 2022

I have the following serverless.yml (snippet)

  iam:
    role:
      name: ${self:provider.stage}-${self:service.name}-default-role
      statements:
        - Effect: Allow
          Action:
            - ssm:GetParameter
            - ssm:GetParameters
          Resource:
            - !Sub "arn:aws:ssm:${self:provider.region}:${AWS::AccountId}:parameter/${self:provider.stage}/*"

And when trying to deploy I get:

ERROR: Global Role Name is not in expected format. Got name: "test-rest-ra-gui-apis-default-role"

This used to work up until some time ago (maybe I updated serverless or the plugin inadvertently)

Looking at the source code it's doing:

    const roleName = this.serverless.providers.aws.naming.getRoleName();
    const fnJoin = roleName['Fn::Join'];

And checking some things on fnJoin, which puzzles me because I didn't find in the documentation any reference to it

Any clues?

Thanks

@juantula
Copy link

The problem happens when the function has iamRoleStatements value set (even an empty array). To avoid the issue, you also need to specify a value in iamRoleStatementsName.

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