amazon-ec2

AWS EC2 UserData Script Doesn't Fire on t3 instances

此生再无相见时 提交于 2020-04-18 03:47:29
问题 I have a pretty simple userdata script that installs the CodeDeploy agent on ubuntu and then emits a signal to CloudFormation indicating the instance is healthy. My stack is deployed using CloudFormation, which sets up an ASG, LaunchTemplate, TargetGroup, etc. The target instance type is Ubuntu 18.04 (ami-07ebfd5b3428b6f4d AMI) on t3.small instances. I previously had the same problem on a different AMI, but upgrading to ami-07ebfd5b3428b6f4d seemed to fix it temporarily...it worked for

Force AWS library to obtain region from environment inside docker cluster

只愿长相守 提交于 2020-04-17 22:40:46
问题 I’m trying to test a Java app running in a docker container on my desktop. The app runs fine if I execute it directly from my command line, but it fails when I try to run it inside a Docker container on my desktop. The error output shows that the library is requesting region information, then failing with this error: com.amazonaws.SdkClientException: Unable to find a region via the region provider chain. Must provide an explicit region in the builder or setup environment to supply a region. I

How to automatically start, execute and stop EC2?

寵の児 提交于 2020-04-17 22:05:14
问题 I want to test my Python library in GPU machine once a day. I decided to use AWS EC2 for testing. However, the fee of gpu machine is very high, so I want to stop the instance after the test ends. Thus, I want to do the followings once a day automatically Start EC2 instance (which is setup manually) Execute command (test -> push logs to S3) Stop EC2 (not remove) How to do this? 回答1: It is very simple... Run script on startup To run a script automatically when the instance starts ( every time

AWS cluster not able to access resource present in container

感情迁移 提交于 2020-04-17 20:23:19
问题 I just created a cluster,task definition and a service.Container is running successfully but not able to access resource present in container.I am trying to access with Public DNS ipv4 getting This site can’t be reached ec2-xx-xx-xxx-xx.ap-south-1.compute.amazonaws.com refused to connect 来源: https://stackoverflow.com/questions/60101541/aws-cluster-not-able-to-access-resource-present-in-container

AWS cluster not able to access resource present in container

我是研究僧i 提交于 2020-04-17 20:23:03
问题 I just created a cluster,task definition and a service.Container is running successfully but not able to access resource present in container.I am trying to access with Public DNS ipv4 getting This site can’t be reached ec2-xx-xx-xxx-xx.ap-south-1.compute.amazonaws.com refused to connect 来源: https://stackoverflow.com/questions/60101541/aws-cluster-not-able-to-access-resource-present-in-container

Running Node app via PM2 on port 80

北战南征 提交于 2020-04-12 11:55:36
问题 I have an express that I want to run on port 80. --> app.listen(80); I'm using PM2 to manage the app (restarting, stopping, monitoring, etc.) . I have a deployment shell script whose last command is PM2 restart index . From the console output, I see no errors and PM2 reports that it successfully completed the command. Yet when I got to my.ec2.ip.address:80 the site is not up. Furthermore, if I run node index.js in my server project directory, I get a Error: listen EACCES 0.0.0.0:80 . This

Error when Ec2 running as a role tries to get a Session Token in AWS

对着背影说爱祢 提交于 2020-04-12 09:52:28
问题 I'm running a app on an EC2 using a role with the the permissions: "sts:GetSessionToken", "sts:AssumeRole" When I try to obtain temporary credentials using that role, I get the error: Cannot call GetSessionToken with session credentials (Service: AWSSecurityTokenService; Status Code: 403; Error Code: AccessDenied; Am I missing one or more permissions for the role to be able to obtain temporary session credentials? 回答1: According to AWS support, roles cannot request temporary credentials. Only

Error when Ec2 running as a role tries to get a Session Token in AWS

我与影子孤独终老i 提交于 2020-04-12 09:51:17
问题 I'm running a app on an EC2 using a role with the the permissions: "sts:GetSessionToken", "sts:AssumeRole" When I try to obtain temporary credentials using that role, I get the error: Cannot call GetSessionToken with session credentials (Service: AWSSecurityTokenService; Status Code: 403; Error Code: AccessDenied; Am I missing one or more permissions for the role to be able to obtain temporary session credentials? 回答1: According to AWS support, roles cannot request temporary credentials. Only

Automatically accept rsa fingerprint using pscp

做~自己de王妃 提交于 2020-04-11 18:10:08
问题 When you're using pscp to send files to a single machine is not a big deal because you will get the rsa fingerprint prompt once and never again after. But if you want to connect to 200 machines, you definitely don't want to type "yes" 200 times.... I'm using pscp on a Windows machine and I really don't care about the fingerprint, I only want to accept it. I'm using Amazon EC2 and the finger print change every time i restart the machines.... If there is a way to avoid it using pscp or a

Getting error while deploy django apps in aws elastic beanstalk

喜夏-厌秋 提交于 2020-04-11 12:14:03
问题 [Instance: i-*****************] Command failed on instance. Return code: 1 Output: (TRUNCATED)...) File "/usr/lib64/python2.7/subprocess.py", line 541, in check_call raise CalledProcessError(retcode, cmd) CalledProcessError: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 1. Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py failed. For more detail, check /var/log/eb-activity.log using console or EB CLI. i'm