Questions tagged [amazon-ec2]

Amazon EC2 stands for "Amazon Elastic Compute Cloud". It is a part of Amazon Web Services (AWS) and allows users to rent virtual machine instances. You can create instances, launch and manage them through a central interface, through a web API or through a console.

Amazon EC2 is a part of Amazon Web Services (AWS) and allows users to rent virtual machine instances. You can create instances, launch and manage them through a central interface, through a web API, through a console, or by using an Infrastructure as Code tool like terraform

Generally, EC2-related questions on StackOverflow should be about the EC2 API or other programming-oriented topics. Questions about EC2 networking, OS-level issues, cost, etc. should be asked on ServerFault instead.

Resource

  1. Instance types
  2. Pricing
  3. Documentation
  4. Discussion Forum
36510 questions
138
votes
10 answers

HTTPS setup in Amazon EC2

How do we enable HTTPS in Amazon EC2? Our site is working on HTTP.
Muhammed Asharaf
  • 1,499
  • 2
  • 11
  • 4
138
votes
11 answers

AWS Difference between a snapshot and AMI

So I am having trouble working out what, specifically is the difference between these two. As I understand it, a snapshot is simply a backup of the disk drive, whereas the AMI is a backup of the entire system (or instance I should say), but isn't…
Melbourne2991
  • 11,707
  • 12
  • 44
  • 82
136
votes
8 answers

What are the respective advantages/limitations of Amazon RDS vs. EC2 with MySQL?

I realize a couple of basic differences between the two, i.e. EC2 is going to be cheaper RDS I wouldn't have to do maintenance Other than those two, are there any advantages to running my database from RDS as opposed to a separate EC2 server…
Macgyver
  • 1,831
  • 2
  • 16
  • 19
133
votes
15 answers

On EC2: sudo node command not found, but node without sudo is ok

I have just installed nodejs on a new EC2 micro instance. I installed it normally, ./configure -> make -> sudo make install. Problem: When I run "node" under ec2-user, it runs perfectly. When I run "sudo node", it fails. I found out that node is…
foobar
  • 10,854
  • 18
  • 58
  • 66
131
votes
9 answers

MySQL/Amazon RDS error: "you do not have SUPER privileges..."

I'm attempting to copy my mysql database from an Amazon EC2 to an RDS: I successfully did a mysqldump of my database into my root folder using this: root@ip-xx-xx-xx-xx:~# mysqldump my_database -u my_username -p > my_database.sql Then I tried to…
tim peterson
  • 23,653
  • 59
  • 177
  • 299
129
votes
5 answers

How to create an SSH key in Terraform?

I need to spin up a bunch of EC2 boxes for different users. Each user should be sandboxed from all the others, so each EC2 box needs its own SSH key. What's the best way to accomplish this in Terraform? Almost all of the instructions I've found want…
Abe
  • 22,738
  • 26
  • 82
  • 111
127
votes
19 answers

Query EC2 tags from within instance

Amazon recently added the wonderful feature of tagging EC2 instances with key-value pairs to make management of large numbers of VMs a bit easier. Is there some way to query these tags in the same way as some of the other user-set data? For…
Josh Lindsey
  • 8,455
  • 3
  • 24
  • 25
127
votes
3 answers

Cost of storing AMI

I understand Amazon will charge per GB provisioned EBS storage. If I create AMI of my instance, does this mean my EBS volume will be duplicated, and hence incur additional cost? Is there other cost charge in creating and storing an AMI (Amazon…
gerrytan
  • 40,313
  • 9
  • 84
  • 99
126
votes
8 answers

Can I change the root EBS device of my amazon EC2 instance?

I have an EBS backed Amazon EC2 instance. I would like to change the root device on this instance. Can you please advise the best way to go about this? I only find documentation on changing several attributes of block devices, but they don't seem to…
cone
  • 1,665
  • 3
  • 13
  • 13
124
votes
4 answers

How to open a web server port on EC2 instance

I'm running a CherryPy web server at 0.0.0.0:8787 on an EC2 instance. I can connect to the web server via local wget on the EC2 machine, but I can't reach the instance from my own remote machine (I connect to EC2 via ssh). Do I need to open up port…
Cat
  • 7,042
  • 8
  • 34
  • 36
123
votes
12 answers

Redirecting EC2 Elastic Load Balancer from HTTP to HTTPS

I want to redirect all the HTTP request to https request on ELB. I have two EC2 instances. I am using nginx for the server. I have tried a rewriting the nginx conf files without any success. I would love some advice on it.
Amit Badheka
  • 2,677
  • 4
  • 19
  • 29
122
votes
14 answers

How to find unused Amazon EC2 security groups

I'm try to find a way to determine orphan security groups so I can clean up and get rid of them. Does anyone know of a way to discover unused security groups. Either through the console or with the command line tools will work (Running command line…
Ray
  • 40,256
  • 21
  • 101
  • 138
118
votes
11 answers

AWS ECR GetAuthorizationToken

I've tried to follow AWS instructions on setting ECR authorization to my user by giving the AmazonEC2ContainerRegistryFullAccess policy to my user. However when I try to run on my PC the aws ecr get-login I get an error that I don't have…
Y. Eliash
  • 1,808
  • 3
  • 14
  • 23
118
votes
9 answers

Can you connect to Amazon ElastiСache Redis outside of Amazon?

I'm able to connect to an ElastiCache Redis instance in a VPC from EC2 instances. But I would like to know if there is a way to connect to an ElastiCache Redis node outside of Amazon EC2 instances, such as from my local dev setup or VPS instances…
118
votes
20 answers

EC2 Can't resize volume after increasing size

I have followed the steps for resizing an EC2 volume Stopped the instance Took a snapshot of the current volume Created a new volume out of the previous snapshot with a bigger size in the same region Deattached the old volume from the…
Wilman Arambillete
  • 1,411
  • 2
  • 11
  • 12