CloudFormation template for mining Ravencoin (RVN), Ergo (ERG), Kaspa (KAS), and Ethereum Classic (ETC) altcoins on AWS GPU-enabled EC2 instances, with a support for payouts in Bitcoin (BTC)
Crypto mining on AWS is not always profitable. Do your own research!
Reach out to me if you need help with any customisation, e.g. to add support for other crypto currencies, etc.
You will have an opportunity to check the stack details, enter the wallet address, etc, before the stack is launched.
The following Opt-in regions must be enbled in AWS Account settings before use...
Region | Default VPC | Custom VPC |
---|---|---|
af-south-1 Cape Town | Launch to Default VPC | Launch to Custom VPC |
ap-east-1 Hong Kong | Launch to Default VPC | Launch to Custom VPC |
eu-south-1 Milan | Launch to Default VPC | Launch to Custom VPC |
me-south-1 Bahrain | Launch to Default VPC | Launch to Custom VPC |
Not all instance types are available in all regions. Use the table below to choose the region which supports your desired instance type.
Also note that the Spot and On-Demand prices differ between the regions. The US regions are typically slightly cheaper but often have availability issues, especially on Spot. The non-US regions are a little more expensive but may have the desired instance types available more readily.
All right you have created the stack but no instances seem to be running. If you navigate to EC2 -> Autoscaling groups -> miner -> Events tab you may see this error:
Failed: Launching a new EC2 instance.
Status Reason: Max spot instance count exceeded. Launching EC2 instance failed.
AWS accounts have default limits (quotas) on some resources. You may find, for example, that your quota for
All G and VT Spot Instance Requests in a particular region is 0 and you therefore can't start any g4dn.xlarge
instances.
It pays to request the quotas increase which can be done with this simple command (you can do this from the CloudShell):
export AWS_REGION=us-west-2 # Oregon
export CODE=L-3819A6DF # All G and VT Spot Instance Requests (for g5.xlarge, g4dn.xlarge, etc)
# export CODE=L-7212CCBC # All P Spot Instance Requests (for p3.2xlarge, p3dn.24xlarge or p4d.24xlarge)
export VCPUS=96 # 96 vCPUs - can accommodate e.g. 24x g4dn.xlarge or 1x p4d.24xlarge
aws --region ${AWS_REGION} service-quotas request-service-quota-increase --service-code ec2 --quota-code ${CODE} --desired-value ${VCPUS}
Choose the number of vCPU and the Quota code according to your needs.
Spot instance capacity for g4dn.xlarge
instances is in short supply in the cheapest regions, even though the spot
prices are still very very low. You may have to wait for a long time to get an instance.
Interestingly the Los Angeles local zone seems to have plenty of g4dn spot capacity at the same price as Oregon, however you have to opt-in to be able to use it. Here is how (you can do this from the CloudShell):
aws --region us-west-2 ec2 modify-availability-zone-group --group-name us-west-2-lax-1 --opt-in-status opted-in
aws --region us-west-2 ec2 create-default-subnet --availability-zone us-west-2-lax-1a
aws --region us-west-2 ec2 create-default-subnet --availability-zone us-west-2-lax-1b
Check out the instructions in my Medium article, it contains some important considerations. Alternatively, if you think you know what you are doing follow these instructions:
Michael Ludvig, you're welcome :)