proud-lawyer-63233
01/13/2020, 3:14 PMendpoint.url
) as an environment variable within the Lambda. However, the lambda is created at a point where I don't yet have the API gateway url. How might I get around this?
const myLambda = new aws.lambda.Function("my-handler", {
runtime: aws.lambda.Python3d7Runtime,
code: new pulumi.asset.FileArchive("my-package.zip"),
handler: "handler.lambda_handler",
environment: {
variables: {
ENV_VARIABLE_1: 'foo',
},
},
})
const endpoint = new awsx.apigateway.API("my-gateway", {
routes: [{
path: "/{proxy+}",
method: "ANY",
eventHandler: aws.lambda.Function.get("my-lambda", myLambda.id),
}],
})
white-balloon-205
01/13/2020, 5:10 PMAPI
helper creates both the rest api and the routes at once, I don’t believe there is any way to break this cycle currently. You would need to do something like use an additional data store for this - like parameter store or s3 or dynamodb.
If you wouldn’t mind opening an issue on this - it’s come up a couple times recently - and would be good to look into ways to enable it more seamlessly.