• Stars
    star
    599
  • Rank 74,745 (Top 2 %)
  • Language
    Haskell
  • License
    Other
  • Created over 11 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A comprehensive Amazon Web Services SDK for Haskell.

Amazonka

MPL2 Hackage Build

An Amazon Web Services SDK for Haskell with support for most public services. Parts of the code contained in this repository are auto-generated and automatically kept up to date with Amazon's latest service APIs.

  • You can find the latest Haddock documentation for each respective library on the Amazonka website.
  • A release changelog can be found in lib/amazonka/CHANGELOG.md.
  • For problems, comments, or feedback please create an issue here on GitHub.

Table of Contents

License

Amazonka is licensed under the Mozilla Public License Version 2.0.

The AWS service descriptions are licensed under Apache 2.0. Source files derived from the service descriptions contain an additional licensing clause in their header.

Directory Layout

This repository is organised under the following directory structure:

  • lib/amazonka: The main library containing setup, authentication, and send logic. This will be your primary dependency.
  • lib/service/amazonka-*: A library per supported Amazon Web Service, you'll need to add a dependency on each selected service library.
  • lib/amazonka-core: The amazonka-core library upon which each of the services depends.
  • lib/amazonka-test: Common test functionality.
  • examples: Basic examples for using the service libraries.
  • configs: Service configuration, templates, and assets used by the code generator.
  • docs: The documentation website.
  • gen: The code and configuration generators.
  • scripts: Scripts to manage the project, such as the release lifecycle.

Supported Platforms and GHC Versions

GHC versions 9.0.*, 9.4.* and 9.6.* are officially supported and tested on NixOS, Ubuntu, and macOS. Earlier or later versions of GHC may also work, but only the aforementioned versions are tested by our continuous integration pipeline.

Getting Started

This repository is built using a combination of Nix and Cabal. If you're just using Amazonka as a git dependency in your Cabal or Stack project, you can skip the following steps and read Amazonka as a Git dependency. But if you plan on contributing to the codebase - welcome, read on!

1. Clone this repository

git clone [email protected]:brendanhay/amazonka.git
cd amazonka

2. Setup Nix

Building the code in this repository requires various development dependencies that are obtained and built via the Nix package manager in a reproducible and hermetic environment. You can install Nix by following the official installation instructions:

sh <(curl -L https://nixos.org/nix/install) --daemon

Once Nix is setup, you can enable the cache to avoid building dependencies:

nix-env -iA cachix -f https://cachix.org/api/v1/install
cachix use amazonka

A flake.nix is provided which will require your Nix configuration to enable flake support if you haven't done so already.

Edit either ~/.config/nix/nix.conf or /etc/nix/nix.conf and add:

experimental-features = nix-command flakes

If the Nix installation is in multi-user mode, don’t forget to restart the nix-daemon.

3. Enter a Nix Shell

The build tools are installed and activated upon entering a Nix shell, which is achieved by running the following command in the root of the repository:

nix develop

You can also enter a shell and by specifying one of the GHC versions declared by flake.nix, which can be inspected by running:

nix flake show
...
└───<system>
    ├───default: development environment 'amazonka-ghc944'
    ├───ghc810:  development environment 'amazonka-ghc8107'
    ├───ghc90:   development environment 'amazonka-ghc902'
    ├───ghc92:   development environment 'amazonka-ghc927'
    ├───ghc94:   development environment 'amazonka-ghc944'
    └───ghc96:   development environment 'amazonka-ghc961'

And then running nix develop for the desired version from the attribute list above:

nix develop '.#ghc90'

Note: the naming pattern for shells follows the GHC major versions available in nixpkgs. This means the minor versions will increment automatically as the flake.lock is updated.

If you have Direnv installed you can use the provided .envrc to automatically enter the default nix develop, which will also add the scripts directory to your PATH. You can extend this by adding your own uncommitted .envrc.local file. See the Direnv Wiki for various recipes.

Building the Project

The following commands assume you're already in a nix shell outlined in the previous step.

Once you've entered a Nix shell you can build amazonka-* packages via:

cabal build amazonka amazonka-s3

Or the entire project (which will take a very long time!):

cabal build all

Running the Code Generator

The gen package contain a code generator for synthesising Haskell data types, packages, and configuration from the botocore service definitions.

scripts/generate will run the code generator for all services configured in config/services, for example:

./scripts/generate

Or, you can selectively run the generator on one or more services:

./scripts/generate ec2 s3 iam

To update the botocore service definitions used by the generator, you can run:

./scripts/update-botocore

scripts/generate-configs will run the config generator to produce placeholder config/services configurations for any botocore services.

To generate configurations for any new/missing services:

./scripts/generate-configs

Service configurations generated in this way are intended as examples only and the resulting configs/services/<name>.json:libraryName (Haskell package name) and configs/annexes/<name>.json:serviceAbbreviation (Haskell package namespace) should be manually verified and curated as necessary.

For pull requests which affect generated output please do not include the regenerated amazonka-* packages, only commit updates to the build rules, documentation, generator, and related configuration. This is to make code review more manageable by focusing pertinent changes such as configuration and logic changes in pull requests and designates the maintainers and Continuous Integration as the source of truth for the generated code.

Amazonka as a Git Dependency

If there are as-yet-unreleased features or fixes that have yet to make it to Hackage, you can use the main (or another) development branch by declaring Amazonka as a Git dependency by following the Cabal or Stack instructions below.

Note: amazonka-core is a required dependency of the main amazonka package, in addition to amazonka-sts and amazonka-sso for sts:AssumeRoleWithWebIdentity and SSO via AWS IAM Identity Center, respectively. These required dependencies can then be supplemented by any additional service libraries you use from lib/services/amazonka-<service>.

Cabal

To add Amazonka as a Git dependency to your Cabal project, you will need to add a source-repository-package section for amazonka to your cabal.project file:

-- For amazonka
-- Multiple subdirs in a single `source-repository-package` stanza are supported by cabal-install >= 3.2.0.0.
source-repository-package
    type: git
    location: https://github.com/brendanhay/amazonka
    tag: <current revision of the `main` branch>
    subdir: lib/amazonka lib/amazonka-core lib/services/amazonka-sso lib/services/amazonka-sts lib/services/amazonka-<service>

Stack

Stack users should add an extra-deps: stanza to their stack.yaml:

extra-deps:
- github: brendanhay/amazonka
  commit: <current revision of the `main` branch>
  subdirs:
  - lib/amazonka
  - lib/amazonka-core
  - lib/services/amazonka-sso
  - lib/services/amazonka-sts
  - lib/services/amazonka-<service>

Haskell.nix + Stack

Stack users who also use haskell.nix will need to configure haskell.nix to fetch Amazonka commits from a specific git branch/rev by using the branchMap parameter:

pkgs.haskell-nix.project {
  branchMap = {
    "https://github.com/brendanhay/amazonka" = {
      "<git-commit-sha>" = "main";
    };
  };

  ...
}

Code Formatting

Please use ./scripts/format frequently - it's OK, I hate 2 spaces too, we're in this together.

Third Party Packages

When naming an additional library which provides supplemental functionality to amazonka, if you want to use the amazonka-* namespace, then please consider prefixing your package names with amazonka-contrib-*. For example, amazonka-contrib-rds-utils.

This minimises potential future collisions with auto-generated package names and new AWS service and product releases.

More Repositories

1

gogol

A comprehensive Google Services SDK for Haskell.
Haskell
278
star
2

terrafomo

Le Fromage de Terreur - Auto-generated Terraform DSL
Haskell
64
star
3

ede

Templating language with similar syntax and features to Liquid or Jinja2.
Haskell
47
star
4

gamekeeper

Nagios monitoring and Ganglia/Graphite HTTP statistics aggregation for RabbitMQ
Haskell
25
star
5

credentials

Management and Distribution of Secret Credentials
Haskell
23
star
6

numbersd

Concurrent and efficient implementation of statsd in Haskell
Haskell
19
star
7

network-metrics

Send metrics to Ganglia, Graphite, and statsd
Haskell
17
star
8

pagerduty

Haskell PagerDuty API Client
Haskell
13
star
9

semver

An implementation of the Semantic Versioning specification for Haskell
Haskell
13
star
10

statgrab

Haskell bindings to the portable system statistics libstatgrab library.
Haskell
9
star
11

myxi

AMQP Router and Load-Balancer designed to simplify RabbitMQ clustering and federation
Erlang
7
star
12

dotfiles

Arch Linux and MacOSX dotfiles
Nix
7
star
13

keiretsu

Multi-process orchestration for development and integration testing
Haskell
7
star
14

text-manipulate

Textual case conversion and word boundary manipulation
Haskell
6
star
15

amqp-subscribe-many

Reference implementation for handling a publish-one, subscribe-many pattern
Ruby
6
star
16

reloader

mochimedia's reloader made rebar compatible.
Erlang
5
star
17

stetson

Erlang client for Etsy's statsd statistics aggregator
Erlang
4
star
18

khan

Taming the Mongol Horde
Haskell
4
star
19

amazonka-iam-policy

IAM Policy Document DSL and Combinators
Haskell
3
star
20

xdr

GHC 7.4 compatible XDR encoder and decoder
Haskell
3
star
21

problem_sets

Random solutions to random problems found in random locations on the interweb
Erlang
3
star
22

harbinger

Dynamo queues
Erlang
3
star
23

erlexec

git clone of erlexec from http://code.google.com/p/erlexec/
Shell
3
star
24

amqp-conduit

Conduit interface for Network.AMQP
Haskell
3
star
25

hexpat-pickle-generic

Picklers for de/serialising Generic data types to and from XML using hexpat
Haskell
3
star
26

comlink

Ghetto IRC notifications via Curl
Haskell
2
star
27

Mechanic

Erlang websocket server with javascript interface
JavaScript
2
star
28

amqp-bark

AMQP logging system for infrastructure components
Haskell
2
star
29

querystring-pickle

Picklers for de/serialising Generic data types to and from query strings
Haskell
2
star
30

czar

Push based monitoring system for gathering metrics and alerts
Haskell
2
star
31

chrononaut

Pure SQL Migrations
Haskell
2
star
32

semaphore

Shared access to resources (such as AMQP/DB connections) with tracking and disposal via monitors
Erlang
2
star
33

apteryx

Apteryx is a S3 backed APT server and related upload/management tools for Debian packages stored in S3.
Haskell
2
star
34

vanguard

Management UI for disparate/unclustered RabbitMQ instances
JavaScript
2
star
35

monocypher

C
1
star
36

digger

CLI tool to generate publish-one, subscribe-many Shovel configurations for RabbitMQ
Erlang
1
star
37

restomp

Re-entrant STOMP parser
Erlang
1
star
38

seize

Simultaneously capture STDERR and STDOUT when running OS commands from Erlang
C
1
star
39

ligature

Graphite dashboards
Haskell
1
star
40

rebar-templates

Rebar Templates
Shell
1
star
41

grimoire

librarian-chef API endpoint which uses a specified GitHub organisation a replacement for cookbooks.opscode.com/api/v1
Haskell
1
star
42

Reticulator.js

Simple generator for random loading/success/response messages ala Maxis' games
JavaScript
1
star
43

up

Super Uploader
1
star
44

czar-language

Configuration language parser + compiler
Haskell
1
star
45

Monocle.js

A monocle to go with your mustache. Quick and dirty auto-generated form element templates for mustache.
JavaScript
1
star
46

DatabaseQueue

A simple (blocking/threadsafe/.net 3.5) C# queue using json/binary/xml serialization and an underlying database as the storage mechanism (berkeleydb/sqlite/sqlcompact implemented)
C#
1
star
47

outliner

Ruby implementation of the HTML5 outline algorithm
Ruby
1
star
48

gamekeeper-cookbook

Chef cookbook for installing gamekeeper
Ruby
1
star
49

Shared

Shared libs from the arse end of the DDD project tier I use to interchangeably access MongoDb or NHibernate. Also includes a lot of common MVC related infrastructure and extensions.
C#
1
star
50

pistachio

Exploratory work-in-progress for a faster + more ergonomic Rust mustache implementation
Rust
1
star
51

VisualStudioSettings

VS Settings, Zenburn Theme, 1TBS, DejaVu Sans Mono
1
star