Software /
code /
prosody-modules
Comparison
mod_aws_profile/README.md @ 6003:fe081789f7b5
All community modules: Unify file extention of Markdown files to .md
author | Menel <menel@snikket.de> |
---|---|
date | Tue, 22 Oct 2024 10:26:01 +0200 |
parent | 3698:mod_aws_profile/README.markdown@1d719d4ef18f |
comparison
equal
deleted
inserted
replaced
6002:5a65a632d5b9 | 6003:fe081789f7b5 |
---|---|
1 # Introduction | |
2 | |
3 This module adds support for reading AWS IAM access credentials from EC2 instance metadata, | |
4 to allow Prosody modules to gain role-based access to AWS services. | |
5 | |
6 # Configuring | |
7 | |
8 ``` {.lua} | |
9 modules_enabled = { | |
10 "aws_profile"; | |
11 } | |
12 ``` | |
13 | |
14 There is no other configuration. | |
15 | |
16 # Usage in other modules | |
17 | |
18 Other modules can import the credentials as a shared table: | |
19 | |
20 ``` {.lua} | |
21 local aws_credentials = module:shared("/*/aws_profile/credentials"); | |
22 do_something(aws_credentials.access_key, aws_credentials.secret_key); | |
23 ``` | |
24 | |
25 Note that credentials are time-limited, and will change periodically. The | |
26 shared table will automatically be updated. If you need to know when this | |
27 happens, you can also hook the `'aws_profile/credentials-refreshed'` event: | |
28 | |
29 ``` {.lua} | |
30 module:hook_global("aws_profile/credentials-refreshed", function (new_credentials) | |
31 -- do something with new_credentials.access_key/secret_key | |
32 end); | |
33 ``` | |
34 | |
35 # Compatibility | |
36 | |
37 Meant for use with Prosody 0.11.x, may work in older versions. |