30 votes
Accepted

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

This is actually a great example of people slightly abusing spot. People are saying 'Our workload is really important but we don't want to pay full on demand price', so they set a bid price higher ...
user avatar
  • 506
16 votes
Accepted

How to clean up orphaned AWS EC2 snapshots?

Largely inspired by the blog posts and gist already linked in the other answers, here is my take to the problem. I did use some convoluted JMESpath functions to get a list of snapshots and not ...
user avatar
  • 11.1k
15 votes

How to check AWS spot pricing automatically?

Spotted an open source tool called autospotting that just might help with this: Once enabled on an existing on-demand AutoScaling group, it launches an EC2 spot instance that is cheaper, at least ...
user avatar
  • 441
15 votes
Accepted

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

You are looking for Dynamic Inventory Please look into ec2.py and ec2.ini of Ansible, and also the Dynamic Inventory docs of Ansible are very good for understanding how to manage your AWS inventory.
user avatar
  • 2,756
14 votes
Accepted

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

Amazon AWS just released (on 13th February 2017) a new feature that allows to change a size of an EBS volume. source: https://aws.amazon.com/blogs/aws/amazon-ebs-update-new-elastic-volumes-change-...
user avatar
14 votes
Accepted

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

To run ipconfig from the AWS Systems Manager Run Command: $ aws ssm send-command --document-name "AWS-RunPowerShellScript" --instance-ids "<your instance id>" --parameters commands=ipconfig ...
user avatar
  • 718
13 votes

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

There are 2 reasons for this: A lot of users are using the spot instance at some times (Think about batch processing, boot up 100 machines as spot instance and crunch away). For a spot instance you ...
user avatar
  • 131
8 votes
Accepted

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

So what you have actually is this: As your API ELB is in a private zone it can't be accessed from the internet. Your frontend in React.js just run in User's browser and not on the UI servers, those ...
user avatar
  • 11.1k
8 votes
Accepted

How to prevent hug of death on EC2 Instance?

If you want something quick to get this sorted without much more knowledge I'd recommend elastic beanstalk. It's another AWS application which will handle the load balancer configuration and instance ...
user avatar
  • 1,082
7 votes

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

A useful bit of information for understanding why someone would bid over the on-demand price can be found in the Introduction to Spot Instances: Spot Instances can be used to help you meet ...
user avatar
  • 1,502
7 votes
Accepted

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

For a given instance, you would first use aws ec2 describe-instances to get the information JSON for your instance. The information also contains the keypair name used to create that instance. E.g. ...
user avatar
  • 601
7 votes
Accepted

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

When creating an AMI, you are making a copy of your EBS volumes. This utilizes block storage and will only need to process the diffs of your EBS snapshots. If you changed a lot of data in your EBS or ...
user avatar
6 votes

How to automate submission to Amazon Marketplace?

Snapshot Permissions Boto3 has a function that allows you to create volume permissions, which is what AMI Sharing with AWS Marketplace requires you to do. snapshot.modify_attribute will allow you to ...
user avatar
  • 1,082
6 votes

How to check AWS spot pricing automatically?

I would personally consider a model like this: Timed Lambdas -> Checks spot price -> Push to ElastiCache Then when you need instances: Timed lambdas -> Pulls spot price from ElastiCache, ...
user avatar
  • 506
6 votes
Accepted

AWS Spot instances price

You notice that you now have access to 6 availability zones in us-east-1, where you previously only had 4 or 5. Adding capacity is the reason that new availability zone is now available. Because ...
user avatar
6 votes
Accepted

Is Azure's confidential computing essentially encrypted RAM?

The article you are referencing mentions encrypted RAM but that was only a reference to possibilities of enhancing the technology more in the future, not about the current state of confidential ...
user avatar
  • 525
6 votes

Large number of host emulation

you create a Docker Swarm stack file: --- version: '3.1' services: ubuntu: image: ubuntu # or your custom Docker image deploy: replicas: 10000 Then, with docker stack you can ...
user avatar
6 votes
Accepted

What should I use for configuration management on AWS?

A good way to find comparison information about things like this is googling for "X vs Y", e.g. "Chef vs AWS stacks", "Chef vs Puppet" or something like that. That does turn out subjective information,...
user avatar
  • 4,716
6 votes

AWS ECS/EKS: EC2 vs Fargate mode

Update 12/05/2020: Fargate prices have been greatly reduced over the last months and are now comparable with EC2 prices for the same CPU / RAM configurations. That makes Fargate a valid option for ...
user avatar
  • 971
5 votes

How to clean up orphaned AWS EC2 snapshots?

I used the following script on GitHub by Rodrigue Koffi (bonclay7) and it works pretty good. https://github.com/bonclay7/aws-amicleaner Command: amicleaner --check-orphans From the documentation ...
user avatar
5 votes

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

If you look at the charts closely, you will see that a spike is always of a very short duration - just enough time for the automated monitoring systems written by the owner to terminate those systems ...
user avatar
5 votes
Accepted

Bad edit to sudoers file on EC2 instance, how to fix it?

How about user-data ? I believe adding the "#cloud-boothook" allow to force the user-data to run at every restart. #cloud-boothook #!/bin/bash echo 'test' > /home/ec2-user/user-script-output.txt ...
user avatar
  • 66
5 votes
Accepted

Ideal methods of handling server logs on AWS

I like to use ELK, Elasticsearch, Logstash and Kibana with Beats. Filebeat, that belongs to Beats series will forward the logs that read from a file to logstash. In logstash you could tag, filter, ...
user avatar
  • 305
5 votes
Accepted

DevOps practice on AWS instances

You might not be able to get this done on the free tier. Puppet for example isn't going to want to start because of the RAM limitations. The AWS free tier uses thje t2.micro instance which only has ...
user avatar
  • 3,674
5 votes
Accepted

What is the AWS user permission that allows attaching and detaching IAM Roles to instances?

From Granting a User Permissions to Pass a Role to an AWS Service: To pass a role (and its permissions) to an AWS service, a user must have permissions to pass the role to the service. This helps ...
user avatar
5 votes

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

Here is a helper Bash script which uses aws ssm send-command to run the commands: #/usr/bin/env bash -x # Script to run PowerShell script on the Windows instance. instanceId="$1" cmdId=$(aws ssm send-...
user avatar
  • 7,121
5 votes
Accepted

Best way to launch 100 identical Docker machines on AWS?

Look at AWS Fargate - it lets you run your Docker containers without having to spin up the EC2 instances for an ECS cluster. You simply schedule the Tasks (or Services), each gets is own IP address ...
user avatar
  • 971
5 votes

Digital Ocean vs AWS EC2 for Laravel based application

We faced exactly the same choices for our live service that deploys a laravel API and multiple react apps. There is no generic correct answer to a question "what tool/provider is better?" as it ...
user avatar
  • 1,162
5 votes

Is there a way to export details of all EC2s in an AWS account?

You can use AWS CLI and run the below command to get details of all ec2 instances in your account. aws ec2 describe-instances You can also use filters, if required. Please refer the documentation.
user avatar
  • 951
5 votes
Accepted

What does the ASCII art on the Amazon Linux 2 AMI MOTD mean?

Just assume part of the ASCII-art chars have been made invisible, whereas if you would in-hide them all it would look (more or less) like so: ____ ____ ___ | ___| / __| /_ ) | _| | ( / / |...
user avatar
  • 6,963

Only top scored, non community-wiki answers of a minimum length are eligible