Skip to content

connection/aws_ssm - add caching and caching_ttl options to improve velocity #2278

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

abikouo
Copy link
Contributor

@abikouo abikouo commented Apr 8, 2025

SUMMARY

The new options ansible_aws_ssm_caching and ansible_aws_ssm_caching_ttl will help improve the velocity of the connection/aws_ssm plugin.
When ansible_aws_ssm_caching=True, the connection plugin will start a daemon with an SSM session that will be used for the allocated ansible_aws_ssm_caching_ttl time to handle all commands to the EC2 managed node.
This avoids setting a new session (along with the prepare_terminal steps) for each new command.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

connection/aws_ssm

Copy link

github-actions bot commented Apr 8, 2025

Docs Build 📝

Thank you for contribution!✨

The docsite for this PR is available for download as an artifact from this run:
https://github.com/ansible-collections/community.aws/actions/runs/14338404263

You can compare to the docs for the main branch here:
https://ansible-collections.github.io/community.aws/branch/main

File changes:

  • M collections/community/aws/aws_ssm_connection.html
Click to see the diff comparison.

NOTE: only file modifications are shown here. New and deleted files are excluded.
See the file list and check the published docs to see those files.

diff --git a/home/runner/work/community.aws/community.aws/docsbuild/base/collections/community/aws/aws_ssm_connection.html b/home/runner/work/community.aws/community.aws/docsbuild/head/collections/community/aws/aws_ssm_connection.html
index b62a732..3597fcc 100644
--- a/home/runner/work/community.aws/community.aws/docsbuild/base/collections/community/aws/aws_ssm_connection.html
+++ b/home/runner/work/community.aws/community.aws/docsbuild/head/collections/community/aws/aws_ssm_connection.html
@@ -245,6 +245,36 @@ see <a class="reference internal" href="#ansible-collections-community-aws-aws-s
 </div></td>
 </tr>
 <tr class="row-odd"><td><div class="ansible-option-cell">
+<div class="ansibleOptionAnchor" id="parameter-caching"></div><p class="ansible-option-title" id="ansible-collections-community-aws-aws-ssm-connection-parameter-caching"><strong>caching</strong></p>
+<a class="ansibleOptionLink" href="#parameter-caching" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">boolean</span></p>
+<p><em class="ansible-option-versionadded">added in community.aws 10.0.0</em></p>
+</div></td>
+<td><div class="ansible-option-cell"><p>The plugin will create a daemon starting a shell session to handle all command sent to the managed host.</p>
+<p class="ansible-option-line"><strong class="ansible-option-choices">Choices:</strong></p>
+<ul class="simple">
+<li><p><code class="ansible-option-default-bold docutils literal notranslate"><strong><span class="pre">false</span></strong></code> <span class="ansible-option-choices-default-mark">← (default)</span></p></li>
+<li><p><code class="ansible-option-choices-entry docutils literal notranslate"><span class="pre">true</span></code></p></li>
+</ul>
+<p class="ansible-option-line"><strong class="ansible-option-configuration">Configuration:</strong></p>
+<ul class="simple">
+<li><p>Variable: ansible_aws_ssm_caching</p></li>
+</ul>
+</div></td>
+</tr>
+<tr class="row-even"><td><div class="ansible-option-cell">
+<div class="ansibleOptionAnchor" id="parameter-caching_ttl"></div><p class="ansible-option-title" id="ansible-collections-community-aws-aws-ssm-connection-parameter-caching-ttl"><strong>caching_ttl</strong></p>
+<a class="ansibleOptionLink" href="#parameter-caching_ttl" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">integer</span></p>
+<p><em class="ansible-option-versionadded">added in community.aws 10.0.0</em></p>
+</div></td>
+<td><div class="ansible-option-cell"><p>The time (in seconds) the daemon will wait before exit when there is no incoming request.</p>
+<p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-option-default docutils literal notranslate"><span class="pre">30</span></code></p>
+<p class="ansible-option-line"><strong class="ansible-option-configuration">Configuration:</strong></p>
+<ul class="simple">
+<li><p>Variable: ansible_aws_ssm_caching_ttl</p></li>
+</ul>
+</div></td>
+</tr>
+<tr class="row-odd"><td><div class="ansible-option-cell">
 <div class="ansibleOptionAnchor" id="parameter-instance_id"></div><p class="ansible-option-title" id="ansible-collections-community-aws-aws-ssm-connection-parameter-instance-id"><strong>instance_id</strong></p>
 <a class="ansibleOptionLink" href="#parameter-instance_id" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
 </div></td>

Copy link
Contributor

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/81237c09cb664cf3b9f19abd0c89b0fa

ansible-galaxy-importer FAILURE in 5m 08s (non-voting)
✔️ build-ansible-collection SUCCESS in 11m 10s
✔️ ansible-test-splitter SUCCESS in 5m 04s
✔️ integration-community.aws-1 SUCCESS in 23m 58s
✔️ integration-community.aws-2 SUCCESS in 16m 57s
✔️ integration-community.aws-3 SUCCESS in 18m 15s
✔️ integration-community.aws-4 SUCCESS in 17m 08s
✔️ integration-community.aws-5 SUCCESS in 29m 39s
✔️ integration-community.aws-6 SUCCESS in 18m 50s
✔️ integration-community.aws-7 SUCCESS in 16m 42s
✔️ integration-community.aws-8 SUCCESS in 17m 02s
✔️ integration-community.aws-9 SUCCESS in 15m 05s
✔️ integration-community.aws-10 SUCCESS in 16m 39s
✔️ integration-community.aws-11 SUCCESS in 4m 25s
✔️ integration-community.aws-12 SUCCESS in 8m 38s
✔️ integration-community.aws-13 SUCCESS in 19m 14s
Skipped 9 jobs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant