Coder Social home page Coder Social logo

dafyddcrosby / aws-sdk-go Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aws/aws-sdk-go

0.0 3.0 0.0 12.68 MB

AWS SDK for the Go programming language.

Home Page: http://aws.amazon.com/sdk-for-go/

License: Apache License 2.0

Ruby 0.08% Makefile 0.02% Go 99.61% HTML 0.04% Gherkin 0.25%

aws-sdk-go's Introduction

AWS SDK for Go

API Reference Join the chat at https://gitter.im/aws/aws-sdk-go Build Status Apache V2 License

aws-sdk-go is the official AWS SDK for the Go programming language.

Checkout our release notes for information about the latest bug fixes, updates, and features added to the SDK.

Release v0.9.0rc1 introduced a breaking change to the SDK. See the release notes for details of the change and instructions to migrate to the latest SDK version.

Caution

The SDK is currently in the process of being developed, and not everything may be working fully yet. Please be patient and report any bugs or problems you experience. The APIs may change radically without much warning, so please vendor your dependencies with Godep or similar.

Please do not confuse this for a stable, feature-complete library.

Note that while most AWS protocols are currently supported, not all services available in this package are implemented fully, as some require extra customizations to work with the SDK. If you've encountered such a scenario, please open a GitHub issue so we can track work for the service.

Installing

Install your specific service package with the following go get command. For example, EC2 support might be installed with:

$ go get github.com/aws/aws-sdk-go/service/ec2

You can also install the entire SDK by installing the root package, including all of the SDK's dependencies:

$ go get -u github.com/aws/aws-sdk-go/...

Configuring Credentials

Before using the SDK, ensure that you've configured credentials. The best way to configure credentials on a development machine is to use the ~/.aws/credentials file, which might look like:

[default]
aws_access_key_id = AKID1234567890
aws_secret_access_key = MY-SECRET-KEY

You can learn more about the credentials file from this blog post.

Alternatively, you can set the following environment variables:

AWS_ACCESS_KEY_ID=AKID1234567890
AWS_SECRET_ACCESS_KEY=MY-SECRET-KEY

Using

To use a service in the SDK, create a service variable by calling the New() function. Once you have a service, you can call API operations which each return response data and a possible error.

To list a set of instance IDs from EC2, you could run:

package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/service/ec2"
)

func main() {
	// Create an EC2 service object in the "us-west-2" region
	// Note that you can also configure your region globally by
	// exporting the AWS_REGION environment variable
	svc := ec2.New(&aws.Config{Region: aws.String("us-west-2")})

	// Call the DescribeInstances Operation
	resp, err := svc.DescribeInstances(nil)
	if err != nil {
		panic(err)
	}

	// resp has all of the response data, pull out instance IDs:
	fmt.Println("> Number of reservation sets: ", len(resp.Reservations))
	for idx, res := range resp.Reservations {
		fmt.Println("  > Number of instances: ", len(res.Instances))
		for _, inst := range resp.Reservations[idx].Instances {
			fmt.Println("    - Instance ID: ", *inst.InstanceID)
		}
	}
}

You can find more information and operations in our API documentation.

License

This SDK is distributed under the Apache License, Version 2.0, see LICENSE.txt and NOTICE.txt for more information.

aws-sdk-go's People

Contributors

awinstan avatar bmatsuo avatar euank avatar gitter-badger avatar hyandell avatar inickgo avatar jasdel avatar josharian avatar jrobsonchase avatar linusthe3rd avatar lsegal avatar marceldegraaf avatar marcosnils avatar mateusz avatar matthurne avatar mondok avatar mrekucci avatar mtdowling avatar nabeken avatar ncw avatar normj avatar phinze avatar pwaller avatar richarddbarnett avatar schmatz avatar stripecodahale avatar titanous avatar tomwans avatar tyler-luminal avatar yosssi avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.