{"id":15285845,"url":"https://github.com/aws-beam/aws-erlang","last_synced_at":"2025-05-16T08:03:47.331Z","repository":{"id":37663879,"uuid":"120816325","full_name":"aws-beam/aws-erlang","owner":"aws-beam","description":" Create, configure, and manage AWS services from Erlang code. ","archived":false,"fork":false,"pushed_at":"2025-05-13T02:25:16.000Z","size":24401,"stargazers_count":84,"open_issues_count":7,"forks_count":34,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-13T03:27:09.810Z","etag":null,"topics":["aws","erlang"],"latest_commit_sha":null,"homepage":"","language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aws-beam.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-02-08T20:49:57.000Z","updated_at":"2025-05-13T02:25:20.000Z","dependencies_parsed_at":"2023-12-27T02:29:12.034Z","dependency_job_id":"f7313a9d-72e7-4dfb-888f-c5d1ba7f22be","html_url":"https://github.com/aws-beam/aws-erlang","commit_stats":{"total_commits":818,"total_committers":17,"mean_commits":48.11764705882353,"dds":"0.26405867970660146","last_synced_commit":"4bf4cc45d6c61dd8a5fbfbcb98dbbcf62a4264ee"},"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws-beam%2Faws-erlang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws-beam%2Faws-erlang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws-beam%2Faws-erlang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws-beam%2Faws-erlang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aws-beam","download_url":"https://codeload.github.com/aws-beam/aws-erlang/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253868646,"owners_count":21976482,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","erlang"],"created_at":"2024-09-30T15:07:49.304Z","updated_at":"2025-05-16T08:03:45.726Z","avatar_url":"https://github.com/aws-beam.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWS clients for Erlang\n\n[![Actions Status](https://github.com/aws-beam/aws-erlang/workflows/Build/badge.svg)](https://github.com/aws-beam/aws-erlang/actions)\n[![Module Version](https://img.shields.io/hexpm/v/aws_erlang.svg)](https://hex.pm/packages/aws_erlang)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/aws_erlang/)\n[![Total Download](https://img.shields.io/hexpm/dt/aws_erlang.svg)](https://hex.pm/packages/aws_erlang)\n[![License](https://img.shields.io/hexpm/l/aws_erlang.svg)](https://github.com/aws-beam/aws-erlang/blob/master/LICENSE.md)\n[![Last Updated](https://img.shields.io/github/last-commit/aws-beam/aws-erlang.svg)](https://github.com/aws-beam/aws-erlang/commits/master)\n\n:rocket: Create, configure, and manage AWS services from Erlang code. :rocket:\n\n## Features\nThis repo only holds generated code :exclamation: All non-generated code is included as part of [aws_beam_core](https://github.com/aws-beam/aws_beam_core).\nAny changes that need to be made should hence be made through [aws_beam_core](https://github.com/aws-beam/aws_beam_core) or [aws-codegen](https://github.com/aws-beam/aws-codegen) :exclamation:\n\n* Completely generated by [aws-codegen](https://github.com/aws-beam/aws-codegen) from the same JSON descriptions of AWS services used to build the AWS SDKs (See: [aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2))\n* A clean API separated per service. One module per service.\n* Support for most (almost all!) of the AWS services.\n* Documentation updated from the official AWS docs.\n* Type specs generated from the same JSON descriptions as the SDK\n\n## Usage\n\nHere is an example of listing Amazon Kinesis streams. First of all,\nstart a shell with `rebar3 shell`, then:\n### aws_s3\n\nHere is another example, this time using a _temporary_ client, showing\nhow to upload a file to _S3_ and how to fetch it back:\n\n```erlang\n\u003e Client = aws_client:make_temporary_client(\u003c\u003c\"my-access-key-id\"\u003e\u003e, \u003c\u003c\"my-secret-access-key\"\u003e\u003e, \u003c\u003c\"my-token\"\u003e\u003e, \u003c\u003c\"eu-west-1\"\u003e\u003e).\n[...]\n\u003e {ok, Content} = file:read_file(\"/tmp/erlang-logo.png\").\n[...]\n\u003e aws_s3:put_object(Client, \u003c\u003c\"my-bucket\"\u003e\u003e, \u003c\u003c\"my-key\"\u003e\u003e, #{\u003c\u003c\"Body\"\u003e\u003e =\u003e Content}).\n[...]\n\u003e {ok, Response, _} = aws_s3:get_object(Client, \u003c\u003c\"my-bucket\"\u003e\u003e, \u003c\u003c\"my-key\"\u003e\u003e).\n[...]\n\u003e Content = maps:get(\u003c\u003c\"Body\"\u003e\u003e, Response).\n```\n\nSupport for creating [Presigned URLs](https://docs.aws.amazon.com/AmazonS3/latest/userguide/ShareObjectPreSignedURL.html) is provided\nthrough the `aws_s3_presigned_url` module.\n\n### aws_kinesis\n\n```erlang\n\u003e Client = aws_client:make_client(\u003c\u003c\"my-access-key-id\"\u003e\u003e, \u003c\u003c\"my-secret-access-key\"\u003e\u003e, \u003c\u003c\"eu-west-1\"\u003e\u003e),\n[...]\n\u003e {ok, Result, _Response} = aws_kinesis:list_streams(Client, #{}),\n[...]\n\u003e io:format(\"~p~n\", [Result]).\n#{\u003c\u003c\"HasMoreStreams\"\u003e\u003e =\u003e false,\u003c\u003c\"StreamNames\"\u003e\u003e =\u003e []}\n```\n\n### AWS RDS IAM Token Creation\nSupport for creating IAM Tokens (more info here) has been added as part of the aws_rds_iam_token module as part of [aws_beam_core](https://github.com/aws-beam/aws_beam_core).\nThis allows for easy creation of RDS/Aurora tokens to be used for IAM based authentication instead of username/password combination.\n\n```erlang\n\u003e Client = aws_client:make_temporary_client(\u003c\u003c\"AccessKeyID\"\u003e\u003e, \u003c\u003c\"SecretAccessKey\"\u003e\u003e, \u003c\u003c\"Token\"\u003e\u003e, \u003c\u003c\"eu-west-1\"\u003e\u003e).\n[...]\n\u003e {ok, Url} = aws_rds_iam_token:rds_token_create(Client, \u003c\u003c\"db_endpoint\"\u003e\u003e, 5432, \u003c\u003c\"db_user\"\u003e\u003e).\n[...]\n```\n\nThis token can subsequently be used to connect to the database over IAM.\n\n### AWS S3 Presigned Url\nSupport for Presigning S3 urls has been added as part of the aws_s3_presigned_url module as part of [aws_beam_core](https://github.com/aws-beam/aws_beam_core).\nThis allows generating either a get or put presigned s3 url,\nwhich can be used by external clients such as cURL to access (get/put) the object in question.\n```erlang\n\u003e Client = aws_client:make_temporary_client(\u003c\u003c\"AccessKeyID\"\u003e\u003e, \u003c\u003c\"SecretAccessKey\"\u003e\u003e, \u003c\u003c\"Token\"\u003e\u003e, \u003c\u003c\"eu-west-1\"\u003e\u003e).\n[...]\n\u003e {ok, Url} = aws_s3_presigned_url:make_presigned_v4_url(Client, put, 3600, \u003c\u003c\"bucket\"\u003e\u003e, \u003c\u003c\"key\"\u003e\u003e)\n[...]\n```\n\n### retry options\n\nEach API which takes `Options` allows a `retry_options` key and can allow for automatic retries.\nSimple provide the following:\n\n`[{retry_options, {exponential_with_jitter, {MaxAttempts, BaseSleepTime, CapSleepTime}}} | \u003cother_options\u003e]`\n\nThis implementation is based on [AWS: Exponential Backoff And Jitter](https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/).\n\n## Installation\n\nSimply add the library to your `rebar.config`:\n\n```erlang\n{deps, [{aws, \"1.1.0\", {pkg, aws_erlang}}]}.\n```\n\n## Obtaining Credentials\n\nCredentials can be obtained via the separate [aws_credentials](https://github.com/aws-beam/aws_credentials) application, which can be configured to fetch credentials from:\n\n* Erlang environment variables\n* OS environment variables\n* An AWS credentials file\n* ECS task credentials\n* EC2 metadata (including v2 - IMDS)\n\nHere is an example on how to obtain credentials:\n\n```erlang\n\u003e Credentials = aws_credentials:get_credentials().\n[...]\n\u003e #{ access_key_id := AccessKeyId\n   , token := Token\n   , region := Region\n   , secret_access_key := SecretAccessKey } = Credentials.\n```\n\nThe `aws_credentials` application is part of [aws_beam_core](https://github.com/aws-beam/aws_beam_core) and included in this package.\n\n## Development\n\nThe service-specific modules are generated using the [aws-codegen](https://github.com/aws-beam/aws-codegen) library from the JSON descriptions of AWS services provided by Amazon.\n\nThe rest of the code is manually written and used as support for the generated code.\n\n## Documentation\nUnfortunately the docs generated are too big for hexdocs.pm. Hence, the docs can be generated locally using:\n```bash\n$ rebar3 ex_doc\n```\n\nThe docs will be available in `./doc`.\n\n## Running Tests\n\n```bash\n$ rebar3 eunit\n```\n\n```bash\n$ docker-compose -f test/docker/docker-compose.yml up -d\n$ rebar3 ct\n$ docker-compose -f test/docker/docker-compose.yml down\n```\n\n## License\n\nCopyright 2015 Jamshed Kakar \u003cjkakar@kakar.ca\u003e\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faws-beam%2Faws-erlang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faws-beam%2Faws-erlang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faws-beam%2Faws-erlang/lists"}