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
4 answers

How to track unused resources in AWS?

I have been using AWS for a while now. I always have the difficulty tracking AWS resources and how they are interconnected. Obviously, I am using Terraform but still, there is always ad-hoc operations that cut down my visibility. Since I have been…
user7161651
9
votes
2 answers

504 errors from Elastic Load Balancer using Tomcat

I have a application running on multiple EC2 instances and served by Apache Tomcat. I've set up an AWS Elastic Load Balancer in front of the application, and everything basically works as expected. However, I will occasionally get a random 504…
ittupelo
  • 812
  • 11
  • 18
9
votes
2 answers

Changing the auto-hibernate settings on a AWS Cloud9 EC2 Instance

While setting up the AWS Cloud9 EC2 instance, I selected 30 mins for auto-hibernation. I would like to change this to Never. How do I do that?
Saqib Ali
  • 3,953
  • 10
  • 55
  • 100
9
votes
8 answers

Can't add new command when connection is in closed state

I am using the Amazon EC2 with Ubuntu. I am running the server using the PM2, as pm2 start bin/www --log-date-format "YYYY-MM-DD HH:mm" --watch It works fine but when I am trying to access API after 1 or 2 days. I will get the error: 0|www |…
Ankur_009
  • 3,823
  • 4
  • 31
  • 47
9
votes
1 answer

assign static IP to LoadBalancer service using k8s on aws

Objective: create a k8s LoadBalancer service on AWS whose IP is static I have no problem accomplishing this on GKE by pre-allocating a static IP and passing it in via loadBalancerIP attribute: $ kubectl apply -f - <
333kenshin
  • 1,995
  • 12
  • 17
9
votes
7 answers

Cloud Front : The request could not be satisfied

I am coming across this problem, i have a chat server which needs to communicate to the lambda service hosted in aws , but cloud front throws the following error. BODY:
9
votes
4 answers

Architectural strategies to minimize cloud lock-in risk?

I would like to understand what is the best way to mitigate risk of vendor lock-in for cloud-based systems. For example, I'd like to deploy a multitude of different systems to, say, Amazon EC2 or Windows Azure, but I'd like to minimize the cost of…
kvista
  • 5,039
  • 1
  • 23
  • 25
9
votes
1 answer

Infrequent NGINX Errors/Timeouts when proxying to a Node/Express upstream (upstream timed out while connecting to upstream)

We have an Express web API deployed that gets a decent but still relatively small amount of traffic (around 10 requests per second on average) that is running on an EC2 ubuntu server that is proxied to through NGINX. Every so often, a request will…
Ryan Bickham
  • 91
  • 1
  • 5
9
votes
2 answers

Where is my python-flask app source stored on ec2 instance deployed with elastic beanstalk?

I just deployed a flask-python app with elastic beanstalk on AWS but cannot locate my app source files like application.py or templates/index.html etc I've looked at looked at /var/../.. or /opt/../.. etc but nowhere to be found. Is there an ebs…
9
votes
5 answers

Powershell get region from AWS metadata

I have an EC2 instance and I am running a Powershell script there where I would like to get the region that the EC2 is running in. Currently I have workaround like this which grabs the availability zone first. The availability zone is in the format…
William Ross
  • 3,568
  • 7
  • 42
  • 73
9
votes
3 answers

What root-device to use for a new EC2 instance?

I'm trying to get started with Amazon's EC2. I have to choose an image (AMI) to start with. I've settled on using the official Ubuntu AMI, but I have two options for the root store - "instant" or "ebs". (See this page). Being new to AWS, I'm not…
Edan Maor
  • 9,772
  • 17
  • 62
  • 92
9
votes
3 answers

How can I use advanced regex in a boto3 ec2 instance filter?

I'm trying to match EC2 instance names not starting with a hyphen (-), so I can to skip instance names starting with a - from the shutdown process. If I use a ^ or *, these basic regex operators work fine, but if I try to use more advanced pattern…
Robert Szot
  • 142
  • 1
  • 1
  • 10
9
votes
1 answer

How to manage Asymmetric (Public/Private) Keys in AWS

I need to develop a solution to store both symmetric and asymmetric keys securely in AWS. These keys will be used by applications that are running on EC2s and Lambdas. The applications will need to be set up with policies that will allow the…
9
votes
2 answers

Django CSRF Verification failed for admin panel

I started a fresh Django 1.11 project with one app, one model and one admin panel. Locally, everything works. When I deploy it to Amazon EC2 and try to log in to the admin panel, I get a 403 (CSRF verification failed. Request aborted.). I see this…
physicalattraction
  • 6,485
  • 10
  • 63
  • 122
9
votes
3 answers

How can one get current spot price via boto?

I am trying to fetch current spot price via boto in python using get_spot_price_history() function. conn = boto.connect_ec2(aws_key, aws_secret) prices = conn.get_spot_price_history("m3.medium", '2017-04-20T21:14:45.000Z',…
Shubham Verma
  • 129
  • 3
  • 14