Skip to content

Commit

Permalink
Add environment to aws.serverless.Function
Browse files Browse the repository at this point in the history
This is targeted fix to add an environment variable map to the
`aws.serverless.Function` type, as an interim step to allowing it to
conigure all facets of a Lambda function.
  • Loading branch information
jen20 committed Jul 14, 2018
1 parent 44eed4b commit d521986
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions overlays/nodejs/serverless/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ export interface FunctionOptions {
securityGroupIds: pulumi.Input<string[]>,
subnetIds: pulumi.Input<string[]>,
};
/**
* The Lambda environment's configuration settings.
*/
environment?: pulumi.Input<{ variables?: pulumi.Input<{[key: string]: pulumi.Input<string>}> }>;
/**
* The paths relative to the program folder to include in the Lambda upload. Default is `[]`.
*/
Expand Down Expand Up @@ -169,6 +173,7 @@ export class Function extends pulumi.ComponentResource {
code: new pulumi.asset.AssetArchive(codePaths),
handler: serializedFileName + "." + handlerName,
runtime: options.runtime || lambda.NodeJS8d10Runtime,
environment: options.environment,
role: this.role.arn,
timeout: options.timeout === undefined ? 180 : options.timeout,
memorySize: options.memorySize,
Expand Down
5 changes: 5 additions & 0 deletions sdk/nodejs/serverless/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ export interface FunctionOptions {
securityGroupIds: pulumi.Input<string[]>,
subnetIds: pulumi.Input<string[]>,
};
/**
* The Lambda environment's configuration settings.
*/
environment?: pulumi.Input<{ variables?: pulumi.Input<{[key: string]: pulumi.Input<string>}> }>;
/**
* The paths relative to the program folder to include in the Lambda upload. Default is `[]`.
*/
Expand Down Expand Up @@ -169,6 +173,7 @@ export class Function extends pulumi.ComponentResource {
code: new pulumi.asset.AssetArchive(codePaths),
handler: serializedFileName + "." + handlerName,
runtime: options.runtime || lambda.NodeJS8d10Runtime,
environment: options.environment,
role: this.role.arn,
timeout: options.timeout === undefined ? 180 : options.timeout,
memorySize: options.memorySize,
Expand Down

0 comments on commit d521986

Please sign in to comment.