gocloud.dev: gocloud.dev/aws/awscloud Index | Examples | Files

package awscloud

import "gocloud.dev/aws/awscloud"

Package awscloud contains Wire providers for AWS services.

This is an example of how to bootstrap an HTTP server running on Amazon Web Services (AWS). The code in this function would be placed in main().

Code:

// Connect and authenticate to AWS.
srv, cleanup, err := setup(context.Background())
if err != nil {
    log.Fatal(err)
}
defer cleanup()

// Set up the HTTP routes.
http.HandleFunc("/", greet)

// Run the server. This behaves much like http.ListenAndServe,
// including that passing a nil handler will use http.DefaultServeMux.
log.Fatal(srv.ListenAndServe(":8080"))

Index

Examples

Package Files

awscloud.go

Variables

var AWS = wire.NewSet(
    Services,
    aws.DefaultSession,
    wire.Value(http.DefaultClient),
)

AWS is a Wire provider set that includes all Amazon Web Services interface implementations in the Go CDK and authenticates using the default session.

var Services = wire.NewSet(
    s3blob.Set,
    awssnssqs.Set,
    awsparamstore.Set,
    awskms.Set,
    rds.CertFetcherSet,
    awsdynamodb.Set,
    xrayserver.Set,
)

Services is a Wire provider set that includes the default wiring for all Amazon Web Services interface implementations in the Go CDK but unlike the AWS set, does not include credentials. Individual services may require additional configuration.

Package awscloud imports 10 packages (graph). Updated 2020-03-07. Refresh now. Tools for package owners.