constructs
constructs copied to clipboard
How to include some files/folders in packagePhpCode?
Its currently possible to include files/folders which parent folder is excluded in CDK?
(include key is not valid)
const phpFpm = new PhpFpmFunction(this, 'web', {
phpVersion: '8.4',
handler: 'public/index.php',
code: packagePhpCode(undefined, {
exclude: ['public/assets'],
include: ['public/assets/build/manifest.json'],
}),
});
Working example in serverless.yml
package:
patterns:
# Excluded files and folders for deployment
- '!public/**'
# If you want to include files and folders that are part of excluded folders,
# add them at the end
- 'public/assets/build/entrypoints.json'
- 'public/assets/build/manifest.json'
Maybe is not possible because official AWS CDK don't have this option
https://docs.aws.amazon.com/cdk/api/v1/docs/@aws-cdk_aws-s3-assets.AssetOptions.html
Yes (IIRC) 😕 I think there's an open issue in the CDK repository.