Skip to content

New modules: cloudmap_namespace and cloudmap_info - #2411

Open
jonpspri wants to merge 4 commits into
ansible-collections:mainfrom
jonpspri:cloudmap
Open

New modules: cloudmap_namespace and cloudmap_info#2411
jonpspri wants to merge 4 commits into
ansible-collections:mainfrom
jonpspri:cloudmap

Conversation

@jonpspri

@jonpspri jonpspri commented Feb 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add cloudmap_namespace module for creating/deleting AWS Cloud Map public and private DNS namespaces with wait support, SOA property handling, and DuplicateRequest tolerance on delete
  • Add cloudmap_info module for querying Cloud Map namespaces, services, and instances by name or ID
  • Register both modules in meta/runtime.yml action groups
  • Add integration tests covering create, idempotency, info queries, delete, and delete idempotency for both public and private namespaces

Test plan

  • Integration tests pass: ansible-test integration --docker default cloudmap_namespace
  • ansible-test sanity pylint and validate-modules checks pass
  • Verify custom SOA properties are preserved correctly through camelCase conversion

New modules for managing AWS Cloud Map namespaces (public and private DNS)
and querying namespace/service/instance information. Includes:

- cloudmap_namespace: create/delete with wait support, SOA property handling,
  DuplicateRequest tolerance on delete, namespace_type required for both
  present and absent states to prevent wrong-target deletion
- cloudmap_info: query by namespace name or ID with optional instance details
- Integration tests covering create, idempotency, info queries, delete,
  and delete idempotency for both public and private namespaces
- Registered both modules in meta/runtime.yml action_groups
Copilot AI review requested due to automatic review settings February 7, 2026 20:37
@github-actions

github-actions Bot commented Feb 7, 2026

Copy link
Copy Markdown

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/22064863092

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

File changes:

  • A collections/community/aws/cloudmap_info_module.html
  • A collections/community/aws/cloudmap_namespace_module.html
  • M collections/community/aws/cloudfront_response_headers_policy_module.html
  • M collections/community/aws/codebuild_project_module.html
  • M collections/community/aws/index.html
  • M collections/index_module.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/cloudfront_response_headers_policy_module.html b/home/runner/work/community.aws/community.aws/docsbuild/head/collections/community/aws/cloudfront_response_headers_policy_module.html
index da0464e..82e0993 100644
--- a/home/runner/work/community.aws/community.aws/docsbuild/base/collections/community/aws/cloudfront_response_headers_policy_module.html
+++ b/home/runner/work/community.aws/community.aws/docsbuild/head/collections/community/aws/cloudfront_response_headers_policy_module.html
@@ -22,7 +22,7 @@
       <script src="../../../_static/sphinx_highlight.js?v=6ffebe34"></script>
     <script src="../../../_static/js/theme.js"></script>
     <link rel="search" title="Search" href="../../../search.html" />
-    <link rel="next" title="community.aws.codebuild_project module – Create or delete an AWS CodeBuild project" href="codebuild_project_module.html" />
+    <link rel="next" title="community.aws.cloudmap_info module – Retrieve information about AWS Cloud Map services and instances" href="cloudmap_info_module.html" />
     <link rel="prev" title="community.aws.cloudfront_origin_access_identity module – Create, update and delete origin access identities for a CloudFront distribution" href="cloudfront_origin_access_identity_module.html" /><!-- extra head elements for Ansible beyond RTD Sphinx Theme -->
 
 
@@ -494,7 +494,7 @@ see <a class="reference internal" href="#ansible-collections-community-aws-cloud
 
 <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
         <a href="cloudfront_origin_access_identity_module.html" class="btn btn-neutral float-left" title="community.aws.cloudfront_origin_access_identity module – Create, update and delete origin access identities for a CloudFront distribution" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
-        <a href="codebuild_project_module.html" class="btn btn-neutral float-right" title="community.aws.codebuild_project module – Create or delete an AWS CodeBuild project" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
+        <a href="cloudmap_info_module.html" class="btn btn-neutral float-right" title="community.aws.cloudmap_info module – Retrieve information about AWS Cloud Map services and instances" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
     </div>
 
   <hr/>
diff --git a/home/runner/work/community.aws/community.aws/docsbuild/base/collections/community/aws/codebuild_project_module.html b/home/runner/work/community.aws/community.aws/docsbuild/head/collections/community/aws/codebuild_project_module.html
index 02074ff..1053fe6 100644
--- a/home/runner/work/community.aws/community.aws/docsbuild/base/collections/community/aws/codebuild_project_module.html
+++ b/home/runner/work/community.aws/community.aws/docsbuild/head/collections/community/aws/codebuild_project_module.html
@@ -23,7 +23,7 @@
     <script src="../../../_static/js/theme.js"></script>
     <link rel="search" title="Search" href="../../../search.html" />
     <link rel="next" title="community.aws.codecommit_repository module – Manage repositories in AWS CodeCommit" href="codecommit_repository_module.html" />
-    <link rel="prev" title="community.aws.cloudfront_response_headers_policy module – Create, update and delete response headers policies to be used in a Cloudfront distribution" href="cloudfront_response_headers_policy_module.html" /><!-- extra head elements for Ansible beyond RTD Sphinx Theme -->
+    <link rel="prev" title="community.aws.cloudmap_namespace module – Create or delete AWS Cloud Map namespaces" href="cloudmap_namespace_module.html" /><!-- extra head elements for Ansible beyond RTD Sphinx Theme -->
 
 
 
@@ -801,7 +801,7 @@ see <a class="reference internal" href="#ansible-collections-community-aws-codeb
           
 
 <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
-        <a href="cloudfront_response_headers_policy_module.html" class="btn btn-neutral float-left" title="community.aws.cloudfront_response_headers_policy module – Create, update and delete response headers policies to be used in a Cloudfront distribution" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
+        <a href="cloudmap_namespace_module.html" class="btn btn-neutral float-left" title="community.aws.cloudmap_namespace module – Create or delete AWS Cloud Map namespaces" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
         <a href="codecommit_repository_module.html" class="btn btn-neutral float-right" title="community.aws.codecommit_repository module – Manage repositories in AWS CodeCommit" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
     </div>
 
diff --git a/home/runner/work/community.aws/community.aws/docsbuild/base/collections/community/aws/index.html b/home/runner/work/community.aws/community.aws/docsbuild/head/collections/community/aws/index.html
index 7f63cd4..cad9a47 100644
--- a/home/runner/work/community.aws/community.aws/docsbuild/base/collections/community/aws/index.html
+++ b/home/runner/work/community.aws/community.aws/docsbuild/head/collections/community/aws/index.html
@@ -202,6 +202,8 @@
 <li><p><a class="reference internal" href="cloudfront_invalidation_module.html#ansible-collections-community-aws-cloudfront-invalidation-module"><span class="std std-ref">cloudfront_invalidation module</span></a> – create invalidations for AWS CloudFront distributions</p></li>
 <li><p><a class="reference internal" href="cloudfront_origin_access_identity_module.html#ansible-collections-community-aws-cloudfront-origin-access-identity-module"><span class="std std-ref">cloudfront_origin_access_identity module</span></a> – Create, update and delete origin access identities for a CloudFront distribution</p></li>
 <li><p><a class="reference internal" href="cloudfront_response_headers_policy_module.html#ansible-collections-community-aws-cloudfront-response-headers-policy-module"><span class="std std-ref">cloudfront_response_headers_policy module</span></a> – Create, update and delete response headers policies to be used in a Cloudfront distribution</p></li>
+<li><p><a class="reference internal" href="cloudmap_info_module.html#ansible-collections-community-aws-cloudmap-info-module"><span class="std std-ref">cloudmap_info module</span></a> – Retrieve information about AWS Cloud Map services and instances</p></li>
+<li><p><a class="reference internal" href="cloudmap_namespace_module.html#ansible-collections-community-aws-cloudmap-namespace-module"><span class="std std-ref">cloudmap_namespace module</span></a> – Create or delete AWS Cloud Map namespaces</p></li>
 <li><p><a class="reference internal" href="codebuild_project_module.html#ansible-collections-community-aws-codebuild-project-module"><span class="std std-ref">codebuild_project module</span></a> – Create or delete an AWS CodeBuild project</p></li>
 <li><p><a class="reference internal" href="codecommit_repository_module.html#ansible-collections-community-aws-codecommit-repository-module"><span class="std std-ref">codecommit_repository module</span></a> – Manage repositories in AWS CodeCommit</p></li>
 <li><p><a class="reference internal" href="codepipeline_module.html#ansible-collections-community-aws-codepipeline-module"><span class="std std-ref">codepipeline module</span></a> – Create or delete AWS CodePipelines</p></li>
diff --git a/home/runner/work/community.aws/community.aws/docsbuild/base/collections/index_module.html b/home/runner/work/community.aws/community.aws/docsbuild/head/collections/index_module.html
index 70b206e..e1023a1 100644
--- a/home/runner/work/community.aws/community.aws/docsbuild/base/collections/index_module.html
+++ b/home/runner/work/community.aws/community.aws/docsbuild/head/collections/index_module.html
@@ -145,6 +145,8 @@
 <li><p><a class="reference internal" href="community/aws/cloudfront_invalidation_module.html#ansible-collections-community-aws-cloudfront-invalidation-module"><span class="std std-ref">community.aws.cloudfront_invalidation</span></a> – create invalidations for AWS CloudFront distributions</p></li>
 <li><p><a class="reference internal" href="community/aws/cloudfront_origin_access_identity_module.html#ansible-collections-community-aws-cloudfront-origin-access-identity-module"><span class="std std-ref">community.aws.cloudfront_origin_access_identity</span></a> – Create, update and delete origin access identities for a CloudFront distribution</p></li>
 <li><p><a class="reference internal" href="community/aws/cloudfront_response_headers_policy_module.html#ansible-collections-community-aws-cloudfront-response-headers-policy-module"><span class="std std-ref">community.aws.cloudfront_response_headers_policy</span></a> – Create, update and delete response headers policies to be used in a Cloudfront distribution</p></li>
+<li><p><a class="reference internal" href="community/aws/cloudmap_info_module.html#ansible-collections-community-aws-cloudmap-info-module"><span class="std std-ref">community.aws.cloudmap_info</span></a> – Retrieve information about AWS Cloud Map services and instances</p></li>
+<li><p><a class="reference internal" href="community/aws/cloudmap_namespace_module.html#ansible-collections-community-aws-cloudmap-namespace-module"><span class="std std-ref">community.aws.cloudmap_namespace</span></a> – Create or delete AWS Cloud Map namespaces</p></li>
 <li><p><a class="reference internal" href="community/aws/codebuild_project_module.html#ansible-collections-community-aws-codebuild-project-module"><span class="std std-ref">community.aws.codebuild_project</span></a> – Create or delete an AWS CodeBuild project</p></li>
 <li><p><a class="reference internal" href="community/aws/codecommit_repository_module.html#ansible-collections-community-aws-codecommit-repository-module"><span class="std std-ref">community.aws.codecommit_repository</span></a> – Manage repositories in AWS CodeCommit</p></li>
 <li><p><a class="reference internal" href="community/aws/codepipeline_module.html#ansible-collections-community-aws-codepipeline-module"><span class="std std-ref">community.aws.codepipeline</span></a> – Create or delete AWS CodePipelines</p></li>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces new Ansible modules to manage and query AWS Cloud Map namespaces, and adds an integration test target to validate namespace lifecycle and info lookups.

Changes:

  • Added cloudmap_namespace module to create/delete public and private DNS namespaces with optional wait support.
  • Added cloudmap_info module to query namespaces and list services/instances.
  • Registered both modules in meta/runtime.yml and added integration tests under tests/integration/targets/cloudmap_namespace.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
plugins/modules/cloudmap_namespace.py Implements create/delete logic, wait/polling, properties and tag handling for Cloud Map namespaces.
plugins/modules/cloudmap_info.py Implements namespace resolution plus service and instance listing and formatting.
meta/runtime.yml Adds the new modules to the aws action group.
tests/integration/targets/cloudmap_namespace/tasks/main.yml Integration coverage for create/idempotency/info queries/delete/idempotent delete.
tests/integration/targets/cloudmap_namespace/tasks/99_cleanup.yml Cleanup logic for namespaces and VPC used in tests.
tests/integration/targets/cloudmap_namespace/defaults/main.yml Defines default namespace names/description for the test target.
tests/integration/targets/cloudmap_namespace/meta/main.yml Adds empty dependencies for the integration target.
tests/integration/targets/cloudmap_namespace/aliases Registers the integration target aliases and timeout.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread plugins/modules/cloudmap_namespace.py Outdated
Comment thread plugins/modules/cloudmap_namespace.py
Comment thread plugins/modules/cloudmap_namespace.py Outdated
Comment thread plugins/modules/cloudmap_info.py
Comment thread plugins/modules/cloudmap_namespace.py Outdated
@softwarefactory-project-zuul

Copy link
Copy Markdown
Contributor

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/1a80cc9abbb741989154129266812f76

✔️ ansible-galaxy-importer SUCCESS in 4m 55s (non-voting)
✔️ build-ansible-collection SUCCESS in 11m 30s
✔️ ansible-test-splitter SUCCESS in 4m 20s
integration-community.aws-1 FAILURE in 3m 54s
Skipped 21 jobs

- Fix properties PascalCase bug (capitalize_first=True) and add TTL normalization
- Normalize namespace return data to consistent snake_case via format_namespace()
- Update RETURN docs to match actual output
- Validate service_id belongs to the resolved namespace in cloudmap_info
- Make namespace_type required, drop redundant required_if
@softwarefactory-project-zuul

Copy link
Copy Markdown
Contributor

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/1878e39b94ac414688b09d2b467373b9

⚠️ ansible-galaxy-importer SKIPPED Skipped due to failed job build-ansible-collection (non-voting)
build-ansible-collection FAILURE in 8m 03s
✔️ ansible-test-splitter SUCCESS in 4m 22s
⚠️ integration-community.aws-1 SKIPPED Skipped due to failed job build-ansible-collection
Skipped 21 jobs

Comment thread plugins/modules/cloudmap_info.py Outdated
Comment thread plugins/modules/cloudmap_info.py Outdated
Comment thread plugins/modules/cloudmap_info.py Outdated
Comment thread plugins/modules/cloudmap_info.py Outdated
Comment thread plugins/modules/cloudmap_info.py Outdated
Comment thread plugins/modules/cloudmap_namespace.py Outdated
Comment thread plugins/modules/cloudmap_namespace.py Outdated
Comment thread plugins/modules/cloudmap_namespace.py Outdated
Comment thread tests/integration/targets/cloudmap_namespace/tasks/main.yml
Co-authored-by: Alina Buzachis <abuzachis@redhat.com>
@softwarefactory-project-zuul

Copy link
Copy Markdown
Contributor

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/77f0f63e754e4a258ba8ee8dc1d0d30a

✔️ ansible-galaxy-importer SUCCESS in 3m 53s (non-voting)
✔️ build-ansible-collection SUCCESS in 11m 04s
✔️ ansible-test-splitter SUCCESS in 4m 17s
integration-community.aws-1 FAILURE in 4m 05s
Skipped 21 jobs

- Add check_mode tests for cloudmap_namespace create/delete (both
  public and private) and cloudmap_info queries
- Fix PascalCase assertion keys (Id, Type, Name) to match snake_case
  output from format_namespace() (id, type, name)
- Fix pep8 line-too-long in namespace_type docstring
@softwarefactory-project-zuul

Copy link
Copy Markdown
Contributor

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/da7e8b36a9694b9084c623fc2050ebff

✔️ ansible-galaxy-importer SUCCESS in 5m 01s (non-voting)
✔️ build-ansible-collection SUCCESS in 11m 24s
✔️ ansible-test-splitter SUCCESS in 4m 21s
integration-community.aws-1 FAILURE in 3m 58s
Skipped 21 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.

3 participants