Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release 1.3.6 #96

Merged
merged 1 commit into from
Dec 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,10 @@ Release process:
1. upload using: `VERSION=x.y.z APIKEY=abc... make upload`
1. test installing the rock from LuaRocks


### Unreleased

### 1.3.6 (25-Dec-2023)

- fix: validator failure for some of the field types
[95](https://github.com/Kong/lua-resty-aws/pull/95)

Expand Down
3 changes: 2 additions & 1 deletion docs/classes/AWS.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ <h2>Topics</h2>
<h1>Class <code>AWS</code></h1>
<p>AWS class.</p>
<p>

</p>


Expand Down Expand Up @@ -150,7 +151,7 @@ <h3>Usage:</h3>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
<i style="float:right;">Last updated 2023-09-19 17:44:16 </i>
<i style="float:right;">Last updated 2023-12-25 06:16:21 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
3 changes: 2 additions & 1 deletion docs/classes/ChainableTemporaryCredentials.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ <h2>Topics</h2>
<h1>Class <code>ChainableTemporaryCredentials</code></h1>
<p>ChainableTemporaryCredentials class.</p>
<p>

</p>


Expand Down Expand Up @@ -146,7 +147,7 @@ <h3>Usage:</h3>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
<i style="float:right;">Last updated 2023-09-19 17:44:16 </i>
<i style="float:right;">Last updated 2023-12-25 06:16:21 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
20 changes: 11 additions & 9 deletions docs/classes/CredentialProviderChain.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ <h2>Topics</h2>
<h1>Class <code>CredentialProviderChain</code></h1>
<p>CredentialProviderChain class.</p>
<p>

</p>


Expand All @@ -90,18 +91,19 @@ <h2 class="section-header "><a name="Functions"></a>Functions</h2>
<strong>aws:CredentialProviderChain (opt)</strong>
</dt>
<dd>
<p>Constructor, inherits from <a href="../classes/Credentials.html#">Credentials</a>. </p>

<p>Constructor, inherits from <a href="../classes/Credentials.html#">Credentials</a>. </p>

<p> The <code>providers</code> array defaults to the following list (in order, not all implemented):</p>

<ol>
<li><p><a href="../classes/EnvironmentCredentials.html#">EnvironmentCredentials</a>; envPrefix = &lsquo;AWS&rsquo;</p></li>
<li><p><a href="../classes/EnvironmentCredentials.html#">EnvironmentCredentials</a>; envPrefix = &lsquo;AMAZON&rsquo;</p></li>
<li><p><code>SharedIniFileCredentials</code></p></li>
<li><p><a href="../classes/RemoteCredentials.html#">RemoteCredentials</a></p></li>
<li><p><code>ProcessCredentials</code></p></li>
<li><p><a href="../classes/TokenFileWebIdentityCredentials.html#">TokenFileWebIdentityCredentials</a></p></li>
<li><p><a href="../classes/EC2MetadataCredentials.html#">EC2MetadataCredentials</a> (only if <code>AWS_EC2_METADATA_DISABLED</code> hasn&rsquo;t been set to <code>true</code>)</p></li>
<li><p><a href="../classes/EnvironmentCredentials.html#">EnvironmentCredentials</a>; envPrefix = 'AWS'</p></li>
<li><p><a href="../classes/EnvironmentCredentials.html#">EnvironmentCredentials</a>; envPrefix = 'AMAZON'</p></li>
<li><p><code>SharedIniFileCredentials</code></p></li>
<li><p><a href="../classes/RemoteCredentials.html#">RemoteCredentials</a></p></li>
<li><p><code>ProcessCredentials</code></p></li>
<li><p><a href="../classes/TokenFileWebIdentityCredentials.html#">TokenFileWebIdentityCredentials</a></p></li>
<li><p><a href="../classes/EC2MetadataCredentials.html#">EC2MetadataCredentials</a> (only if <code>AWS_EC2_METADATA_DISABLED</code> hasn't been set to <code>true</code>)</p></li>
</ol>


Expand Down Expand Up @@ -129,7 +131,7 @@ <h3>Parameters:</h3>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
<i style="float:right;">Last updated 2023-09-19 17:44:16 </i>
<i style="float:right;">Last updated 2023-12-25 06:16:21 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
7 changes: 5 additions & 2 deletions docs/classes/Credentials.html
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ <h2 class="section-header "><a name="Methods"></a>Methods</h2>
</dt>
<dd>
Gets credentials, refreshes if required.
Returns credentials, doesn&rsquo;t take a callback like AWS SDK.</p>
Returns credentials, doesn't take a callback like AWS SDK.</p>

<p> When a refresh is executed, it will be done within a semaphore to prevent
many simultaneous refreshes.
Expand Down Expand Up @@ -232,14 +232,17 @@ <h3>Parameters:</h3>
<li><span class="parameter">accessKeyId</span>



</li>
<li><span class="parameter">secretAccessKey</span>



</li>
<li><span class="parameter">sessionToken</span>



</li>
<li><span class="parameter">expireTime</span>
(optional) number (unix epoch based), or string (valid rfc 3339)
Expand All @@ -263,7 +266,7 @@ <h3>Returns:</h3>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
<i style="float:right;">Last updated 2023-09-19 17:44:16 </i>
<i style="float:right;">Last updated 2023-12-25 06:16:21 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
3 changes: 2 additions & 1 deletion docs/classes/EC2MetadataCredentials.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ <h2>Topics</h2>
<h1>Class <code>EC2MetadataCredentials</code></h1>
<p>EC2MetadataCredentials class.</p>
<p>

</p>


Expand Down Expand Up @@ -112,7 +113,7 @@ <h3>Parameters:</h3>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
<i style="float:right;">Last updated 2023-09-19 17:44:16 </i>
<i style="float:right;">Last updated 2023-12-25 06:16:21 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
5 changes: 3 additions & 2 deletions docs/classes/EnvironmentCredentials.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ <h2>Topics</h2>
<h1>Class <code>EnvironmentCredentials</code></h1>
<p>EnvironmentCredentials class.</p>
<p>

</p>


Expand Down Expand Up @@ -104,7 +105,7 @@ <h3>Parameters:</h3>
<li><span class="parameter">opt</span> options table, additional fields to the <a href="../classes/Credentials.html#">Credentials</a> class:
<ul>
<li><span class="parameter">envPrefix</span>
prefix to use when looking for environment variables, defaults to &ldquo;AWS&rdquo;.
prefix to use when looking for environment variables, defaults to "AWS".
</li>
</li></ul>
</ul>
Expand All @@ -121,7 +122,7 @@ <h3>Parameters:</h3>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
<i style="float:right;">Last updated 2023-09-19 17:44:16 </i>
<i style="float:right;">Last updated 2023-12-25 06:16:21 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
3 changes: 2 additions & 1 deletion docs/classes/RemoteCredentials.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ <h2>Topics</h2>
<h1>Class <code>RemoteCredentials</code></h1>
<p>RemoteCredentials class.</p>
<p>

</p>


Expand Down Expand Up @@ -112,7 +113,7 @@ <h3>Parameters:</h3>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
<i style="float:right;">Last updated 2023-09-19 17:44:16 </i>
<i style="float:right;">Last updated 2023-12-25 06:16:21 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
3 changes: 2 additions & 1 deletion docs/classes/SharedFileCredentials.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ <h2>Topics</h2>
<h1>Class <code>SharedFileCredentials</code></h1>
<p>SharedFileCredentials class.</p>
<p>

</p>


Expand Down Expand Up @@ -112,7 +113,7 @@ <h3>Parameters:</h3>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
<i style="float:right;">Last updated 2023-09-19 17:44:16 </i>
<i style="float:right;">Last updated 2023-12-25 06:16:21 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
3 changes: 2 additions & 1 deletion docs/classes/TokenFileWebIdentityCredentials.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ <h2>Topics</h2>
<h1>Class <code>TokenFileWebIdentityCredentials</code></h1>
<p>TokenFileWebIdentityCredentials class.</p>
<p>

</p>


Expand Down Expand Up @@ -127,7 +128,7 @@ <h3>Parameters:</h3>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
<i style="float:right;">Last updated 2023-09-19 17:44:16 </i>
<i style="float:right;">Last updated 2023-12-25 06:16:21 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ <h2>Topics</h2>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
<i style="float:right;">Last updated 2023-09-19 17:44:16 </i>
<i style="float:right;">Last updated 2023-12-25 06:16:21 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
72 changes: 39 additions & 33 deletions docs/modules/resty.aws.config.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,74 +66,80 @@ <h2>Topics</h2>

<h1>Module <code>resty.aws.config</code></h1>
<p>Load AWS configuration.</p>
<p><p> This is based of <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html">Configuration and credential file settings</a>
<p>


<p> This is based of <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html">Configuration and credential file settings</a>
and <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html">Environment variables to configure the AWS CLI</a>.</p>

<p> NOTE: this configuration resembles the CLI configuration. It is NOT the input object
for instantiating the AWS instances, or individual services!</p>

<p> <h3>Usage</h3></p>

<p> Simply collect the global config table:
<p> Simply collect the global config table:</p>

<pre>
<span class="keyword">local</span> config = <span class="global">require</span>(<span class="string">&ldquo;resty.aws.config&rdquo;</span>).global
<span class="global">print</span>(<span class="string">&ldquo;AWS region: &rdquo;</span>, (config.region <span class="keyword">or</span> <span class="string">&ldquo;failed to detect&rdquo;</span>))
<span class="keyword">local</span> config = <span class="global">require</span>(<span class="string">"resty.aws.config"</span>).global
<span class="global">print</span>(<span class="string">"AWS region: "</span>, (config.region <span class="keyword">or</span> <span class="string">"failed to detect"</span>))
</pre>
<h3>Additional environment variables</h3></p>

<p> <h3>Additional environment variables</h3></p>

<p> The following config file entries do not have an environment variable override
in the AWS CLI, but this Lua module adds them as follows:</p>

<ul>
<li><code>AWS_CLI_TIMESTAMP_FORMAT</code> will override <code>cli_timestamp_format</code></li>
<li><code>AWS_DURATION_SECONDS</code> will override <code>duration_seconds</code></li>
<li><code>AWS_PARAMETER_VALIDATION</code> will override <code>parameter_validation</code></li>
<li><code>AWS_CLI_TIMESTAMP_FORMAT</code> will override <code>cli_timestamp_format</code></li>
<li><code>AWS_DURATION_SECONDS</code> will override <code>duration_seconds</code></li>
<li><code>AWS_PARAMETER_VALIDATION</code> will override <code>parameter_validation</code></li>
</ul>


<p> <h3>Options processing and naming</h3></p>

<p> Some options are available in the config/credential files, some as environment
variables, and some in both. The options are processed as follows:</p>

<ul>
<li><p>profiles will be honored (see environment variable <code>AWS_PROFILE</code>)</p></li>
<li><p>Numeric and boolean values will be converted to their equivalent Lua types</p></li>
<li><p>properties will have the name as used in the config file, for any property
<li><p>profiles will be honored (see environment variable <code>AWS_PROFILE</code>)</p></li>
<li><p>Numeric and boolean values will be converted to their equivalent Lua types</p></li>
<li><p>properties will have the name as used in the config file, for any property
that is a valid config file entry but also has an environment variable override.
For example:
For example:</p>

<pre>
export AWS_REGION=<span class="string">&ldquo;us-east-1&rdquo;</span>
export AWS_REGION=<span class="string">"us-east-1"</span>
</pre>
will be available as <code>config.global.region</code> and <code>config.global.AWS_REGION</code>,

<p>will be available as <code>config.global.region</code> and <code>config.global.AWS_REGION</code>,
since in the config file the property
is named <code>region</code>, whilst the environment variable is called <code>AWS_REGION</code>.</p></li>
<li><p>properties that only have environment variable settings (eg. <code>AWS_SHARED_CREDENTIALS_FILE</code>)
<li><p>properties that only have environment variable settings (eg. <code>AWS_SHARED_CREDENTIALS_FILE</code>)
will be added to the config table by their all-caps name.
For example:
For example:</p>

<pre>
export AWS_SHARED_CREDENTIALS_FILE=<span class="string">&ldquo;~/my_aws_config&rdquo;</span>
export AWS_SHARED_CREDENTIALS_FILE=<span class="string">"~/my_aws_config"</span>
</pre>
will be available as <code>config.global.AWS_SHARED_CREDENTIALS_FILE</code>, since

<p>will be available as <code>config.global.AWS_SHARED_CREDENTIALS_FILE</code>, since
there is no config file property in this case.</p></li>
</ul>


<p> <h3>Other system variables</h3></p>

<p> The following environment variables are also read (so only loading this config
module in the <code>init</code> phase will suffice for most use cases):</p>

<ul>
<li><code>ECS_CONTAINER_METADATA_URI_V4</code></li>
<li><code>ECS_CONTAINER_METADATA_URI</code></li>
<li><code>AMAZON_ACCESS_KEY_ID</code></li>
<li><code>AMAZON_SECRET_ACCESS_KEY</code></li>
<li><code>AMAZON_SESSION_TOKEN</code></li>
<li><code>AWS_CONTAINER_CREDENTIALS_RELATIVE_URI</code></li>
<li><code>AWS_CONTAINER_CREDENTIALS_FULL_URI</code></li>
<li><code>ECS_CONTAINER_METADATA_URI_V4</code></li>
<li><code>ECS_CONTAINER_METADATA_URI</code></li>
<li><code>AMAZON_ACCESS_KEY_ID</code></li>
<li><code>AMAZON_SECRET_ACCESS_KEY</code></li>
<li><code>AMAZON_SESSION_TOKEN</code></li>
<li><code>AWS_CONTAINER_CREDENTIALS_RELATIVE_URI</code></li>
<li><code>AWS_CONTAINER_CREDENTIALS_FULL_URI</code></li>
</ul>

</p>


Expand Down Expand Up @@ -255,7 +261,7 @@ <h3>Returns:</h3>
<dd>
loads a configuration file.
The returned table is a hash table with options. If profiles are returned
then they will be sub-tables, with key &ldquo;profile [profile-name]&rdquo;.
then they will be sub-tables, with key "profile [profile-name]".


<h3>Parameters:</h3>
Expand All @@ -267,7 +273,7 @@ <h3>Parameters:</h3>
<li><span class="parameter">profile</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
the profile to retrieve from the configuration file. If
the profile doesn&rsquo;t exist, then it returns an empty table. Use <code>&quot;default&quot;</code> to get the default profile.
the profile doesn't exist, then it returns an empty table. Use <code>&quot;default&quot;</code> to get the default profile.
(<em>optional</em>)
</li>
</ul>
Expand Down Expand Up @@ -313,7 +319,7 @@ <h3>Returns:</h3>
<dd>
loads a credential file.
The returned table is a hash table with options. If profiles are returned
then they will be sub-tables, with key &ldquo;[profile-name]&rdquo;.
then they will be sub-tables, with key "[profile-name]".


<h3>Parameters:</h3>
Expand All @@ -325,7 +331,7 @@ <h3>Parameters:</h3>
<li><span class="parameter">profile</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
the profile to retrieve from the credentials file. If
the profile doesn&rsquo;t exist, then it returns an empty table. Use <code>default</code> to get the default profile.
the profile doesn't exist, then it returns an empty table. Use <code>default</code> to get the default profile.
(<em>optional</em>)
</li>
</ul>
Expand All @@ -348,7 +354,7 @@ <h3>Returns:</h3>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
<i style="float:right;">Last updated 2023-09-19 17:44:16 </i>
<i style="float:right;">Last updated 2023-12-25 06:16:21 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
Loading
Loading