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
9
votes
2 answers

Are Amazon's micro instances (Linux, 64bit) good for MongoDB servers?

Do you think using an EC2 instance (Micro, 64bit) would be good for MongoDB replica sets? Seems like if that is all they did, and with 600+ megs of RAM, one could use them for a nice set. Also, would they make good primary (write) servers too? My…
cbmeeks
  • 11,248
  • 22
  • 85
  • 136
9
votes
5 answers

Restoring a volume from a snapshot

Let's say I have an AMI with an attached EBS Volume. I also have a snapshot. I want to "restore" the EBS Volume to the snapshot. What's the best process to do this?
Dave
  • 2,735
  • 8
  • 40
  • 44
9
votes
1 answer

How do I create an EC2 image from a running instance using boto?

I'm trying to create a simple python backup script for my EC2 instances. This script's purpose is to create daily/weekly snapshots of the current machine (see this question on ServerFault). I'm using the boto python package for EC2 API, and would…
ripper234
  • 222,824
  • 274
  • 634
  • 905
9
votes
2 answers

how to deploy nodejs api and vuejs app in one server

I have developed node rest api and vuejs web applications, Im trying to deploy both project in to one aws server which run ubuntu. Both applications have different port, domain I try to configure api.example.com for api and example.com for vue…
Sampath
  • 308
  • 2
  • 5
  • 15
9
votes
3 answers

Can I stop a spot instance in aws just like I can stop and start an on demand ec2 instance

I had a use case where I was switching to using spot instances for my application instead of on demand instances. According to my requirement i should be able to stop that instance and restart it just the way we do it for on demand ec2-instances. In…
TheShobhit147
  • 125
  • 1
  • 1
  • 7
9
votes
1 answer

Issues with mongoRestore [listCollections requires authentication]

I am trying to restore a MongoDB on an EC2 instance. I am currently running Mongo 4.0. I am restoring a .tgz, which I then unzip, and it contains a directory with all of my files. I previously used this command: sudo mongorestore --db newDB…
DrummerGenius
  • 535
  • 2
  • 10
  • 25
9
votes
5 answers

how to get aws account number /id based on EC2 instance which is hosted in amazons

how to get aws account number /id based on EC2 instance ip which is hosted in amazon i have a instance name CTI server it is hosted in one AWS account. I have the details of CTI server like private ip and hosts and able to do ssh this instance…
Sandeep muthyapu
  • 281
  • 2
  • 3
  • 8
9
votes
1 answer

AWS Cloudwatch setup with Winston

I have been reading various articles/docs and watching some videos on this topic. My issue is that they all conflict in one way or another. My goal is to use winston to send all console.logs/error messages from my ec2 server to Cloudwatch so that no…
9
votes
5 answers

how do i setup ubuntu desktop in ec2

Been playing around with amazon ec2, so far I've been able to get ubuntu-desktop working (once) although it was a random set of hacks from blogs ive not been able to reproduce what made it work my setup windows box w/- putty, NX-Nomachine,…
MikeW
  • 185
  • 1
  • 3
  • 14
9
votes
4 answers

How to avoid the configuration error while using AWS API Gateway with VPC Link?

I have created the VPC Link using the Network Load Balancer (NLB) as per the AWS documentation and attached the same with the API Gateway resource / method. But it throws "Internal Server Error" when accessing the "Invoke URL" and displays this…
Kiran
  • 1,177
  • 4
  • 18
  • 35
9
votes
8 answers

Unhandled promise rejection: Error: URL malformed, cannot be parsed

I am new to aws and mongodb at the same time, so I'm stuck at a very basic point in trying to connect to my mongo databse, hosted on an amazon linux ec2 instance. The reason is, I'm not able to build the path to my database. Here is what I'm trying…
Jean-Baptiste
  • 1,552
  • 1
  • 19
  • 33
9
votes
3 answers

How to use dynamic key for `parameter-store` in AWS CodeBuild spec file?

I have a buildspec.yml file in my CodeBuild that I want to read values out of EC2 Systems Manager Parameter Store. CodeBuild supports doing this via the parameter-store attribute in your spec file. Problem is, I can't figure out how to use…
9
votes
4 answers

Deploying a PHP webapp to multiple EC2 instances behind a Elastic Load Balancer

my question is basically two questions, but since they are closely related I thought that it makes sense to ask them en-bloque. Case: I am running a webapplication, which is distributed over multiple AWS EC2 instances behind a AWS Elastic Load…
Joshua
  • 116
  • 1
  • 3
9
votes
1 answer

Iterate over files in an S3 bucket with folder structure

I have an S3 bucket. Inside the bucket, we have a folder for the year, 2018, and some files we have collected for each month and day. So, as an example, 2018\3\24, 2018\3\25 so forth and so on. We didn't put the dates in the files inside each days…
DataDog
  • 475
  • 1
  • 9
  • 23
9
votes
1 answer

Installing pyOpenSSL on Amazon Linux (EC2)

I'm using the first default AMI for amazon Linux on ec2 and can't seem to install pyOpenSSL. I tried: sudo wget http://launchpad.net/pyopenssl/main/0.11/+download/pyOpenSSL-0.11.tar.gz && easy_install pyOpenSSL-0.11.tar.gz. Results were: error:…
Alex Amato
  • 1,591
  • 4
  • 19
  • 32