v1.0.1
Fixes an issue where the functionOptions
attribute from the gatsbyFunctionOptions
callback was not being passed to the Lambda Function construct. This fix allows arbitrary Lambda attributes to be passed to the construct, without needing to add every possible variation into the GatsbySite construct.
For example, you can now provide environment variables like this.
new GatsbySite(this, "GatsbySite", {
gatsbyDir: "./site",
distribution: { cachePolicy },
gatsbyFunctionOptions: (fn) => {
return {
target: "LAMBDA",
functionOptions: {
environment: {
foo: "bar",
},
},
};
},
});
And Lambda layers like this.
const secretsLayer = lambda.LayerVersion.fromLayerVersionArn(
this,
"SecretsLayer",
"arn:aws:lambda:ap-southeast-2:665172237481:layer:AWS-Parameters-and-Secrets-Lambda-Extension:11",
)
new GatsbySite(this, "GatsbySite", {
gatsbyDir: "./site",
distribution: { cachePolicy },
gatsbyFunctionOptions: (fn) => {
return {
target: "LAMBDA",
functionOptions: {
environment: {
layers: [secretsLayer],
},
},
};
},
});
- docs: add gssumesh to contributors ed81263
- fix: pass function options into lambda construct ae1e573
- chore: remove function options from cdk example ec5b77b
- feat: support for environment variables and layers within gatsby functions (#37) ec467f7
- docs: add contributors section a500517
- build: upgrade typescript-eslint and flat config 4965019