aws-sdk-go

module
v0.0.0-...-9214b8d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2015 License: Apache-2.0

README

AWS SDK for Go

GoDoc Build Status Apache V2 License

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

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/awslabs/aws-sdk-go/service/ec2

You can also install the entire SDK by installing the root package:

$ go get github.com/awslabs/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/awslabs/aws-sdk-go/aws"
	"github.com/awslabs/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: "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.

Directories

Path Synopsis
aws
Package aws provides core functionality for making requests to AWS services.
Package aws provides core functionality for making requests to AWS services.
credentials
Package provides Credential retrieval and management The Credentials is the primary method of getting access to and managing credentials Values.
Package provides Credential retrieval and management The Credentials is the primary method of getting access to and managing credentials Values.
internal
model/api
Package for rendering service generated files.
Package for rendering service generated files.
model/cli/gen-api
Command aws-gen-gocli parses a JSON description of an AWS API and generates a Go file containing a client for the API.
Command aws-gen-gocli parses a JSON description of an AWS API and generates a Go file containing a client for the API.
model/cli/gen-endpoints
Command aws-gen-goendpoints parses a JSON description of the AWS endpoint discovery logic and generates a Go file which returns an endpoint.
Command aws-gen-goendpoints parses a JSON description of the AWS endpoint discovery logic and generates a Go file which returns an endpoint.
Package service contains automatically generated AWS clients.
Package service contains automatically generated AWS clients.
autoscaling
Package autoscaling provides a client for Auto Scaling.
Package autoscaling provides a client for Auto Scaling.
cloudformation
Package cloudformation provides a client for AWS CloudFormation.
Package cloudformation provides a client for AWS CloudFormation.
cloudfront
Package cloudfront provides a client for Amazon CloudFront.
Package cloudfront provides a client for Amazon CloudFront.
cloudhsm
Package cloudhsm provides a client for Amazon CloudHSM.
Package cloudhsm provides a client for Amazon CloudHSM.
cloudsearch
Package cloudsearch provides a client for Amazon CloudSearch.
Package cloudsearch provides a client for Amazon CloudSearch.
cloudsearchdomain
Package cloudsearchdomain provides a client for Amazon CloudSearch Domain.
Package cloudsearchdomain provides a client for Amazon CloudSearch Domain.
cloudtrail
Package cloudtrail provides a client for AWS CloudTrail.
Package cloudtrail provides a client for AWS CloudTrail.
cloudwatch
Package cloudwatch provides a client for Amazon CloudWatch.
Package cloudwatch provides a client for Amazon CloudWatch.
cloudwatchlogs
Package cloudwatchlogs provides a client for Amazon CloudWatch Logs.
Package cloudwatchlogs provides a client for Amazon CloudWatch Logs.
codedeploy
Package codedeploy provides a client for AWS CodeDeploy.
Package codedeploy provides a client for AWS CodeDeploy.
cognitoidentity
Package cognitoidentity provides a client for Amazon Cognito Identity.
Package cognitoidentity provides a client for Amazon Cognito Identity.
cognitosync
Package cognitosync provides a client for Amazon Cognito Sync.
Package cognitosync provides a client for Amazon Cognito Sync.
configservice
Package configservice provides a client for AWS Config.
Package configservice provides a client for AWS Config.
datapipeline
Package datapipeline provides a client for AWS Data Pipeline.
Package datapipeline provides a client for AWS Data Pipeline.
directconnect
Package directconnect provides a client for AWS Direct Connect.
Package directconnect provides a client for AWS Direct Connect.
dynamodb
Package dynamodb provides a client for Amazon DynamoDB.
Package dynamodb provides a client for Amazon DynamoDB.
ec2
Package ec2 provides a client for Amazon Elastic Compute Cloud.
Package ec2 provides a client for Amazon Elastic Compute Cloud.
ecs
Package ecs provides a client for Amazon EC2 Container Service.
Package ecs provides a client for Amazon EC2 Container Service.
elasticache
Package elasticache provides a client for Amazon ElastiCache.
Package elasticache provides a client for Amazon ElastiCache.
elasticbeanstalk
Package elasticbeanstalk provides a client for AWS Elastic Beanstalk.
Package elasticbeanstalk provides a client for AWS Elastic Beanstalk.
elastictranscoder
Package elastictranscoder provides a client for Amazon Elastic Transcoder.
Package elastictranscoder provides a client for Amazon Elastic Transcoder.
elb
Package elb provides a client for Elastic Load Balancing.
Package elb provides a client for Elastic Load Balancing.
emr
Package emr provides a client for Amazon Elastic MapReduce.
Package emr provides a client for Amazon Elastic MapReduce.
glacier
Package glacier provides a client for Amazon Glacier.
Package glacier provides a client for Amazon Glacier.
iam
Package iam provides a client for AWS Identity and Access Management.
Package iam provides a client for AWS Identity and Access Management.
kinesis
Package kinesis provides a client for Amazon Kinesis.
Package kinesis provides a client for Amazon Kinesis.
kms
Package kms provides a client for AWS Key Management Service.
Package kms provides a client for AWS Key Management Service.
lambda
Package lambda provides a client for AWS Lambda.
Package lambda provides a client for AWS Lambda.
opsworks
Package opsworks provides a client for AWS OpsWorks.
Package opsworks provides a client for AWS OpsWorks.
rds
Package rds provides a client for Amazon Relational Database Service.
Package rds provides a client for Amazon Relational Database Service.
redshift
Package redshift provides a client for Amazon Redshift.
Package redshift provides a client for Amazon Redshift.
route53
Package route53 provides a client for Amazon Route 53.
Package route53 provides a client for Amazon Route 53.
route53domains
Package route53domains provides a client for Amazon Route 53 Domains.
Package route53domains provides a client for Amazon Route 53 Domains.
s3
Package s3 provides a client for Amazon Simple Storage Service.
Package s3 provides a client for Amazon Simple Storage Service.
ses
Package ses provides a client for Amazon Simple Email Service.
Package ses provides a client for Amazon Simple Email Service.
sns
Package sns provides a client for Amazon Simple Notification Service.
Package sns provides a client for Amazon Simple Notification Service.
sqs
Package sqs provides a client for Amazon Simple Queue Service.
Package sqs provides a client for Amazon Simple Queue Service.
ssm
Package ssm provides a client for Amazon Simple Systems Management Service.
Package ssm provides a client for Amazon Simple Systems Management Service.
storagegateway
Package storagegateway provides a client for AWS Storage Gateway.
Package storagegateway provides a client for AWS Storage Gateway.
sts
Package sts provides a client for AWS Security Token Service.
Package sts provides a client for AWS Security Token Service.
support
Package support provides a client for AWS Support.
Package support provides a client for AWS Support.
swf
Package swf provides a client for Amazon Simple Workflow Service.
Package swf provides a client for Amazon Simple Workflow Service.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL