goamz

Differences between revisions 8 and 9
Revision 8 as of 2012-03-09 17:31:02
Size: 2999
Editor: 201-66-216-213
Comment:
Revision 9 as of 2012-03-24 05:51:37
Size: 3003
Editor: c-67-168-8-25
Comment: Fixed documentation URL
Deletions are marked like this. Additions are marked like this.
Line 34: Line 34:
  * http://goneat.org/launchpad.net/goamz   * http://goneat.org/pkg/launchpad.net/goamz

What is it?

The goamz package enables Go programs to interact with the Amazon Web Services.

It was developed within Canonical as part of an experiment related to using the Go language with the juju project, but is now a set of generally adopted and maintained Go packages that talk to several Amazon Web Services.

The API of AWS is very comprehensive, though, and goamz doesn't even scratch the surface of it. That said, it's fairly well tested, and is the foundation in which further calls can easily be integrated. We'll continue extending the API as necessary.

The following packages are available at the moment:

  • launchpad.net/goamz/aws
  • launchpad.net/goamz/ec2
  • launchpad.net/goamz/s3
  • launchpad.net/goamz/exp/mturk
  • launchpad.net/goamz/exp/sdb
  • launchpad.net/goamz/exp/sns

Packages under exp/ are still in an experimental or unfinished/unpolished state.

API documentation

The API documentation is currently available at:

Example

Here is a simple example which connects to AWS and creates an instance (make sure you shut it down afterwards):

package main

import (
    "launchpad.net/goamz/aws"
    "launchpad.net/goamz/ec2"
)

func main() {
    auth, err := aws.EnvAuth()
    if err != nil {
        panic(err.String())
    }
    e := ec2.New(auth, aws.USEast)

    options := ec2.RunInstances{
        ImageId:      "ami-ccf405a5", // Ubuntu Maverick, i386, EBS store
        InstanceType: "t1.micro",
    }
    resp, err := e.RunInstances(&options)
    if err != nil {
        panic(err.String())
    }

    for _, instance := range resp.Instances {
        println("Now running", instance.InstanceId)
    }
    println("Make sure you terminate instances to stop the cash flow.")
}

This example will generate the following output:

Source code

To obtain the source code, use Bazaar to download projects from Launchpad:

$ bzr branch lp:goamz

Reporting bugs

Please report bugs at:

How to build and install goamz

Just use "go get" with any of the available packages. For example:

$ go get launchpad.net/goamz/ec2
$ go get launchpad.net/goamz/s3

Running tests

To run tests, first install gocheck with:

$ goinstall launchpad.net/gocheck

Then run go test as usual:

$ go test launchpad.net/goamz/...

If you want to run integration tests (costs money), set up the EC2 environment variables as usual, and run:

$ gotest -i

Mailing list

To talk about usage and development of goamz, please join the mailing list:

License

goamz is licensed under the LGPL.

goamz (last edited 2015-01-09 12:05:39 by 176-12-31-220)