AwsClient

This gem wraps access to various AWS APIs under one umbrella. The following are configured:

  • RDS
  • Cloudformation
  • S3
  • EC2
  • ELB

It exposes access to the above APIs from a single flex-point.

Rationale

The use cases covered are in no way exhaustive - this aids in solving very specific problems.

Installation

Assumptions

You will need a file named .fog in your home directory. The format is as follows:

  ORG_KEY:
    aws_access_key_id: ACCESS_KEY
    aws_secret_access_key: SECRET_ACCESS_KEY

then you will need to

  gem install aws_client

Then include it in your project

  require 'aws_client'

Usage

Connecting

  # ::AwsClient::Container.new(ORG_KEY, AWS_REGION, PROVISIONING_REGION) e.g.
  aws_clients = ::AwsClient::Container.new(ORG_KEY, "eu-west", "eu-west-1")

  # Rds client wrapper
  rds_client = aws_clients.rds

  # Cloudformation client wrapper
  cf_client = aws_clients.cloudformation

  # S3 client wrapper
  s3_client = aws_clients.s3

  # EC2 client wrapper
  ec2_client = ec2_client.ec2

  # ELB client wrapper
  elb_client = ec2_client.elb

Each client wrapper above is merely a wrapper for the underlying AWS client, from which the underlying client may be exposed, e.g.

  aws_clients = ::AwsClient::Container.new("My organisation", "eu-west", "eu-west-1")

  # Wrapper
  rds_client = aws_clients.rds

  # Underlying client
  underlying_client = rds_client.client 

Each client wrapper exposes some additional functionality useful to me, but may easily be monkey patched to add functionality (I find working with AWS APIs often exhausting, especially when working with Cloudformation where orchestration tasks may involve the use of multiple APIs in sequence).

Specific usage examples

... more to come as I hook this up