sforman
06/23/2022, 9:39 AMconst bucket = new Bucket(stack, 'translation', {
removalPolicy: stack.stage === 'dev' ? RemovalPolicy.DESTROY : RemovalPolicy.RETAIN
});
const api = new Api(stack, 'api', {
routes: {
'GET /healthcheck': 'functions/lambda.healthcheck',
'POST /notification': 'functions/lambda.notification'
},
// I WOULD IMAGINE THE SAME enviroment property could go here
// BUT IT DOESN'T ALLOW IT (doesn't exist) and the two endpoints using
// process.env.TRANSLATION_BUCKET_NAME returns undefined.
});
const translations = new Function(stack, 'download-translations', {
handler: 'functions/translations.download',
environment: {
TRANSLATION_BUCKET_NAME: bucket.bucketName // THIS SECTION WORKS FOR THIS FUNCTION, but doesn't work on the API enpoints
}
});
Can someone spot my mistake?sforman
06/23/2022, 9:44 AMdefaults: {
function {
environment: {
// env goes here.
} } }
Just needed to ask out loud xD