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

Imported Roles are not found when deploying serverless functions #12238

Open
4 tasks done
DevaP11 opened this issue Nov 7, 2023 · 1 comment
Open
4 tasks done

Imported Roles are not found when deploying serverless functions #12238

DevaP11 opened this issue Nov 7, 2023 · 1 comment

Comments

@DevaP11
Copy link

DevaP11 commented Nov 7, 2023

Are you certain it's a bug?

  • Yes, it looks like a bug

Is the issue caused by a plugin?

  • It is not a plugin issue

Are you using the latest v3 release?

  • Yes, I'm using the latest v3 release

Is there an existing issue for this?

  • I have searched existing issues, it hasn't been reported yet

Issue description

Importing roles like this does not allow the deployment of functions like 'sls deploy -f functionName'.
{ 'Fn::ImportValue': '***-LambdaAccessRole' }

This is because there is no way to access imported function roles
The fix can be added in
serverless/lib/plugins/aws/deploy-function.js:146:35

Screenshot 2023-11-07 at 11 34 03 AM

Service configuration (serverless.yml) content

N/A

Command name and used flags

sls deploy -f functionName

Command output

TypeError: Cannot read properties of undefined (reading '0')
    at AwsDeployFunction.normalizeArnRole (/Users/**/**/**/**/**/**/node_modules/serverless/lib/plugins/aws/deploy-function.js:146:35)
    at AwsDeployFunction.updateFunctionConfiguration

Environment information

Tried with sls versions 3.23 and 3.36 (latest)
@TimTimT
Copy link

TimTimT commented Feb 23, 2024

I tried a similar fix, but this does not work for me, presumably because I use a reference to the ARN, and not to the role name. (#12372)
Perhaps your fix works because the name of the reference is the same as the name of the role.

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