re:Web for PHP + nginx in the Serverless Application Repository
Posted on 2021-04-18 • Filed under info
There is now a re:Web package in the AWS Serverless Application Repository that comes ready-to-go with nginx and php-fpm included.
Usage goes something like this:
-
Make sure you have an EFS Access Point that will be your "web root", with at least a simple
index.html
for testing -
Deploy the package from the Serverless Application Repository
-
For deployment, you will need to provide
- the EFS Access Point ARN
- the VPC Subnet ID(s) for the Lambda function
- the Security Group ID(s) for the Lambda function
-
Wait for the deployment to complete -- you can monitor progress in the "Deployments" tab (should take 2-5 minutes)
-
After deployment, go to the API Gateway Console and find the Invoke URL
There will be a Lambda function and a corresponding API Gateway that's ready to serve web requests and even full PHP applications from your EFS. Just open the Invoke URL in your browser.
A potential next step might be to manually add a Custom Domain Name to API Gateway, or configure an Application Load Balancer to connect to that Lambda. And to put some content there, for example some PHP application.
To delete the deployment, simply delete the stack in CloudFormation.
Note that I consider this re:Web package even more experimental than re:Web itself :-) If you give this a try, let me know!