Posts

Showing posts with the label amazon-ec2

Multiple cron jobs in different files in AWS ec2

Image
Clash Royale CLAN TAG #URR8PPP Multiple cron jobs in different files in AWS ec2 I am using AWS ec2 for my projects.I Have more than 10 domain in one ec2 instance also which has more than 5 cron for each domain.Can i create different files for crontab. If create all the cron jobs code in a single file it is little bit confusing By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Terraform - having timing issues launching EC2 instance with instance profile

Image
Clash Royale CLAN TAG #URR8PPP Terraform - having timing issues launching EC2 instance with instance profile I'm using Terraform to create my AWS infrastructure. I've a module that creates an "aws_iam_role", an "aws_iam_role_policy", and an "aws_iam_instance_profile" and then launches an EC2 Instance with that aws_iam_instance_profile. "terraform plan" works as expected, but with "terraform apply" I consistently get this error: * aws_instance.this: Error launching source instance: InvalidParameterValue: IAM Instance Profile "arn:aws:iam::<deleted>:instance-profile/<deleted>" has no associated IAM Roles If I immediately rerun "terraform apply", it launches the EC2 instance with no problem. If I run a "terraform graph", it does show that the instance is dependent on the profile. Since the second "apply" is successful, that implies that the instance_policy and all that it entai...

Can not connect with AWS : Connection time out error

Image
Clash Royale CLAN TAG #URR8PPP Can not connect with AWS : Connection time out error I am using ssh command to connect with AWS instance : ssh -i ./abcd.pem ubuntu@ec2-**-***-**-**.us-east-2.compute.amazonaws.com ssh -i ./abcd.pem ubuntu@ec2-**-***-**-**.us-east-2.compute.amazonaws.com These are my inbound rules : Earlier It was working well suddenly it started giving this error I have also tried with different networks still the same problem. 1 Answer 1 Assuming that AWS hasn't stopped you from connecting because you're out of money, the simplest explanation is that your host is simply unstable and needs to be rebooted. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

unable to resolve host on ec2 instance

Image
Clash Royale CLAN TAG #URR8PPP unable to resolve host on ec2 instance I SSH'ed into the server to do some updates, along the way I lost HTTP connectivity to the web site. When I was updating, after encountering problems with yum, one of the things I read and tried, without really understanding was: sudo dhclient It's just about about the only thing that seemed to network related. When I try the following from my PC: curl -v http://sub.my-web-site.com/ the result: * Hostname was NOT found in DNS cache * Could not resolve host: sub.my-web-site.com * Closing connection 0 curl: (6) Could not resolve host: sub.my-web-site.com When I try connect via the IP address, one of the virtual hosts seems to respond. I have rebooted the instance a couple of times to no avail. I don't seem to recall changing any settings on the instance and it doesn't seem to be a part of a VPC. The DNS is in route 53, and after rebooting, the public IP of the instance changed, so I updated in route 53 ...

aws billing information using aws java sdk

Image
Clash Royale CLAN TAG #URR8PPP aws billing information using aws java sdk I'm trying to get the billing information from aws for ec2 instances, s3 buckets and ebs volumes using java api. I want to create api that gives specific entity wise hourly billing reports. Is there any java api for getting the same? I couldn't find the same in aws java sdk api documentation. 5 Answers 5 There are no APIs to get AWS billing information. Instead what you can do is: For more information: See here I'm actually looking for any API that gives me usage with pricing. Is there any aws api that will provide me usage for EC2 instances, EBS volumes and S3 storage ? – bagui Dec 2 '14 at 10:35 Try getCostAndUsage in the Java SDK : doc...