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.

Filter by
Sorted by
Tagged with
0 votes
1 answer
6 views

What does the ASCII art on the 𝘼𝙢𝙖𝙯𝙤𝙣 𝙇𝙞𝙣𝙪𝙭 2 𝘼𝙈𝙄 MOTD mean?

When logging in to an Amazon Linux EC2 instance, one is greeted by the following MOTD: What does this ASCII art try to convey?
user avatar
0 votes
1 answer
22 views

Terraform: Why is null_resource's remote-exec not connecting to aws_instance via SSH?

I've been going through answers to similar questions on this StackExchange and on StackOverflow and reading through documentations all day ... Here's the .tf file I'm executing: # defines the AWS ...
user avatar
0 votes
1 answer
26 views

Issue in running docker container on ecs

I am trying to run container on ecs but there is one specific image which is not running and give me error. I can see in docker container ec2 that image is pulled and it tried to run but it gave ...
user avatar
0 votes
1 answer
19 views

Unable to ssh into EC2 instance to the peered VPC which is in different region

It's a very simple setup in which there are two EC2 instances each in a different region but under the same account. Both are peered. Requester EC2 EC2Virginia has the following details: Public IP: 34....
user avatar
1 vote
1 answer
23 views

Create AWS SG and use it

I am trying to create a security group (SG) using Terraform and then use it for an AWS instance. My config looks like resource "aws_security_group" "my_sq" { vpc_id = aws_vpc....
user avatar
  • 113
0 votes
0 answers
20 views

High AWS (EC2) while running Docker

I am trying to optimize an AWS account, based on cost explorer. My problems are the following: The daily cost is about 5-6 USD. It seems to be high. Currently 3 applications are running, using: - 3x ...
user avatar
  • 1
0 votes
1 answer
15 views

aws status check issue

I have an instance on aws free tier t3.micro. The problem Which I faced is suddenly my instance was not able to connect with other instance. I have checked on dashboard and see that on status check ...
user avatar
  • 101
2 votes
1 answer
35 views

Should I expect EC2 instances to act up?

I recently had an issue with an EC2 instance. Briefly, the site was unavailable for 2 hours, a peak of CPU usage for no apparent reason, network traffic dropped close to 0, docker containers restarted,...
user avatar
  • 133
0 votes
0 answers
37 views

After launching from AMI, how to make the AWS Instance to be able to retrieve metadata?

I have a Windows Server 2016 instance and I created a snapshot of it. And then I deleted the instance. Now, when I create AMI from that snapshot and launch instance from that AMI, I cannot decrypt the ...
user avatar
0 votes
0 answers
8 views

Parallel testing Desktop Win Ui 3 application delivered as .msix?

I'm looking for best solution to perform Appium (Windows application driver) UI Tests on WinUI3 Application in parallel. UI tests take control over mouse, so it's impossible to test more that one ...
user avatar
  • 1
2 votes
0 answers
84 views

How to speed up environment loading on network drive?

Background: I have about 15 AWS EC2 instances running Windows. They each have local drives and share a single network drive. Each needs to be able to run certain in-development python tools from ...
user avatar
  • 21
0 votes
1 answer
33 views

How can we setup the services in my EC2 instance to startup automatically on boot?

When ever I restart my EC2 instance I have to manually use the command systemctl start <service name > to start the service. Is there any option to automate this thing in the Linux platform?
user avatar
2 votes
1 answer
34 views

What are minimum permissions required for an IAM user to provision EC2 instances?

I want to provision an EC2 instance with Ansible. So for that purpose I want to create a separate IAM user to keep things clear. I can assign the full EC2 access to the user. But I don't want any ...
user avatar
1 vote
1 answer
109 views

Where to get OS Hardening Scripts for CIS Hardening Standards?

CIS provides benchmarks for hardening OS on AWS CIS also provides images which meet their own benchmarks above These CIS images are available here - https://www.cisecurity.org/blog/everything-you-need-...
user avatar
  • 225
1 vote
1 answer
146 views

How to mount EC2 intances to AWS EFS via Terraform [closed]

I'm trying to Terraform a few EC2 instances, and would like to automate the provisioning steps that involve mounting their filesystems to EFS. The commands to run this manually are as follows: $ sudo ...
user avatar
0 votes
0 answers
84 views

Terraform cannot destroy with EBS volume attached

to detach from Instance (): unexpected state 'busy', wanted target 'detached'. last error: %!s(<nil>) I get the above error when I try to run terraform destroy. I think the ebs volume must be ...
user avatar
0 votes
0 answers
39 views

Gitlab (self hosted gitlab) pipeline fail when trying to fetch repository

I've setup own gitlab server on AWS EC2 Instance based on this image - https://aws.amazon.com/marketplace/pp/prodview-w6ykryurkesjq?ref_=aws-mp-console-subscription-detail and assign Elastic IP for ...
user avatar
0 votes
0 answers
16 views

Restricting one module for one tf file

So I have file called main.tf in which I am calling the existing module for iam_role, but in same main.tf I have called one more module for service_role but I want to restrict that service_role module ...
user avatar
  • 1
1 vote
0 answers
51 views

Deployment with Docker tensorflow/serving fails when training the model on another machine

I'm following the Coursera TensorFlow Serving with Docker for Model Deployment course. You have to train a simple Tensorflow model and export it in Protobuf. tf.saved_model.save(model, path) Then you ...
user avatar
  • 111
2 votes
1 answer
130 views

How to configure EC2 inbound rules for GitHub Actions deploy

I have a GitHub Actions workflow to deploy a service to an EC2 instance. I have currently opened the SSH access to all IPs but I want to restrict this to IPs used by GitHub Actions runners. However, ...
user avatar
  • 123
1 vote
2 answers
90 views

AWS EC2: RDP without exposing instance to public

I'm planning to use AWS EC2 instances for the development purpose of my web application. So, I will like to disable all the outbound ports except RDP(3389) port. The RDP port will only be open to a ...
user avatar
  • 23
3 votes
3 answers
83 views

Should I shut down the staging environment when the deployment test ends?

I have a small application deployed on an EC2 instance. I need a staging environment so I've thought of two choices: Deploy the same app again on the same instance, and that would be a staging ...
user avatar
  • 131
1 vote
1 answer
31 views

Common permissions for EC2 usage and VPC Security Groups in enterprise use

Context: Looking to create some software that acts as middleware to a user's AWS account, where the user will provide their cloud credentials, and have the software use their EC2 instances. Question: ...
user avatar
  • 13
1 vote
1 answer
112 views

AWS: Restoring database snapshot to different environment

I've a webapp hosted on AWS. This has Electric Beanstalk, with EC2 and then a RDS Postgres database at the bottom. There's prod, UAT and staging environments and databases. I want to take a recent ...
user avatar
  • 111
0 votes
1 answer
79 views

Setting up CircleCI to AWS EC2 for a simple node application deployment

I have a simple node application running on the EC2 instance, everything is working just fine and I want to integrate this application with CircleCI for the continuous deployment. I have been ...
user avatar
0 votes
2 answers
258 views

Kubernetes etcd bootstrapping - couldn't find local name <name> in the initial cluster configuration

I followed kelsey Hightower's setting up kubernetes the hard way tutorial kubernetes the hard way on AWS Stuck on bootstrapping etcd on the first control plane node. There are 2 lines in the error ...
user avatar
  • 13
0 votes
1 answer
109 views

How do I create a LAMP server via EC2 Image Builder?

I am trying to set up a resilient way to deploy our monolithic web app on an AWS EC2. My current setup uses Ansible to "manually" install the components for a LAMP server on the latest ...
user avatar
1 vote
1 answer
52 views

Do any services other than EC2s consume ip addresses in AWS?

SCENARIO: I am running out of free ips in my AWS subnets. I would like to talk to my infra team and request them to create new subnets. But they are asking me list of all ips I have consumed so far ...
user avatar
  • 225
3 votes
1 answer
75 views

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

I am aware there's a Tag Editor in AWS Console which allows us to export details of all EC2s in an AWS account. However that list seems to be missing ami and operating system of the EC2. Is there a ...
user avatar
  • 225
0 votes
1 answer
67 views

Is it possible to deploy RDS in multiple region in AWS with read and write replica

I have an application that I need to make it accessible across 4 regions, I saw blogs and other posts in the internet that speaks about the read replica of AWS RDS MySQL Server, is it possible to ...
user avatar
  • 113
1 vote
1 answer
475 views

ansible-playbook: how to dynamically, conditionally set a large deployment environment (variable space) in a playbook?

I am using an ansible playbook to deploy a php web application in aws. The deployment is repeated many times, with a different environment, for each customer. The different scenarios range from ...
user avatar
1 vote
1 answer
160 views

How CircleCI, Terraform and AWS should interact in CI/CD Pipeline

I'm new to devops and I'm have a hard time finding resources to help me with this question. My Goal is to have an automated CI/CD pipeline to launch my project. Basically I have a GitHub repo with a ...
user avatar
0 votes
2 answers
67 views

How to get code onto aws ec2 instance using terraform and gitlabs

I've just started learning Terraform (utilizing the AWS provider) and I have managed to replicate our infrastructure which includes quite a few amazon web services. I can successfully deploy it and ...
user avatar
1 vote
1 answer
28 views

Cost minimization in aws parallel cluster

I'm new to aws cloud service. I have to create a parallel cluster in aws. So, I'm using aws parallel cluster. But the problem is, when creating a cluster the NAT gateway billing me when I'm not using ...
user avatar
1 vote
2 answers
462 views

ansible & jinja2: How to reference JSON structure items whose keys are variables?

I am using ansible's community.aws.iam_server_certificate_info module to get information about a server certificate on aws ec2, and registering it as a variable "server_cert_info_result" ...
user avatar
3 votes
2 answers
7k views

How do I use the remote-exec provisioner with Terraform?

I am using Terraform 0.14 and AWS. I am trying to write a .tf file that will invoke a remote-exec command via Terraform's provisioner. This code does not work: resource "aws_instance" "...
user avatar
0 votes
1 answer
218 views

how to set automatic git pull from bitbucket and complie project on ec2 instance create event with auto scaling

I have just started reading about AWS services. I have a project where the backend is created with Spring-Boot, front-end is created with React and PostgreSQL is used as database. Both backend and ...
user avatar
1 vote
1 answer
229 views

Is it possible to have an aws EKS infrastructure as code?

Is it possible to declare "a complete production level EKS with other aws services" using terraform? I know that terraform has an eks module and an aws provider. But I'm not sure if one can ...
user avatar
  • 155
2 votes
1 answer
665 views

what is difference between "sudo shutdown now" versus "aws ec2 stop-instances"

When logged onto a AWS EC2 instance say some Ubuntu box and I issue sudo shutdown now how is that different from stopping the same instance using aws ec2 stop-instances --instance-ids $...
user avatar
1 vote
1 answer
489 views

How do I SSH into an EC2 instance from AWS gitlab-runner?

I have setup my own gitlab-runner on AWS following GitLab's walkthrough (Autoscaling GitLab Runner on AWS EC2). One step in my deployment is to SSH into another EC2 instance. The SSH connection fails ...
user avatar
  • 113
0 votes
1 answer
378 views

Ansible No such file or directory error message for any executable in Amazon Linux AMI

I'm trying to run this command in a Amazon Linux AMI instance - name: Run docker shell: systemctl enable docker && systemctl start docker And receiving this error message "stderr&...
user avatar
1 vote
1 answer
251 views

Using a combination of Terraform and Ansible to create dynamic AWS EC2 infrastructure

The company I work for wants to prevent provider lock-in adn therefore told us to use Terraform+Ansible instead of Cloudformation. We already decided to use terragrunt as an addon. While the ...
user avatar
  • 163
1 vote
0 answers
46 views

Power on AWS EC2 hosts by specifying their ansible hostnames

I have inventoried my AWS EC2 hosts using the ansible Ec2 inventory plugin. I would like to be able to power on hosts that are currently powered off, by specifying hostname patterns in ad-hoc ansible ...
user avatar
1 vote
1 answer
595 views

Can you inherit a template_cloudinit_config in another template_cloudinit_config object in Terraform?

I recently discovered template_cloudinit_config within Terraform, and I'm hoping I can utilize it to specify something like the code below. Basically my goal is to declare a core ...
user avatar
  • 13
0 votes
1 answer
18 views

AWS elb vs google cloud for multiple small nodejs mini-apps deployment

Currently i use AWS ELB --single instances do deploy & manage multiple versions of the same nodejs app (over 10), which differ only by the configuration. Each app is running some endless process ...
user avatar
1 vote
1 answer
277 views

AWS t4g instance type not eligible

According to the blog post since september/2020 and up to december/2020 instance type t4g will be available. I'm trying to create a machine, on one of the right zones (Oregon) according the FAQ, and ...
user avatar
  • 121
1 vote
0 answers
663 views

Ansible/AWS dynamic inventory -- How to create groups based on tags?

I am trying to create custom groups, based on tags. I am using this doc as a reference: https://docs.ansible.com/ansible/latest/plugins/inventory.html#inventory-plugins As a baseline, in my aws_ec2....
user avatar
  • 51
1 vote
2 answers
610 views

Ansible - merging inventories to share variables across?

Is it possible to merge inventories so I can share variables across them? Let's say I have two inventory files. Inventory A and Inventory B. They are both in a directory called inventories. Variables ...
user avatar
  • 51
0 votes
1 answer
6k views

Ansible playbook error: "Connection timed out during banner exchange"

I am trying to connect to my bastion host and then tunnel that ssh connection to connect to a jenkins host but keep running into the connection timed out error. The error message in full is: fatal: [&...
user avatar
1 vote
1 answer
379 views

Ansible dynamic inventory using AWS plugin -- how to obtain internal DNS records or private IP?

Seeking help from those who've worked with dynamic inventory in Ansible. I have Ansible set up with the aws_ec2 plugin (not using the python script as it's been too problematic). Currently, I'm only ...
user avatar
  • 51