Comments (13)
hi @jfacorro , i am asking regarding support of instance role / task role for API request on aws-elixir library,
using instance role is alternative of providing AWS credential for API request (compared to using aws_access_key_id and aws_secret_access_key ) which has the advantage of has lower risk of leakage and no need to do key rotation. Supporting instance role on aws-elixir would help developer use aws-elixir on higher security requirement.
AWS has a page for documenting instance role: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html
ex_aws (another elixir client module for AWS) has support of instance role: https://hexdocs.pm/ex_aws/ExAws.html#module-aws-key-configuration
from aws-elixir.
@jfacorro I don't actually remember why we chose to create a separate repo/library for that functionality, but it does seem like it'd be valuable to roll it into the aws-erlang
and aws-elixir
code bases.
from aws-elixir.
Also, it seems like the aws-erlang-metadata
has been forked/changed into https://github.com/aws-beam/aws_credentials.
from aws-elixir.
@calvin-kargo Have you looked at https://github.com/aws-beam/aws-erlang-metadata? I believe this will do what you need, if I understand your request correctly.
from aws-elixir.
@calvin-kargo Could you provide more information on what feature it is you are asking for?
from aws-elixir.
@jkakar What was the reasoning behind having the functionality in aws-erlang-metadata
in a separate repository instead of including it as part of aws-erlang
?
from aws-elixir.
Thanks @jkakar @robertoaloi @jfacorro https://github.com/aws-beam/aws_credentials seems like the correct way,
however i have trouble in setting up aws_credentials, especially on iso8601 depedency, is there erlang/otp/elixir version depedency on using aws_elixir and aws_credential? i am using Elixir 1.10.4 (compiled with Erlang/OTP 22)
# mix.exs
defp deps do
[
...,
{:aws_credential, git: "https://github.com/aws-beam/aws_credentials"}
]
end
calvin@calvin-Lenovo-Yoga-S730-13IWL:~/event_service$ export DEBUG=1 && mix phx.server
warning: found quoted keyword "coveralls" but the quotes are not required. Note that keywords are always atoms, even when quoted. Similar to atoms, keywords made exclusively of Unicode letters, numbers, underscore, and @ do not require quotes
mix.exs:19
===> Expanded command sequence to be run: []
===> Provider: {default,do}
===> Expanded command sequence to be run: [{default,app_discovery},
{bare,compile}]
===> Provider: {default,app_discovery}
===> Provider: {bare,compile}
===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump
===> Uncaught error: {badmatch,[]}
===> When submitting a bug report, please include the output of `rebar3 report "your command"`
** (Mix) Could not compile dependency :iso8601, "/home/calvin/.mix/rebar3 bare compile --paths="/home/calvin/work/backend/apps/event_service/_build/dev/lib/*/ebin"" command failed. You can recompile this dependency with "mix deps.compile iso8601", update it with "mix deps.update iso8601" or clean it with "mix deps.clean iso8601"
calvin@calvin-Lenovo-Yoga-S730-13IWL:~/work/backend/apps/event_service$ mix -v
Erlang/OTP 23 [erts-11.0.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe]
Mix 1.10.4 (compiled with Erlang/OTP 22)
calvin@calvin-Lenovo-Yoga-S730-13IWL:~/work/backend/apps/event_service$ elixir -v
Erlang/OTP 23 [erts-11.0.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe]
Elixir 1.10.4 (compiled with Erlang/OTP 22)
after aws_credentials installation okay, is this usage correct?
{ok, credentials} = aws_credentials:get_credentials()
client = %AWS.Client{access_key_id: credentials["access_key_id"],
secret_access_key: credentials["secret_access_key"],
session_token: credentials["token"],
region: credentials["region"]}
from aws-elixir.
@calvin-kargo AFAIK there shouldn't be any issues when compiling the project. Could you please share the result from running rebar3 --version
and the contents of the rebar3.crashdump
file?
after aws_credentials installation okay, is this usage correct?
That looks correct.
from aws-elixir.
@jfacorro Here is rebar version and crash dump (from deps/iso8601
)
rebar 3.6.1 on Erlang/OTP 23 Erts 11.0.3
Error: {badmatch,[]}
[]
from aws-elixir.
also rebar report
===> Expanded command sequence to be run: [{default,report}]
===> Provider: {default,report}
Rebar3 report
version 3.6.1
generated at 2020-08-19T06:31:05+00:00
=================
Please submit this along with your issue at https://github.com/erlang/rebar3/issues (and feel free to edit out private information, if any)
-----------------
Task: bare
Entered as:
bare compile --paths=/home/calvin/work/backend/apps/event_service/_build/dev/lib/*/ebin
-----------------
Operating System: x86_64-unknown-linux-gnu
ERTS: Erlang/OTP 23 [erts-11.0.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe]
Root Directory: /usr/lib/erlang
Library directory: /usr/lib/erlang/lib
-----------------
Loaded Applications:
bbmustache: 1.5.0
certifi: 2.0.0
cf: 0.2.2
common_test: 1.19
compiler: 7.6.2
crypto: 4.7
cth_readable: 1.4.2
dialyzer: 4.2
edoc: 0.12
erlware_commons: 1.2.0
eunit: 2.5
eunit_formatters: 0.5.0
getopt: 1.0.1
hipe: 4.0
inets: 7.2
kernel: 7.0
providers: 1.7.0
public_key: 1.8
relx: 3.26.0
sasl: 4.0
snmp: 5.6
ssl_verify_fun: 1.1.3
stdlib: 3.13
syntax_tools: 2.3
tools: 3.4
-----------------
Escript path: /home/calvin/.mix/rebar3
Providers:
app_discovery as clean compile compile cover ct deps dialyzer do edoc escriptize eunit get-deps help install install_deps list lock new path pkgs release relup report shell state tar tree unlock update upgrade upgrade upgrade version xref
from aws-elixir.
It might be an issue with the rebar3
version. The latest stable version is 3.13.2
, but 3.6.1
is from around 2 years ago. Could you try upgrading rebar3
and checking the results?
from aws-elixir.
@jfacorro have updated rebar3, but still getting same error
calvin@calvin-Lenovo-Yoga-S730-13IWL:~/work/backend/apps/event_service$ mix local.rebar
warning: found quoted keyword "coveralls" but the quotes are not required. Note that keywords are always atoms, even when quoted. Similar to atoms, keywords made exclusively of Unicode letters, numbers, underscore, and @ do not require quotes
mix.exs:19
/home/calvin/.mix/rebar already exists, overwrite? [Yn] Y
* creating /home/calvin/.mix/rebar
/home/calvin/.mix/rebar3 already exists, overwrite? [Yn] Y
* creating /home/calvin/.mix/rebar3
calvin@calvin-Lenovo-Yoga-S730-13IWL:~/work/backend/apps/event_service$ /home/calvin/.mix/rebar3 --version
===> Expanded command sequence to be run: [{default,version}]
===> Provider: {default,version}
rebar 3.13.1 on Erlang/OTP 23 Erts 11.0.3
calvin@calvin-Lenovo-Yoga-S730-13IWL:~/work/backend/apps/event_service$ export DEBUG=1 && mix phx.serverwarning: found quoted keyword "coveralls" but the quotes are not required. Note that keywords are always atoms, even when quoted. Similar to atoms, keywords made exclusively of Unicode letters, numbers, underscore, and @ do not require quotes
mix.exs:19
===> Expanded command sequence to be run: []
===> Provider: {default,do}
===> Expanded command sequence to be run: [{default,app_discovery},
{bare,compile}]
===> Provider: {default,app_discovery}
===> Provider: {bare,compile}
===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump
===> Uncaught error: {badmatch,[]}
===> When submitting a bug report, please include the output of `rebar3 report "your command"`
** (Mix) Could not compile dependency :iso8601, "/home/calvin/.mix/rebar3 bare compile --paths="/home/calvin/work/backend/apps/event_service/_build/dev/lib/*/ebin"" command failed. You can recompile this dependency with "mix deps.compile iso8601", update it with "mix deps.update iso8601" or clean it with "mix deps.clean iso8601"
from aws-elixir.
It looks like mix
is using its own rebar3
though based on the command listed in the last line: /home/calvin/.mix/rebar3
. Is that rebar3
the one that was upgraded?
It would be useful to have a project where we can reproduce the error, since this looks like a problem with the interaction of mix+rebar3+iso8601
.
from aws-elixir.
Related Issues (20)
- nxdomain errror when using AWS.Location.search_place_index_for_text HOT 7
- Loading issue with modules that shouldn't be generated: AWS.Cloudsearchdomain and AWS.Importexport (Instead of CamelCase counterparts) HOT 2
- AWS.ApiGatewayManagementApi, URL and headers with stage HOT 1
- S3 put_object returns {:error, :timeout} but uploads file correctly HOT 5
- `AWS.S3.delete_objects` content md5 header HOT 5
- SelectObjectContent response HOT 1
- `AWS.STS.assume_role_with_web_identity` should not rely on access_key_id and secret_access_key
- Error calling textractor HOT 3
- Setting endpoint to `amazonaws.com` results in different behaviour as not setting an endpoint HOT 1
- AWS.S3.get_object always returns {:error, :timeout} with hackney > 1.18.1 HOT 5
- Streaming response handling HOT 10
- `put_bucket_cors` request is incorrect HOT 5
- Setup pipeline to automatically roll out new releases upon tagging
- S3 ListParts returns wrong types HOT 7
- QLDB Commit Transaction HOT 2
- NXDOMAIN when calling CostExplorer.get_cost_and_usage HOT 5
- Cannot get AWS Polly synthesize_speech to work HOT 3
- :nxdomain when calling AWS.CloudFront.list_distributions HOT 5
- Wrong region for Route53 requests HOT 12
- AWS.TimestreamWrite does not work. HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-elixir.