Script to update EC2 instances with new version of application remotely - amazon-web-services

I want to write a script to update my ubuntu machines with new applications remotely. My machines are in private subnet under Elastic load balancer.

Take a look at http://www.ansible.com/home. The only thing it needs on a remote linux computer is ssh and python.

Related

How to deploy application from Jenkins in Linux Ec2 instance to Windows Ec2 Instance?

I have a requirement to deploy applications from Jenkins in Linux to Windows Ec2 instance. I'm able to deploy it in Linux instances using SSH and SCP but to deploy it in windows, I don't know how to approach it, any help would be very helpful.

Odoo on aws and docker containers

I am running odoo on an ec2 instance -aws.
The odoo code is pulled from the docker hub, running inside the ec2 via docker containers.
The problem is that the ec2 doesn't have a static IP and every time it's restarted the connection with odoo disappears.
This is at least the theory am working with.
I would appreciate other solutions or might be problems
You need to associate an Elastic IP to your ec2 instance. This will give your ec2 a fixed public IP address
You can follow the documentation in AWS below:
Associate an Elastic IP address with an instance or network interface.
Take in account that there are costs associated: pricing

Docker Service in Swarm cannot connect to AWS RDS when a port is published

The company I'm working for recently decided to deploy a new application with docker swarm on AWS using EC2 instances. We set up a cluster of three EC2 instances as nodes (one manager, two workers) and we use stack to deploy the services.
The problem is that one of the services, a django app, runs into a timeout when trying to connect to the postgres database that runs on RDS in the same VPC. But ONLY when the service publishes a port.
A service that doesn't publish any port can connect to the DB just fine.
The RDS endpoint gets resolved to the proper IP, so it shouldn't be a DNS issue and the containers can connect to the internet. The services are also able to talk to each other on the different nodes.
There also shouldn't be a problem with the security group definition of the db, because the EC2 instances themselves can get a connection to the DB.
Further, the services can connect to things that are running on other instances within the VPC.
It seems that it has something to do with swarm (and overlay networks) as running the app inside a normal container with a bridge network doesn't cause any problems.
Stack doesn't seem to be the problem, because even when creating the services manually, the issue still persists.
We are using Docker CE version 19.03.8, on Ubuntu 18.04.4 LTS and docker-compose version 3.
The problem come when you config your swarm subnet conflict with your subnets in VPC. You must change your swarm subnet different CIDR.

How to connect to another Amazon Linux ec2 instance from an Amazon linux ec2 instance?

I have logged in to my amazon ec2 instance, using putty(as I am using windows). Now, I want to connect to another ec2 instance from here.
What is the process ?
I am new to Cloud computing, so can you please tell me the steps clearly?
You are looking to create an SSH tunnel, i.e. connect from your machine to a third machine, via an intermediate machine.
THis is often done for security purposes and the middle box is usually called a bastion host or jump box.
Here is some pretty detailed instructions:
https://linuxacademy.com/howtoguides/posts/show/topic/17385-use-putty-to-access-ec2-linux-instances-via-ssh-from-windows

Creation of VMS within AWS Ec2

I am trying to design and making architecture of cloud application deployment resources in AWS cloud using EC2, S3, and RDS. Here I have a little bit of confusion about AWS infrastructure, which I am describing here.
I already have a AWS EC2 machine - Ubuntu 16.04 LTS. Is possible to create another VMs within my Ubuntu? I mean, can I use Linux or CentOS within my EC2 Ubuntu machine?
I am a beginner in cloud and AWS world, still exploring about AWS infrastructure.
When you instantiate your EC2 instance you are required to select an AMI. the AMI is an amazon machine image. This essentially describes what OS (CentOS, Ubuntu, RedHat, etc) will be installed on your EC2 instance. Most likely you selected the Amazon Linux AMI which installs amazon's own flavor of CentOS. Once the instance is up, you will not be able to install a different OS on it. You will have to terminate your existing instance and spin up a new EC2 instance with the AMI that you want.
That being said, you can also use a tool such as Docker https://www.docker.com/. This allows you to spin up docker containers. Each docker container acts like a VM and will allow you to spin up multiple different docker containers with whatever OS you want within your single EC2 instance.