How do I pass UserData to a Beanstalk instance with CloudFormation
If you want to have all the advantages that Beanstalk offers - like not having to patch the OS which Amazon does for you - this isn't possible. One option is to create a custom AMI where you include the needed scripts, but then you must manage the OS yourself with security patches. Read more here.