Skip to content

Commit ac21063

Browse files
authored
Merge pull request #166 from aws-beam/include-aws_beam_core-as-a-dep
Include aws beam core as a dep
2 parents caf4d3f + 63d2b88 commit ac21063

10 files changed

+38
-1121
lines changed

.github/workflows/build.yml

+2-24
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@ name: Build
33
on:
44
pull_request:
55
push:
6-
branches:
7-
- master
86

97
jobs:
108
build:
119
strategy:
1210
matrix:
1311
platform: [ubuntu-latest]
14-
otp-version: [24, 25, 26, 27]
12+
otp-version: [25, 26, 27]
1513
runs-on: ${{ matrix.platform }}
1614
container:
1715
image: erlang:${{ matrix.otp-version }}
@@ -27,20 +25,6 @@ jobs:
2725
steps:
2826
- name: Checkout
2927
uses: actions/checkout@v4
30-
- name: Cache Hex packages
31-
uses: actions/cache@v4
32-
with:
33-
path: ~/.cache/rebar3/hex/hexpm/packages
34-
key: ${{ runner.os }}-hex-${{ hashFiles(format('{0}{1}', github.workspace, '/rebar.lock')) }}
35-
restore-keys: |
36-
${{ runner.os }}-hex-
37-
- name: Cache Dialyzer PLTs
38-
uses: actions/cache@v4
39-
with:
40-
path: ~/.cache/rebar3/rebar3_*.plt
41-
key: ${{ runner.os }}-dialyzer-${{ hashFiles(format('{0}{1}', github.workspace, '/rebar.config')) }}
42-
restore-keys: |
43-
${{ runner.os }}-dialyzer-
4428
- name: Compile
4529
run: rebar3 compile
4630
- name: Run EUnit Tests
@@ -52,14 +36,8 @@ jobs:
5236
S3MOCK_HOST: s3mock
5337
- name: Check app calls
5438
run: rebar3 check_app_calls
55-
- name: Create Cover Reports
56-
env:
57-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58-
run: rebar3 cover
59-
- name: Produce Documentation
60-
run: rebar3 edoc || true
6139
- name: Produce Documentation
62-
run: rebar3 ex_doc || true
40+
run: rebar3 ex_doc
6341
- name: Publish Documentation
6442
uses: actions/upload-artifact@v4
6543
with:

README.md

+21-18
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@
1010
:rocket: Create, configure, and manage AWS services from Erlang code. :rocket:
1111

1212
## Features
13+
This 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).
14+
Any 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:
1315

16+
* 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))
1417
* A clean API separated per service. One module per service.
15-
* Support for most of the AWS services.
16-
* Generated by [aws-codegen](https://github.com/aws-beam/aws-codegen) using the
17-
same JSON descriptions of AWS services used to build the
18-
[AWS SDK for Go](https://github.com/aws/aws-sdk-go/tree/master/models/apis).
18+
* Support for most (almost all!) of the AWS services.
1919
* Documentation updated from the official AWS docs.
20+
* Type specs generated from the same JSON descriptions as the SDK
2021

2122
## Usage
2223

@@ -54,8 +55,9 @@ through the `aws_s3_presigned_url` module.
5455
```
5556

5657
### AWS RDS IAM Token Creation
57-
Support for creating IAM Tokens (more info [here](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.Connecting.html)) has been added as part of the `aws_rds_iam_token` module.
58+
Support 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).
5859
This allows for easy creation of RDS/Aurora tokens to be used for IAM based authentication instead of username/password combination.
60+
5961
```erlang
6062
> Client = aws_client:make_temporary_client(<<"AccessKeyID">>, <<"SecretAccessKey">>, <<"Token">>, <<"eu-west-1">>).
6163
[...]
@@ -65,6 +67,17 @@ This allows for easy creation of RDS/Aurora tokens to be used for IAM based auth
6567

6668
This token can subsequently be used to connect to the database over IAM.
6769

70+
### AWS S3 Presigned Url
71+
Support 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).
72+
This allows generating either a get or put presigned s3 url,
73+
which can be used by external clients such as cURL to access (get/put) the object in question.
74+
```erlang
75+
> Client = aws_client:make_temporary_client(<<"AccessKeyID">>, <<"SecretAccessKey">>, <<"Token">>, <<"eu-west-1">>).
76+
[...]
77+
> {ok, Url} = aws_s3_presigned_url:make_presigned_v4_url(Client, put, 3600, <<"bucket">>, <<"key">>)
78+
[...]
79+
```
80+
6881
### retry options
6982

7083
Each API which takes `Options` allows a `retry_options` key and can allow for automatic retries.
@@ -79,7 +92,7 @@ This implementation is based on [AWS: Exponential Backoff And Jitter](https://aw
7992
Simply add the library to your `rebar.config`:
8093

8194
```erlang
82-
{deps, [{aws, "1.0.0", {pkg, aws_erlang}}]}.
95+
{deps, [{aws, "1.1.0", {pkg, aws_erlang}}]}.
8396
```
8497

8598
## Obtaining Credentials
@@ -103,11 +116,7 @@ Here is an example on how to obtain credentials:
103116
, secret_access_key := SecretAccessKey } = Credentials.
104117
```
105118

106-
The `aws_credentials` application can be installed by adding the following to your `rebar.config`:
107-
108-
```erlang
109-
{deps, [{aws_credentials, "0.1.10"}]}.
110-
```
119+
The `aws_credentials` application is part of [aws_beam_core](https://github.com/aws-beam/aws_beam_core) and included in this package.
111120

112121
## Development
113122

@@ -116,13 +125,7 @@ The service-specific modules are generated using the [aws-codegen](https://githu
116125
The rest of the code is manually written and used as support for the generated code.
117126

118127
## Documentation
119-
120-
### Check it Online
121-
122-
* [Hex Docs](https://hexdocs.pm/aws_erlang/)
123-
124-
### Build it locally
125-
128+
Unfortunately the docs generated are too big for hexdocs.pm. Hence, the docs can be generated locally using:
126129
```bash
127130
$ rebar3 ex_doc
128131
```

rebar.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{erl_opts, [nowarn_unused_type, debug_info, {d, maps_support}]}.
22
{deps, [{hackney, "1.18.0"},
33
{jsx, "3.0.0"},
4-
{aws_signature, "0.3.3"}
4+
{aws_beam_core, "1.0.0"}
55
]}.
66
{project_plugins, [rebar3_hex, rebar3_ex_doc, rebar3_check_app_calls]}.
77
{hex, [{doc, #{provider => ex_doc}}]}.

rebar.lock

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
{"1.2.0",
2-
[{<<"aws_signature">>,{pkg,<<"aws_signature">>,<<"0.3.3">>},0},
2+
[{<<"aws_beam_core">>,{pkg,<<"aws_beam_core">>,<<"1.0.0">>},0},
3+
{<<"aws_credentials">>,{pkg,<<"aws_credentials">>,<<"0.3.2">>},1},
4+
{<<"aws_signature">>,{pkg,<<"aws_signature">>,<<"0.3.3">>},0},
35
{<<"certifi">>,{pkg,<<"certifi">>,<<"2.5.2">>},1},
6+
{<<"eini">>,{pkg,<<"eini_beam">>,<<"2.2.4">>},2},
47
{<<"hackney">>,{pkg,<<"hackney">>,<<"1.16.0">>},0},
58
{<<"idna">>,{pkg,<<"idna">>,<<"6.0.1">>},1},
9+
{<<"iso8601">>,{pkg,<<"iso8601">>,<<"1.3.4">>},2},
610
{<<"jsx">>,{pkg,<<"jsx">>,<<"3.0.0">>},0},
711
{<<"metrics">>,{pkg,<<"metrics">>,<<"1.0.1">>},1},
812
{<<"mimerl">>,{pkg,<<"mimerl">>,<<"1.2.0">>},1},
@@ -11,21 +15,29 @@
1115
{<<"unicode_util_compat">>,{pkg,<<"unicode_util_compat">>,<<"0.5.0">>},2}]}.
1216
[
1317
{pkg_hash,[
18+
{<<"aws_beam_core">>, <<"F5BAD0147038A0B921844B530A8D937D8BF569B5E1FD0658FA0A6586EB98375C">>},
19+
{<<"aws_credentials">>, <<"BA2CCEE4EC6DCB5426CF71830B7AFD73795B1F19655F401D4401015B468FEC6F">>},
1420
{<<"aws_signature">>, <<"5844BEE0D3CC42EEFD21D236BBFAA8AA9B16E2F2B7EE79EDAECB321DB3FB6ADF">>},
1521
{<<"certifi">>, <<"B7CFEAE9D2ED395695DD8201C57A2D019C0C43ECAF8B8BCB9320B40D6662F340">>},
22+
{<<"eini">>, <<"02143B1DCE4DDA4243248E7D9B3D8274B8D9F5A666445E3D868E2CCE79E4FF22">>},
1623
{<<"hackney">>, <<"5096AC8E823E3A441477B2D187E30DD3FFF1A82991A806B2003845CE72CE2D84">>},
1724
{<<"idna">>, <<"1D038FB2E7668CE41FBF681D2C45902E52B3CB9E9C77B55334353B222C2EE50C">>},
25+
{<<"iso8601">>, <<"7B1F095F86F6CF65E1E5A77872E8E8BF69BD58D4C3A415B3F77D9CC9423ECBB9">>},
1826
{<<"jsx">>, <<"20A170ABD4335FC6DB24D5FAD1E5D677C55DADF83D1B20A8A33B5FE159892A39">>},
1927
{<<"metrics">>, <<"25F094DEA2CDA98213CECC3AEFF09E940299D950904393B2A29D191C346A8486">>},
2028
{<<"mimerl">>, <<"67E2D3F571088D5CFD3E550C383094B47159F3EEE8FFA08E64106CDF5E981BE3">>},
2129
{<<"parse_trans">>, <<"09765507A3C7590A784615CFD421D101AEC25098D50B89D7AA1D66646BC571C1">>},
2230
{<<"ssl_verify_fun">>, <<"CF344F5692C82D2CD7554F5EC8FD961548D4FD09E7D22F5B62482E5AEAEBD4B0">>},
2331
{<<"unicode_util_compat">>, <<"8516502659002CEC19E244EBD90D312183064BE95025A319A6C7E89F4BCCD65B">>}]},
2432
{pkg_hash_ext,[
33+
{<<"aws_beam_core">>, <<"421C24834B210A10698ADB29282FF96777C711D85AC57FE6DF9C39DFB2E1FD58">>},
34+
{<<"aws_credentials">>, <<"2E748626A935A7A544647FB79D7054F38DB8BF378978542C962CCBEAB387387B">>},
2535
{<<"aws_signature">>, <<"87E8F42B8E49002AA8D0350A71D13D69EA91B9AFB4CA9B526AE36DB1D585C924">>},
2636
{<<"certifi">>, <<"3B3B5F36493004AC3455966991EAF6E768CE9884693D9968055AEEEB1E575040">>},
37+
{<<"eini">>, <<"12DE479D144B19E09BB92BA202A7EA716739929AFDF9DFF01AD802E2B1508471">>},
2738
{<<"hackney">>, <<"3BF0BEBBD5D3092A3543B783BF065165FA5D3AD4B899B836810E513064134E18">>},
2839
{<<"idna">>, <<"A02C8A1C4FD601215BB0B0324C8A6986749F807CE35F25449EC9E69758708122">>},
40+
{<<"iso8601">>, <<"A334469C07F1C219326BC891A95F5EEC8EB12DD8071A3FFF56A7843CB20FAE34">>},
2941
{<<"jsx">>, <<"37BECA0435F5CA8A2F45F76A46211E76418FBEF80C36F0361C249FC75059DC6D">>},
3042
{<<"metrics">>, <<"69B09ADDDC4F74A40716AE54D140F93BEB0FB8978D8636EADED0C31B6F099F16">>},
3143
{<<"mimerl">>, <<"F278585650AA581986264638EBF698F8BB19DF297F66AD91B18910DFC6E19323">>},

src/aws.app.src

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
, { applications
66
, [ kernel
77
, stdlib
8-
, xmerl
98
, crypto
109
, hackney
1110
, jsx
12-
, aws_signature
11+
, aws_beam_core
1312
]
1413
}
1514
, {env,[]}

0 commit comments

Comments
 (0)