-
Hello guys 👐 We're using Nitric in production, deployed on the AWS. (works well, cool!) Now we have an issue: sometimes we want to be able to change the For users, when using other solutions, there are generally the following ways to change:
Thanks to everyone for each reply. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
@unix we do have this issue: #245 to add function level configuration. It would probably make sense to be included in that. |
Beta Was this translation helpful? Give feedback.
-
@unix glad you like it! This is definitely something we want to add to the framework 👍 and have been thinking through some ideas on the best way to implement this. I think using the stack files would be elegant as they could contain configuration specific to each provider we support without introducing common abstractions between them. I think it would be good for each function in a stack to be individually configurable with their own requirements as well, I'd like to get your thoughts on how you think this could be mapped. Using patterns like we do in the main Example stack file: name: aws
provider: aws
region: us-east-1
config:
# default function specs
default:
memory: 256
timeout: 15
# small function specs
functions/*.sm.ts:
memory: 128
timeout: 10
# medium function specs
functions/*.md.ts:
memory: 512
timeout: 30
# large function specs
functions/*.lg.ts:
memory: 1024
timeout: 60 Another consideration is whether common configuration could be included as part of our application framework. This is less clean and comes with some quirks and challenges when abstracting between providers and setting different requirements by environment. import { config } from '@nitric/sdk';
config({
memory: 128,
timeout: 10
}); |
Beta Was this translation helpful? Give feedback.
@unix This was released today in v1.9.0 of the CLI. We still need to finalise documentation for this feature.
The implementation is similar to the above with the exception that pattern matching is not implemented. So to set the memory and timeout of a specific function you need to give the path for the function:
For example:
Let us know if you encounter any issues with this, or if you have other configuration requirements for your resources.