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 environment to aws.serverless.Function #254

Merged
merged 1 commit into from
Jul 17, 2018

Conversation

jen20
Copy link
Contributor

@jen20 jen20 commented Jun 30, 2018

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.

@ellismg
Copy link
Contributor

ellismg commented Jun 30, 2018

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}
Copy link
Contributor

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,
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@jen20 jen20 force-pushed the serverless-function-environment branch from ca04bd1 to e292d58 Compare July 5, 2018 07:47
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.
@jen20 jen20 force-pushed the serverless-function-environment branch from e292d58 to d521986 Compare July 14, 2018 18:39
@jen20
Copy link
Contributor Author

jen20 commented Jul 14, 2018

I've pushed a new commit here which includes the generated code to fix the CI build.

@joeduffy
Copy link
Member

@lukehoban , looks like @jen20 addressed the CR. Shall we merge this in time to make our next package release tomorrow?

Copy link
Contributor

@lukehoban lukehoban left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@lukehoban lukehoban merged commit a47acc6 into pulumi:master Jul 17, 2018
@jen20 jen20 deleted the serverless-function-environment branch July 17, 2018 03:30
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.

4 participants