Skip to content

Commit

Permalink
release 1.3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
bungle committed Sep 19, 2023
1 parent dd4e38c commit cda0d67
Show file tree
Hide file tree
Showing 15 changed files with 254 additions and 225 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,12 @@ Release process:
1. upload using: `VERSION=x.y.z APIKEY=abc... make upload`
1. test installing the rock from LuaRocks


### 1.3.5 (19-Sep-2023)

- fix: lazily initialize structures to avoid c-boundary errors on require
[87](https://github.com/Kong/lua-resty-aws/pull/87)

### 1.3.4 (13-Sep-2023)

- fix: remove more module-level uses of config.global
Expand Down
3 changes: 1 addition & 2 deletions docs/classes/AWS.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ <h2>Topics</h2>
<h1>Class <code>AWS</code></h1>
<p>AWS class.</p>
<p>

</p>


Expand Down Expand Up @@ -151,7 +150,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-13 14:33:34 </i>
<i style="float:right;">Last updated 2023-09-19 17:44:16 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
3 changes: 1 addition & 2 deletions docs/classes/ChainableTemporaryCredentials.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ <h2>Topics</h2>
<h1>Class <code>ChainableTemporaryCredentials</code></h1>
<p>ChainableTemporaryCredentials class.</p>
<p>

</p>


Expand Down Expand Up @@ -147,7 +146,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-13 14:33:34 </i>
<i style="float:right;">Last updated 2023-09-19 17:44:16 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
20 changes: 9 additions & 11 deletions docs/classes/CredentialProviderChain.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ <h2>Topics</h2>
<h1>Class <code>CredentialProviderChain</code></h1>
<p>CredentialProviderChain class.</p>
<p>

</p>


Expand All @@ -91,19 +90,18 @@ <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 = '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>
<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>
</ol>


Expand Down Expand Up @@ -131,7 +129,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-13 14:33:34 </i>
<i style="float:right;">Last updated 2023-09-19 17:44:16 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
7 changes: 2 additions & 5 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't take a callback like AWS SDK.</p>
Returns credentials, doesn&rsquo;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,17 +232,14 @@ <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 @@ -266,7 +263,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-13 14:33:34 </i>
<i style="float:right;">Last updated 2023-09-19 17:44:16 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
3 changes: 1 addition & 2 deletions docs/classes/EC2MetadataCredentials.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ <h2>Topics</h2>
<h1>Class <code>EC2MetadataCredentials</code></h1>
<p>EC2MetadataCredentials class.</p>
<p>

</p>


Expand Down Expand Up @@ -113,7 +112,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-13 14:33:34 </i>
<i style="float:right;">Last updated 2023-09-19 17:44:16 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
5 changes: 2 additions & 3 deletions docs/classes/EnvironmentCredentials.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ <h2>Topics</h2>
<h1>Class <code>EnvironmentCredentials</code></h1>
<p>EnvironmentCredentials class.</p>
<p>

</p>


Expand Down Expand Up @@ -105,7 +104,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 "AWS".
prefix to use when looking for environment variables, defaults to &ldquo;AWS&rdquo;.
</li>
</li></ul>
</ul>
Expand All @@ -122,7 +121,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-13 14:33:34 </i>
<i style="float:right;">Last updated 2023-09-19 17:44:16 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
3 changes: 1 addition & 2 deletions docs/classes/RemoteCredentials.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ <h2>Topics</h2>
<h1>Class <code>RemoteCredentials</code></h1>
<p>RemoteCredentials class.</p>
<p>

</p>


Expand Down Expand Up @@ -113,7 +112,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-13 14:33:34 </i>
<i style="float:right;">Last updated 2023-09-19 17:44:16 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
3 changes: 1 addition & 2 deletions docs/classes/SharedFileCredentials.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ <h2>Topics</h2>
<h1>Class <code>SharedFileCredentials</code></h1>
<p>SharedFileCredentials class.</p>
<p>

</p>


Expand Down Expand Up @@ -113,7 +112,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-13 14:33:34 </i>
<i style="float:right;">Last updated 2023-09-19 17:44:16 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
3 changes: 1 addition & 2 deletions docs/classes/TokenFileWebIdentityCredentials.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ <h2>Topics</h2>
<h1>Class <code>TokenFileWebIdentityCredentials</code></h1>
<p>TokenFileWebIdentityCredentials class.</p>
<p>

</p>


Expand Down Expand Up @@ -128,7 +127,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-13 14:33:34 </i>
<i style="float:right;">Last updated 2023-09-19 17:44:16 </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-13 14:33:34 </i>
<i style="float:right;">Last updated 2023-09-19 17:44:16 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
72 changes: 33 additions & 39 deletions docs/modules/resty.aws.config.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,80 +66,74 @@ <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>

<p> Simply collect the global config table:
<pre>
<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>))
<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>))
</pre>

<p> <h3>Additional environment variables</h3></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:</p>

For example:
<pre>
export AWS_REGION=<span class="string">"us-east-1"</span>
export AWS_REGION=<span class="string">&ldquo;us-east-1&rdquo;</span>
</pre>

<p>will be available as <code>config.global.region</code> and <code>config.global.AWS_REGION</code>,
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:</p>

For example:
<pre>
export AWS_SHARED_CREDENTIALS_FILE=<span class="string">"~/my_aws_config"</span>
export AWS_SHARED_CREDENTIALS_FILE=<span class="string">&ldquo;~/my_aws_config&rdquo;</span>
</pre>

<p>will be available as <code>config.global.AWS_SHARED_CREDENTIALS_FILE</code>, since
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 @@ -261,7 +255,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 "profile [profile-name]".
then they will be sub-tables, with key &ldquo;profile [profile-name]&rdquo;.


<h3>Parameters:</h3>
Expand All @@ -273,7 +267,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't exist, then it returns an empty table. Use <code>&quot;default&quot;</code> to get the default profile.
the profile doesn&rsquo;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 @@ -319,7 +313,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 "[profile-name]".
then they will be sub-tables, with key &ldquo;[profile-name]&rdquo;.


<h3>Parameters:</h3>
Expand All @@ -331,7 +325,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't exist, then it returns an empty table. Use <code>default</code> to get the default profile.
the profile doesn&rsquo;t exist, then it returns an empty table. Use <code>default</code> to get the default profile.
(<em>optional</em>)
</li>
</ul>
Expand All @@ -354,7 +348,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-13 14:33:34 </i>
<i style="float:right;">Last updated 2023-09-19 17:44:16 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
Loading

0 comments on commit cda0d67

Please sign in to comment.