AWS allowing access to Billing to IAM user

Problem

When you create a new AWS account the access to Billing for IAM users is not enabled by default.

Solution

In order to allow access you have to follow the steps below:

  • Login to your AWS account with your root user (email and password)
  • Go to the top right drop down ‘My Account’
  • Find the section that is called ‘IAM User and Role Access to Billing information’, use ‘Edit’, tick the box ‘Enable access’ and then ‘Update’.

More information can be found in the Amazon’s help page https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/control-access-billing.html#ControllingAccessWebsite-Activate

Getting rails console on an amazon aws server when using rvm

Problem

You would like to get access to your rails application console on an Amazon ec2 instance, and you are also using rvm.

Solution

  • Login with ssh to your server as normal:
    ssh name@myserver.com -i amazon_key
  • Go to your application’s current folder:
    cd /my/project/directory/current/
  • Run the following replacing the environment with your specific environment (ie production,beta,staging etc):
    bundle exec rails c environment

Enabling MySQL server to be remotely accessible in Amazon EC2

Problem

You want to make your instance’s mysql server in Amazon available remotely, and you have set the firewall setting in your security group to allow access to port 3306, but you get the following error:

ERROR 2003 (HY000): Can't connect to MySQL server

Solution

You would need to edit your /etc/mysql/my.cnf file to allow access to the mysql server by changing the line:

bind_address 127.0.0.1

to

bind_address AMAZON_PRIVATE_IP

Make sure that the IP used is the private ip and not the Elastic IP.
You should be able to find that in your instance control panel.