How to add a configuration file to a AWS application load balancer? - amazon-web-services

I've been looking into how to route HTTP traffic to https for my Elastic Beanstalk environment. AWS has documentation on this that recommends using configuration files. I'm just not sure where I should paste this configuration? I'm quite now to AWS, so I'm love some newbie friendly advice.
I'm using an Application Load Balancer.
Thanks

The files in the docs cited, alb-http-to-https-redirection-full.config and alb-http-to-https-redirection.config are to be placed (after your modifications if needed; HTTPs requires SSL certificate) in your .ebextensions folder.
So in your zip package would have files .ebextensions/alb-http-to-https-redirection-full.config and/or alb-http-to-https-redirection.config along side your application.

Related

.ebextensions not included in AWS source bundle

I have a .net core application which was earlier hosted on aws with ssl and load balancer. But in order to avoid load balancer I found that ssl will also not work without load balancer. As an alternative for SSL certificate I created a folder in root folder - .ebextensions and a config file inside it.
The problem is when I am publishing it to aws via elasticbeanstalk then the .ebextensions is not included in the source bundle and therefore ssl certificate is not working. Is there any way I can include this folder or any alternative way to get ssl certificate without load balancer. Please advice.
This is a very small thing which I ignored. Just change the Build Action of config file from None to Content will allow the folder and file to be copied. Empty folder not included while publishing. Thanks #Marcin and #Sridhar Raju for all the help

How do I enable HTTPS for my Elastic Beanstalk Java application?

My instance is a single instance, no load balancer.
I cannot seem to add a load balancer to my existing app instance.
Other recommendations regarding Elastic Load Balancer are obsolete - there seems to be no such service in AWS.
I do not need caching or edge delivery - my application is entirely transactional APIs, so probably don't need CloudFront.
I have a domain name and a name server (external to AWS). I have a certificate (generated in Certificate Manager).
How do I enable HTTPS for my Elastic Beanstalk Java application?
CloudFront is the easiest and cheapest way to add SSL termination, because AWS will handle it all for you through its integration with certificate manager.
If you add an ELB, you have to run it 24/7 and it will double the cost of a single instance server.
If you want to support SSL termination on the server itself, you're going to have to do that yourself (using your web container, such as apache, nginx, tomcat or whatever you're running). Its not easy to setup.
Even if you don't need caching, CloudFront is going to be worth it just for handling your certificate (which is as simple as selecting the certificate from a drop-down).
I ended up using CloudFront.
That created a problem that cookies were not being passed through.
I created a custom Caching Policy to allow the cookies, and in doing so, I also changed the caching TTLs to be very low. This served my purposes.

Aws Hosting with Godaddy Domain and SSL to work with cloudflare

We have AWS EC2 instance where we have hosting of our website and we have domain and SSL from godaddy with cloudflare for cache policy.
Now we want to integrate ssl with our website but we are clueless regarding how to do this process with cloudflare as there are three different service providers like AWS, Godaddy and Cloudflare so it would be great if someone could help us how to deal with that.
The question is too generic (you don't mention what web server, or OS are using), let alone mentioning there are tons of documentation already on how to set up SSL in the most popular web servers: Apache and Nginx. One thing that I suggest, is that, if you are using Elastic Load Balancing, then you can use ACM service to deploy an SSL certificate, and attach it to your load balancer. It's the easiest, and cheapest way to do it.
Here on how to deploy a free SSL certificate managed by AWS, and here on how to attach it to the load balancer.
if you are not using load balancing, or need to implement fully end-to-end encryption, or simply don't want to do it this way, you will probably need to look into how to set up SSL on the web server you are using. An example can be found in https://www.digicert.com/csr-ssl-installation/apache-openssl.htm, but since you didn't specify what OS or webserver you are using, we can't really say much.

AWS hosting with HTTPS

I'm working on this site that I'm hosting with AWS. I'm hosting a vue.js frontend in an S3 bucket and the backend utilizes Spring Boot hosted with Elastic Beanstalk and a MySQL RDS instance. After playing around some, I got the frontend to serve up files via HTTPS, but now my requests to the Spring API are failing.
I've done a lot of digging on this and it seems that are may be several ways to handle this, but I just keep getting stuck and not knowing where to turn next. I've tried playing around with setting up a load balancer, and also tried configuring a proxy in a .ebextensions configuration file.
This whole thing was working when I set it up with HTTP originally, but now that the front-end is serving up HTTPS it won't work.
Web browsers must be blocking your mixed HTTP/HTTPs content because of their inbuilt security. You need to make sure that you setup the whole site using HTTPs or HTTP. As you have already set up the S3 content to be served through HTTPs, now you must configure your Elastic Beanstalk environment to be setup with HTTPs too. Here is the link to help you with that
Configuring HTTPS for Your Elastic Beanstalk Environment
If your site is built with a CRM? (WordPress/Joomla/ect.) then there are plugins/extensions that handle that. I had a similar situation with a WordPress site, and used the plug-in called "SSL Insecure Content Fixer". Worked without a hitch, rather than scanning through the entire site for mixed HTTP/HTTPs content.

Installing SSL certificates on AWS EC2 Instance not using Cloudfront or Elastic Load Balancing

I have an EC2 instance which runs a website I want to add an SSL certificate for. From Amazon's documentation and other sources the only way they have stated an SSL certificate can be added is through:
Cloudfront
Elastic Load Balancing
I am not already using these for my website due to the added cost of these services. Is there another method of adding an SSL certificate without using Cloudfront or ELB? Thanks.
If you want to use SSL on a EC2 instance directly, you must obtain and install a certificate through the application running on your instance, (e.g. Apache, Nginx). There is nothing special required because your instance is running on AWS.
You will not be able to use the free certificates provided by Amazon Certificate Manager, they can not be exported for use with services other than ELB and CloudFront.
I would take a look at using Let's Encrypt. It's free and you can automate the renewal process.
https://letsencrypt.org
If you are running Bitnami (a common occurrance), there is an article here that describes WHERE the files are. This cost me HOURS, until I found the link.
Basically, if you can't find Apache or Nginx, look in /opt/bitnami/.
Then, you can install the cert, bundle and key files in /opt/bitnami/apache2/conf, and set up the vhost in /opt/bitnami/apache2/conf/bitnami/bitnami.conf.
There is NOTHING in the AWS docs that mentions any of this.