Skip to content

Commit 3225687

Browse files
authored
Merge pull request #242 from nitrictech/feature/memory-support
2 parents fa1b788 + edaa871 commit 3225687

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

packages/common/src/stack/schema.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1572,6 +1572,7 @@ export const STACK_SCHEMA: JSONSchema7 = {
15721572
},
15731573
handler: { type: 'string' },
15741574
context: { type: 'string' },
1575+
memory: { type: 'number' },
15751576
excludes: {
15761577
type: 'array',
15771578
items: {
@@ -1612,6 +1613,7 @@ export const STACK_SCHEMA: JSONSchema7 = {
16121613
properties: {
16131614
dockerfile: { type: 'string' },
16141615
context: { type: 'string' },
1616+
memory: { type: 'number' },
16151617
args: {
16161618
type: 'object',
16171619
additionalProperties: { type: 'string' },

packages/common/src/types/compute/unit.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ export interface NitricComputeUnit<Ext extends Record<string, any> = never> {
2020
context?: string;
2121
// Triggers used to invoke this compute unit, e.g. Topic Subscriptions
2222
triggers?: NitricComputeUnitTriggers;
23+
// The memory of the compute instance in MB
24+
memory?: number;
2325
// The minimum number of instances to keep alive
2426
minScale?: number;
2527
// The maximum number of instances to scale to

packages/plugins/aws/src/resources/compute.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@ interface NitricComputeAwsLambdaArgs {
3232
*/
3333
topics: NitricSnsTopic[];
3434

35-
/**
36-
* The amount of provisioned memory
37-
* defaults to 128
38-
*/
39-
memory?: pulumi.Input<number>;
40-
4135
/**
4236
* The timeout for the func in seconds
4337
* defaults to 15
@@ -55,7 +49,8 @@ export class NitricComputeAWSLambda extends pulumi.ComponentResource {
5549
constructor(name, args: NitricComputeAwsLambdaArgs, opts?: pulumi.ComponentResourceOptions) {
5650
super('nitric:func:AWSLambda', name, {}, opts);
5751

58-
const { source, image, topics, timeout = 15, memory = 128 } = args;
52+
const { source, image, topics, timeout = 15 } = args;
53+
const { memory = 128 } = source.getDescriptor();
5954
const defaultResourceOptions: pulumi.ResourceOptions = { parent: this };
6055

6156
this.name = source.getName();

0 commit comments

Comments
 (0)