How to know the history of what happened in GCP - google-cloud-platform

I had a VM in my account, and out of nowhere, the VM just disappeared. Is there any way to review what was done and why?

Seems to be if you are using free trial You need to explicitly enable billing while during the trial, otherwise your instances will be shut down when the trial runs out. It is not possible to retrieve the instances that have been deleted once. If it has been stopped, it can be retrieved back by simply starting it again.
But During the creation of the Instance you could configure deletion rules to keep the boot disk when the instance is deleted. This can be configured in the submenu “Management, security, disks, networking, sole tenancy” in the Disks section.
Refer to this SO for more information.

You can review what has been done by Audit Logs on GCP. Audit logs help you answer "who did what, where, and when?" within your Google Cloud resources with the same level of transparency as in on-premises environments. This could help you determine what happened to your VM.
To view Audit Logs for Compute Engine, please refer to this doc. To read more about the Compute Engine Audit Logs, you can review this doc.

Related

Google cloud compute VM instance not getting listed

I lost my vm instance and a huge amount of data with it. I even paid the pending amount to google but when i went to the vm instance page, it is showing only create instance menu. How can i recover my old vm instance. Please help
As #John Hanley mentioned in comments " When a Google account is closed, GCP may impose an internal recovery period of up to 30 days, depending on past account activity. Once that grace period expires, it is marked for deletion ."

AWS is charging me but the Billing Console doesn't show what the issue is

AWS is charging me but the cost reports aren't showing enough detail to figure out why. I think it might be one EC2 instance I created for the tutorial but I can't figure out how to delete it. Can you help?
I signed up for Amazon free tier and I'm doing the tutorial on https://aws.amazon.com/getting-started/projects/build-modern-app-fargate-lambda-dynamodb-python/?e=gs&p=gsrc
It says on the first page "Many of the services used are included in the AWS Free Tier. For those that are not, the sample application will cost, in total, less than $1/day." So then I finished the first two modules of that tutorial and quit for the day -- I didn't shut down any services (cause the tutorial didn't tell me to) but today I got an email saying I've exceeded my $5 AWS threshold in only e days! The email has a link to a Cost Report that says it's spending $2.16 per day, but it won't tell me what!
I've gone through all the cost explorer reports and they confirm I'm spending money on EC2 but I can't find why. Can you help?
Here's a screenshot of the "Billing Management Console" -- says I spent that money on "EC2". But then when I drilled down into EC2 it wouldn't tell me exactly what.
So I clicked on the AWS Cost Management report and it says I'm spending $2.16 a day but it won't give any more granularity that that because all the advanced reports are monthly and don't yet show the last three days. (Apparently it lets you opt-in to daily/hourly reports but it says it charges a fee for that too so I didn't). So I don't know what specifically is charging.
So I clicked on the EC2 Dashboard. It said I'm using one volumne, 2 elastic ip addresses, and 4 security groups. I figured out how to delete the volume but I can't figure out how to delete the IP address or the security group. Are those charging me money? How do I delete them?
I went to the EC2 Instances and there is one "Volume" in use (basically a docker container created for the tutorial) so I deleted that, but that was well below what the Free Tier provides, so was that the source of my charges? Then I went to the Instances and it says there is one instance so I deleted that too. But it still says I have two IP addresses and comments below say I'm being charged for that.
How can I delete this IP addresses? There is no delete button.
How can I be 100% sure everything is deleted and I'm not getting any more charges?
Turns out the answer was actually a NAT Gateway VPN. That doesn't show up on the billing report screenshots above, but I eventually found it mentioned on the billing and then shut it off.
Unassigned ElasticIP will cost you money.
You delete ElasticIPs by Releasing them.
Security groups does not cost money. In general, for advanced users it is better to create all resources with CloudFormation stack so they can be all cleaned by deleting the stack.
If you have an Elastic IP assigned, and it's not in use, AWS charges you for it, if it's actually assigned to an EC2 instance and used, it's free. (To discourage people from hoarding Elastic IPs.)
When you're in the EC2 web console, click 'Running Instances'. What do you see? How many instances? How many stopped? How many running?
I don't think the security groups can be deleted, and I don't think AWS charges for them.

GCP billing support needed - services stopped and yet still get charge

i am a bronze GCP user who ended the trial. I need guide on why i still get charges when my VM are not running, disable google cloud SQL service.
Screenshot here
https://drive.google.com/open?id=1uuWPfg8eXjZWry3QUprWTsk5LDPc-YiT
Thank you for your input
I can't say for sure because your Google Drive link isn't publicly shared, but your charges could be due to the resources attached to your VM. From GCP's documentation on stopping an instance:
Your instances are not charged for per-second usage charges in TERMINATED state but any resources attached to the virtual machine will be charged until they are deleted, such as static IPs and persistent disks.
GCP billing support will likely be of more help to you in this case than Stack Overflow. Even if you don't have a premium support package you can still request a chat to resolve billing issues.

How to ensure AWS Elastic Beanstalk is free

I am wanting to deploy a Django webapp with a PostgreSQL database to AWS Elastic Beanstalk using this tutorial, but I am so confused about pricing. It says it uses services in the AWS Free Tier, but those seem to be limited to a certain number of hours a month, so how do I make sure I don't go above that threshold? And how do I make sure I'm only using free services? They even require a card on file, so it seems really hard to make sure I don't get charged.
You can do the following configuration to make sure you use AWS Elastic Beankstalk for one year free.
Use only Micro instances for the WebServer and RDS instance.
Limit the scaling of the WebServer maximum to 1 or use Standalone deployment without autoscaling.
When selecting storage, use less than 30GB for EBS and don't enable Provision Throughput.
Apart from these, there are usage base costs for Network, EBS IOPS & etc which includes a free quota and the cost is not considerable when it comes to light use cases.
The AWS Free Tier allows AWS accounts to use a certain amount of services for no charge. Any usage beyond the free tier limits will result in a charge on your credit card.
The Free Tier is intended to provide a trial of AWS services. It is not intended for production use, nor is there any guaranteed way to stay within the free limits. It is up to you to monitor your usage.
There is no such thing as a totally free AWS account.
I have found "Cost Management Preferences" -> "Receive Free Tier Usage Alerts" setting in Billing preferences menu. Hopefully this will be enough for a small personal projects with low usage. I would guess it is not enough for large projects since this is only a notification.
In short, you can absolutely make sure that your app stays free, just not from within the AWS interface. You'll have to use your own usage monitoring to ensure you stay within the free limits as others state.
As Ashan said, this is a pretty silly approach since fees are nominal and the alternative is a loss of service, however, AWS does offer APIs to help you do this through CloudWatch.
CloudWatch exposes pretty much all of the billable metrics on a service-by-service basis, for example here are the metrics for EC2, and here are the metrics for S3. After starting your services through beanstalk, just look up all the services you're using via the billing page of the AWS console, look up the CloudWatch APIs for each, then check them.
At least for EC2, there are even customizable alarms and actions, including shutting down the instance. See the Monitoring tab at the bottom of the EC2 console. Not sure, but you might have to manually throw status updates to their status system for some of the other metrics. If so, it's not that difficult. You'd set up an access key for some IAM identity so you can check CloudWatch stuff from command line. Then, you'd write a watchdog script to run on that instance using AWSCLI to regularly ping CloudWatch and call your shutdown code or modify your status if you're over some percentage of your quota.

AWS: How to disable all services?

I was dorking around with AWS (and related services), hoping that I could stay in the Free Tier, like I do when I'm exploring Google App Engine.
A few days ago, I get a letter from Amazon that they've charged me $33 or so for my 2 days of exploration.
This has got to end, but I forget what services I've enabled. Ideally, I'd just disable the AWS account entirely, as without a free sandbox there's no way I'm going to be using their service. Is there a global off button, or do I have to stumble around to turn all their services off individually? Or do I have to delete my CC information and just create a new Amazon account altogether?
You can close your entire account in AWS Billing: https://console.aws.amazon.com/billing/home?#/account
Or if you just want to disable your "Free-Tier" services that has charges, view them here:
https://console.aws.amazon.com/billing/home#/freetier
Then open your EC2 dashboard - and cancel those services:
https://us-west-2.console.aws.amazon.com/ec2
For example:
Stop running instances, delete volumes, remove elastic IPs, etc.
Otherwise, I recommend sending an email to webservices#amazon.com from the email you used to signup with their service.
I had an RDS running and I couldn't figure out how to cancel just that service
Here's how to do it:
Go to billing services
https://console.aws.amazon.com/billing/home?region=us-west-2#/
Click "Bill Details"
Inspect it
You'll find NAME OF SERVICE + ITS LOCATION. This is the information you need.
https://console.aws.amazon.com/rds/home?region=us-east-1
Go to topright of page. Select the correct server location
The rest is straightforward from here
I was also frustrated (by being charged on the free tier without any info/warning in prior) and found a simple and elegant solution to turn off all AWS services. You delete your account and forget about these fraudulent (to be honest) AWS services.
Here is the link:
https://console.aws.amazon.com/billing/home?#/account
Here is the section:
I know this is a somehow an old question, but I would like to add a new answer because I think AWS has changed a lot since this was asked. I have stumbled on a similar situation as the OP and I found out that there are 3 possible ways to achieve this:
To have a single turn-off-everything button, but I'm not sure if this exists.
Overkill, go through the services and check them one by one and shutdown/delete any instances or running services.
To find out the actual source of leaking (cost occurring services) by viewing what is posting charges on your account and then turn off these services one by one. This can be done by visiting:
your AWS account >> My Billing Dashboard
Find your account username and open the drop down menu:
You can check what services are incurring fees.
Percentage table:
I followed the services by searching for their name on AWS console, if I couldn't find it I'd Google how to do so and then turned them off one by one.
In my case, there was no charge towards my bank even thought billing showed I have some balance, I think it's because I was using the free tier, maybe?
I just hit my free tier limit. I terminated my ec2 instance, deleted my storage volume and even removed my security group and key pair so I have nothing now. Hopefully no charge :P
Always make sure you select the right region. I once had 2 instances running and didnt realize it.
Today I finally discovered a global view to detect all the active services, you still have to disable every service manually but at least you don't have to switch all the regions to understand where you have active services.