Using the JetBrains AWS Elastic Beanstalk integration plugin - amazon-web-services

I'm using the excellent JetBrains AWS Elastic Beanstalk integration plugin (in PyCharm) but have a few related questions on how to accomplish things and how it integrates with the behavior of AWS's eb command line tool:
Is there a way to take advantage of EB's association between git branches and EB environments? The plugin doesn't seem to use this mapping and instead uses the environment specified in the run configuration dialog.
The URL that the application given as being "available at" is wrong. Is this a known bug? Is it something that I can fix?
Is there any way to have multiple run configurations for a given deployment (e.g. with different environment names)? Right now whenever I change the environment in one of my run configurations for a deployment, the other run configurations also switch to that environment.

Related

Hooks in Elastic Beanstalk V3.0.1 (Amazon Linux 2) for configuration updates

As described in the AWS docs there are platform hooks for elastic beanstalk EBS for the deployment process: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/platforms-linux-extend.html
But what can I do, to run a script each time someone changes the EBS configuration, e. g. an environment property?
If you look at the current docs here:
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/platforms-linux-extend.html, under Platform hooks -> Configuration deployment platform hooks, it explains:
A configuration deployment occurs when you make configuration changes that only update environment instances without recreating them.
And further:
To provide hooks that run during a configuration deployment, place them under the .platform/confighooks directory in your source bundle
So adding a Configuration deployment platform hook in this way should execute each time an environment property is changed.
Unfortunately there is no way to do this currently:
https://github.com/aws/elastic-beanstalk-roadmap/issues/15#issuecomment-616843537

How to host based routing different version in same AWS EB application

The question come from here that recently I am required to start a new project using AWS, while I was GCP developer before.
In GCP, I can deploy my application to AppEngine(similar to EB) with versioning like gcloud app deploy settings.yaml --version dev. Such that I can have host based routing on two links --
my-project.xxxx.com
dev.my-project.xxxx.com
Such that I can let others to have a domain for testing without starting an new instance, sharing all environment settings, dbs and storage.
However, when I come to AWS, it seems the story is completely different.
I try to follow this guide https://aws.amazon.com/blogs/aws/new-host-based-routing-support-for-aws-application-load-balancers/, but it is just for routing to different instances.
By the way I know that EB application can have multiple versions, so is it possible to do something like
my-project.xxxx.com -> go to default version
dev.my-project.xxxx.com -> go to version with tag 'dev'
So 2 questions,
Can I achieve what I want?
If can't, is starting another EB instance for testing only choice?

Automatically setup a AWS Environment

I wanted to know if there is a way to setup a cloud environment using Amazon Web Services automatically (like by just invoking a batch file...).
I have a scenario where i want to setup the Environment with all the requisite things like OS, Platforms etc. I want to automate the entire process of setting up the environment. Is this possible?
I am trying to do Continuous Integration and as a part of CI i want to first set up the environment for the application to be deployed, deploy the application and then run automated and performance tests. i am using Jenkins to run my automated and performance test cases with Selenium and Jmeter. Kindly help me.
You can use different tools based on your requirement.
If you also want to configure VPC and other network level configuration, you can use cloud formation, basically you'll create a template and launch your infrastructure using this template file.
https://aws.amazon.com/cloudformation/cloufformation
if you need to launch an project with a database, application server (tomcat, java, python, ...) and with load balancing and autoscaling configuration, you can use elasticbeanstalk
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/Welcome.html
opswork, docker could be also an option depending on your requirements. But they need pre configuration.
Would be more easy to advise a solution if you extend question with your use case.

Deploying a war to Elastic Beanstalk with Pallet

I've got a Java servlet packaged in a war, and need to deploy it to Elastic Beanstalk. I can roll my own deployment script using Amazonica, but I'd rather leverage Pallet for this.
A Google search for "pallet elastic beanstalk" is not turning up anything useful, other than a "How to deploy a clojure web application to Amazon EC2" question on Stack Overflow. The answer looks quite promising, but it doesn't cover setting environment properties, and I'm not sure whether that group spec would create an Elastic Beanstalk environment or a regular EC2 one with Tomcat.
Has anyone done this? Is there a nice blog post or recipe for it?
Just to be clear, the war itself is not a Clojure app, it is just a war built with Maven from a Java project somewhere.
Since this is not an action that happens to an instance, for instance it does not change a member of a pallet group, I would recommend using clj-action to upload it using amazonica at the appropriate place in the phase.
I'm assuming that some instance (or group) you are deploying with pallet needs this web service to be in place so it can be configured to connect to it. In cases like this it would make sense to define a phase which uploads the war file and saves its configuration into the session. Then later phases on any instance in the deployment can see where the web service is available.
If it's only needed by one instance/group then it's fine to simply call amazonica (through clj-action) in the middle of the configure phase and then configure that instance to use the web service in the same plan-fn.

Amazon AWS Beanstalk Custom AMI Problems

I'm trying to deploy an application to AWS that requires some extra software installed on the server. To create the custom image, I followed the instructions I found here and here to start an EC2 instance and install my software. I then created a snapshot before terminating the instance.
Now my question: How do get beanstalk to use my snapshot when creating an application? When I try to create an application, only the 7 basic AMIs are available for 'container type'.
From personal expirence I can say that most documentation on elastic beanstalk customization is outdated. What about using of custom ami, you need to know the actual version of the elastic beanstalk anyway installs beanstalk scripts and performs configuration on new instance bootstrap, so if you use custom ami it also happens. Base on this I would recommend to use custom ami when you need to have some OS level customizations.
If you need to install some additional software or change something I would recommend to use approach described here: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html
Good example described here:
http://www.hudku.com/blog/innocuous-looking-evil-devil/
Also you can find a lot of examples on github if you try to find keyword: .ebextentions
Fire up your environment configuration, and then switch to the custom AMI you've registered, in the Environment Settings. If possible, save a Configuration Template for further usage.