I have a simple PHP application, which doesn't use any database, or anything else. I have a script, which asks me for version name and than creates ZIP with the site and upload via the web interface.
Can I upload to ElasticBeanstalk via let's say SSH?
Yes, with the Elastic Beanstalk Configuration Files.
Related
In the examples of Amazon Chime, for instance here https://github.com/aws-samples/amazon-chime-sdk-classroom-demo, they imply that it should be deployed and run on a AWS server via Cloud9. However, I want to deploy and run it on some other VPS such as a digitalocean or linode server.
The main question: can that be done at all, it is supported?
If yes, how? General pointers. Which example should I use and where is it described at all?
Eventually what I want is this:
Say, I have a teaching website that I run on digital ocean or linode. Not on AWS. I want to be able to use Amazon Chime in a way that my users will go to my website and connect to a video class from my website as well
The Chime service would need run on AWS, but you can have a link to the Chime service endpoint from any website hosted anywhere else.
To use the Amazon Chime web application, your students would sign in to https://app.chime.aws/ from your web browser. You would have that link on your website.
See https://docs.aws.amazon.com/chime/latest/ug/chime-web-app.html
Note about the demo. The demo shows how to use the Amazon Chime SDK to build an online classroom in Electron and React. If you are are using that deployment method you can host the React app anywhere under a private domain on any host. That app will run any where, while connecting back to the AWS service endpoint.
Resources would be deployed in AWS. No way around it.
Deployment script can be run from your own laptop, Cloud9 and/or any other Linux server. You just need to be able to run git clone and script/deploy.js.
You'll also need to make that environment is configured with appropriate AWS credentials. Cloud9 would have these credentials out of the box. For any other environment (your laptop/Digital Ocean VM etc.) would need to get AWS Account Ket/Secret pair and use aws config to enable them.
We're moving a website to the AWS environment and running apache2 on an EC2. We were planning on using the AWS secrets manager to store some of the credentials such as the RDS (database) and email credentials. I also use environment variables in apache to store the AWS credentials, but since it is the AWS credentials which are used to retrieve the secrets, I was wondering if there was any way to run a script on apache start-up to use the aws-sdk to retrieve those secrets.
Or are there any other suggestions on how to do it? I can do it after the fact in the PHP code that needs such access, but I'm just exploring what is possible at the moment. It would be nice if some configuration options were loaded when apache starts.
Your two options seem to be either write a startup script that populates the env variables and then starts apache as a child process so it can read those variables, or modify the web application to read the secrets directly.
Reading the secrets directly in the application (possibly from some short lived cache) would allow you to rotate your DB creds without having to restart the application.
Also, if you are running on EC2 you do not need to populate env variables with the AWS creds. Just use roles for EC2. The AWS CLI and SDKs already know how to retrieve those credentials directly.
I'm new to web dev and created a site using an S3 bucket that works and is live online. However, I realized that since I'm trying to run a PHP script I found online for a contact form, the site is not truly static so the form will not work. The form is called like this in the html code:
<form name="htmlform" method="post" action="html_form_send.php">
Currently when I try to run this, I get a 405 method not allowed error. Is there a way I can get this code to run? I've done some research online that mentions I have to create an EC2 instance, but I'm overwhelmed by which AMI to choose and don't know how to get the instance connected to the bucket. Can anyone help, or at least does anyone have a resource I could look at to figure this out? Thanks!
The easiest way to deploy your PHP app in AWS is using Elastic Beanstalk.
Elastic Beanstalk for PHP makes it easy to deploy, manage, and scale
your PHP web applications using Amazon Web Services. Elastic Beanstalk
for PHP is available to anyone developing or hosting a web application
using PHP.
Elastic Beanstalk provides configuration options that you can use to
customize the software that runs on the EC2 instances in your Elastic
Beanstalk environment. You can configure environment variables needed
by your application, enable log rotation to Amazon S3, and set common
PHP initialization settings.
Reference: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_PHP_eb.html
I am working on an AWS Elastic Beanstalk app that uploads files to an AWS S3 bucket. The Beanstalk app is a .NET Core Web API app, I've followed this guide (http://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/net-dg-config-netcore.html) and have a credentials file on disk for local development with my shared access key and secret. These are the key and secret of the user that I created an S3 bucket with. That user has full access to S3 through IAM. In local development, the application uploads to S3 without a hiccup.
When I deployed the app to the Elastic Beanstalk platform, upload to S3 doesn't work in the elastic beanstalk environment. Local version is still fine.
I deployed the app to AWS Elastic Beanstalk using the AWS Toolkit for visual studio and specified that the app should have S3 full access during the creation process. I have since gone into the instance's role config and verified that it does in fact have S3 full access as a permission. I get an exception that the server terminated the connection abnormally after a timeout when attempting the upload. Is there a step or configuration piece I'm missing? Is there a way I can specify the same shared access key and secret I use locally on the beanstalk app so I can test it? I haven't found a way to give it any credentials from a file or the like.
Thanks,
Sam
For anybody that comes looking with a similar issue. It turned out that my S3 bucket and EB app were in separate regions and this made it so there was a network issue between the two.
So I am thinking of migrating my website to Amazon S3 since it's super cheap and fast, however, I use PHP and AJAX to submit my contact forms. Would it be possible to host my site using AWS S3 and then send all HTTP POSTs to the EC2 instance?
Yes, this is very well possible. However, if you're running an EC2 instance anyways and your traffic is not enormous, you might as well serve your static files from your EC2 instance.
It is not possible to host php site on AWS S3 only static content like images, css or js can be put their.
For dynamic content you have to make use of aws instance.
https://forums.aws.amazon.com/message.jspa?messageID=453142
Correct Usage of Amazon Web Services S3 for Server - Side Scripting