We recommend to use Packer and this AMI as a base image to build your own AMIs right from your CI/CD pipeline. Use the provisioners section in your Packer script in order to copy your configuration files to the conf folder and your source code to the src folder. You might also want to run any additional scripts or commands that don’t require the project to be running, for example, package managers install process (npm, composer, pip, etc…​).

Proposed Packer configuration:

    "builders": [
            "type": "amazon-ebs",
            "region": "us-east-1",
            "source_ami_filter": {
                "filters": {
                    "virtualization-type": "hvm",
                    "name": "Develatio - ExpressJS - NodeJS 12 v0.1.0*",
                    "root-device-type": "ebs"
                "owners": ["679593333241"],
                "most_recent": true
            "snapshot_tags": {
                "Name": "My Project build with Develatio's ExpressJS AMI"
            "instance_type": "t3.xlarge",
            "ssh_username": "admin",
            "ssh_interface": "public_ip",
            "ami_name": "My Project build with Develatio's ExpressJS AMI",
            "force_delete_snapshot": true,
            "force_deregister": true,
            "shutdown_behavior": "terminate"

    "provisioners": [
            "destination": "/var/www/webapp/",
            "source": "./",
            "type": "file"
            "type": "shell",
            "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} bash -l {{ .Path }}",
            "inline": [
                "cd /var/www/webapp",
                "unzip -q",
                "cd /var/www/webapp/src",
                "pip3 install -r requirements.txt",
                "python collectstatic --noinput --settings=main.dummy_settings"