-
Notifications
You must be signed in to change notification settings - Fork 156
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 environment
to aws.serverless.Function
#254
Add environment
to aws.serverless.Function
#254
Conversation
Thanks for the patch, @jen20. The Travis build is red due to some infrastructure issues on our end. I'm working on fixing them up. |
/** | ||
* The Lambda environment's configuration settings. | ||
*/ | ||
environment?: {[key: string]: string} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We haven't been consistent about this in other types here, but you could make this flexible to use with outputs from other Pulumi resources by using the same type (with pulumi.Input
at each layer) as on the underlying aws.lambda.FunctionArgs
:
environment?: pulumi.Input<{ variables?: pulumi.Input<{[key: string]: pulumi.Input<string>}> }>;
// Create the Lambda Function. | ||
this.lambda = new lambda.Function(name, { | ||
code: new pulumi.asset.AssetArchive(codePaths), | ||
handler: serializedFileName + "." + handlerName, | ||
runtime: options.runtime || lambda.NodeJS8d10Runtime, | ||
environment: options.environment, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that you'll either need to make the options.environment
use the nested variables
property as on the underlying aws.lambda.FunctionArgs
, or you will need to pass the options.environment
as the variables
property of this object.
Probably worth aligning with aws.lambda.FunctionArgs
, which will require changing the signature above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the signature above, so this should no longer apply.
ca04bd1
to
e292d58
Compare
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.
e292d58
to
d521986
Compare
I've pushed a new commit here which includes the generated code to fix the CI build. |
@lukehoban , looks like @jen20 addressed the CR. Shall we merge this in time to make our next package release tomorrow? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
This is targeted fix to add an environment variable map to the
aws.serverless.Function
type, as an interim step to allowing it to configure all facets of a Lambda function.