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

Add inputs.roleArn for existing lambda role #827

Merged
merged 4 commits into from
Dec 2, 2020

Conversation

huksley
Copy link
Contributor

@huksley huksley commented Dec 1, 2020

Allows to specify ARN of existing role instead of creating a new one.

myNextApplication:
  component: "@sls-next/serverless-component@{version_here}"
  inputs:
    roleArn: "arn:aws:iam::123456789012:role/MyCustomLambdaRole"
  • Added to README.md
  • Added unit test to packages/serverless-components/nextjs-component/tests/custom-inputs.test.ts

@codecov
Copy link

codecov bot commented Dec 1, 2020

Codecov Report

Merging #827 (427a5a8) into master (178de25) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #827      +/-   ##
==========================================
+ Coverage   80.65%   80.68%   +0.02%     
==========================================
  Files          57       57              
  Lines        1933     1936       +3     
  Branches      431      434       +3     
==========================================
+ Hits         1559     1562       +3     
  Misses        314      314              
  Partials       60       60              
Impacted Files Coverage Δ
...ges/serverless-components/aws-lambda/serverless.js 73.84% <100.00%> (+0.40%) ⬆️
...rless-components/nextjs-component/src/component.ts 90.78% <100.00%> (+0.12%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 178de25...427a5a8. Read the comment docs.

Copy link
Collaborator

@dphang dphang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just ran e2e test to check regressions: https://github.com/serverless-nextjs/serverless-next.js/actions/runs/395679068, can merge after

@dphang dphang merged commit f63bc76 into serverless-nextjs:master Dec 2, 2020
@Arditc
Copy link

Arditc commented Dec 6, 2020

@dbhagen Just one question regarding this, why aren't we following the same approach of the lambda name?, for constancy and giving the lambda the correct roles:

  roleArn:
      defaultLambda: arn
      apiLambda: arn

The reason I say this is because I wouldn't want to give the defaultLambda access to the database.

I've raised an issue here: #836

@huksley
Copy link
Contributor Author

huksley commented Dec 7, 2020

Yes, this can be improved if needed @Arditc. I.e use one role if specified directly or use specific roles per lambda if specified as a map as per syntax you show in example.

@huksley huksley deleted the role-arn branch December 7, 2020 09:03
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

Successfully merging this pull request may close these issues.

3 participants