Questions tagged [amazon-ec2]

For questions about using Amazon Elastic Compute Cloud in DevOps, including deploying, monitoring and scaling applications in EC2. For questions specifically about monitoring EC2 with [aws-cloudwatch] use that tag. For the EC2 container service use the [amazon-ecs] tag.

Amazon Elastic Compute Cloud (EC2) is a service for renting virtual computers with flexible scaling of instances.

More information: https://aws.amazon.com/ec2/

Usage:

Use this tag for questions about using EC2 in DevOps-related operations, including deploying, monitoring and scaling applications.

For questions about using to monitor EC2 systems please use that tag.

For questions about the Amazon EC2 container service please use the tag.

180 questions
34
votes
4 answers

Why is the AWS EC2's spot price greater than the on-demand price?

I was trying to provision spot instances via Ansible yesterday, and almost all my requests failed, even when I put my spot price == the on-demand price of that instance. So, when I had a look at the spot pricing graph, I found something very…
Dawny33
  • 2,816
  • 3
  • 24
  • 62
28
votes
5 answers

How to clean up orphaned AWS EC2 snapshots?

We end up with a fair amount of AWS EC2 snapshots where the AMI has been deleted, but the snapshot is left behind to rot. I'd like a non-manual way of identifying and deleting these orphans to save us money and space. Ideally I'm thinking a bash…
Alex
  • 4,612
  • 6
  • 29
  • 49
16
votes
3 answers

How to check AWS spot pricing automatically?

I've been thinking about a Jenkins job to check the pricing for the agent boxes we spin up; every so often the price spikes and it'll be an hour or two before anyone notices that no new agents are coming up, and then we have to go in manually and…
Alex
  • 4,612
  • 6
  • 29
  • 49
16
votes
6 answers

How to run a script or a command on EC2 instance via AWS CLI?

According to New EC2 Run Command news article, AWS CLI should support a new sub-command to execute scripts on remote EC2 instances. However I've checked in aws ec2 help, but I can't find the relevant command. I've installed aws via apt-get: $ aws…
kenorb
  • 8,011
  • 14
  • 43
  • 80
15
votes
4 answers

How to increase the size of a disk on a running instance on Amazon EC2

I got a running instance of a EC 2 server setup with Ubunto. What's the best way to increase the disk size without any downtime and minimal risk? Reading through the guides, one way would be to create a new disk, migrate data, turn off the instance…
googletorp
  • 261
  • 2
  • 6
14
votes
1 answer

How do you manage your inventory of spot instances on AWS with Ansible

I am new to Ansible, with some experience in Chef. I am considering learn and use Ansible to manage environments. I was wondering, what would be the best practice to manage inventory of AWS spot instances? For example, when a spot instance is shut…
Berlin
  • 780
  • 6
  • 15
10
votes
1 answer

Automate custom docker image deployment on AWS

This question is related to my previous one - but a bit more descriptive. I am trying to build automate the generation and deployment of a docker container. The docker container is created with packer. After the creation of the docker image, I am…
Kyu96
  • 145
  • 3
  • 17
9
votes
2 answers

Is Azure's confidential computing essentially encrypted RAM?

I'm trying to wrap my head around the Azure confidential computing offering. It appears that that AWS does not offer encryption at the application level (see diagram for what I mean by this:) My question is: Is Azure's confidential computing…
hawkeye
  • 1,153
  • 1
  • 9
  • 14
9
votes
6 answers

How to prevent hug of death on EC2 Instance?

I've a iOS app on the app store and recently I've received a huge surge of traffic to my landing page hosted on EC2 and resulted in the page not responding, luckily I managed to recover it by restarting and upgrading the instance to a t2.medium. Now…
Missus
  • 93
  • 4
9
votes
2 answers

Application calling AWS internal load balancer in same subnet is timing out

Some background: I've created a moderately complex network using Amazon's vpc. It's a three-tiered network across two availability zones. Each layer has a subnet in zone-a and zone-b. The presentation layer is at the top, there’s an application…
8
votes
2 answers

Best way to launch 100 identical Docker machines on AWS?

I need to do some large scale testing on a system. The system consists of 2 main parts: Manager and Nodes. There will be only one manager server, but 100 nodes. Both the manager and nodes are Docker images. I want to be able to spin up a setup on…
7
votes
1 answer

How does the creation of an AMI on AWS work and why is the creation time unpredictable?

Creation date: September 23, 2019 at 9:22:06 PM UTC+2 21:48: still waiting for completion 21:53: completed Sometimes it takes 15 minutes and sometimes longer. How does a creation of an AMI work and why is the creation time unpredictable?
030
  • 13,383
  • 17
  • 76
  • 178
7
votes
1 answer

How to automate submission to Amazon Marketplace?

Is anyone aware of a way to automate the submission of an AMI to Amazon's Marketplace? I want to take a public AMI and share it to the AWS Marketplace so it can be scanned for listing and then submit the product metadata sheet. Our preferred…
7
votes
1 answer

AWS ECS/EKS: EC2 vs Fargate mode

Amazon offers the option of launching their container management services ECS and EKS in two modes: EC2 and Fargate. In the former, normal VMs (EC2 instances) are used and ECS or EKS (depending on the selection) clusters are created. In the later,…
pkaramol
  • 1,007
  • 2
  • 8
  • 13
6
votes
2 answers

How to find out the used Key pair name via AWS CLI?

I'm aware of get-password-data command which can display PasswordData data like: $ aws ec2 get-password-data --instance-id i-0123456789 { "InstanceId": "i-0123456789", "PasswordData": "\r\nAOh...xg==\r\n", "Timestamp":…
kenorb
  • 8,011
  • 14
  • 43
  • 80
1
2 3
11 12