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

route53_ksk - new module #2412

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

Conversation

alinabuzachis
Copy link
Collaborator

@alinabuzachis alinabuzachis commented Dec 4, 2024

SUMMARY

Terminator PR mattclay/aws-terminator#312

Closes #1976

ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME

route53_ksk

ADDITIONAL INFORMATION

Signed-off-by: Alina Buzachis <[email protected]>
Signed-off-by: Alina Buzachis <[email protected]>
Signed-off-by: Alina Buzachis <[email protected]>
Signed-off-by: Alina Buzachis <[email protected]>
Signed-off-by: Alina Buzachis <[email protected]>
Copy link

github-actions bot commented Dec 4, 2024

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/amazon.aws/actions/runs/12280444854

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

File changes:

  • A collections/amazon/aws/route53_ksk_module.html
  • M collections/amazon/aws/index.html
  • M collections/amazon/aws/route53_info_module.html
  • M collections/amazon/aws/route53_zone_module.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/amazon.aws/amazon.aws/docsbuild/base/collections/amazon/aws/index.html b/home/runner/work/amazon.aws/amazon.aws/docsbuild/head/collections/amazon/aws/index.html
index 756215f..809427f 100644
--- a/home/runner/work/amazon.aws/amazon.aws/docsbuild/base/collections/amazon/aws/index.html
+++ b/home/runner/work/amazon.aws/amazon.aws/docsbuild/head/collections/amazon/aws/index.html
@@ -346,6 +346,7 @@
 <li><p><a class="reference internal" href="route53_module.html#ansible-collections-amazon-aws-route53-module"><span class="std std-ref">route53 module</span></a> – add or delete entries in Amazons Route 53 DNS service</p></li>
 <li><p><a class="reference internal" href="route53_health_check_module.html#ansible-collections-amazon-aws-route53-health-check-module"><span class="std std-ref">route53_health_check module</span></a> – Manage health checks in Amazons Route 53 DNS service</p></li>
 <li><p><a class="reference internal" href="route53_info_module.html#ansible-collections-amazon-aws-route53-info-module"><span class="std std-ref">route53_info module</span></a> – Retrieves Route 53 details using AWS methods</p></li>
+<li><p><a class="reference internal" href="route53_ksk_module.html#ansible-collections-amazon-aws-route53-ksk-module"><span class="std std-ref">route53_ksk module</span></a> – Manages a key-signing key (KSK)</p></li>
 <li><p><a class="reference internal" href="route53_zone_module.html#ansible-collections-amazon-aws-route53-zone-module"><span class="std std-ref">route53_zone module</span></a> – add or delete Route 53 zones</p></li>
 <li><p><a class="reference internal" href="s3_bucket_module.html#ansible-collections-amazon-aws-s3-bucket-module"><span class="std std-ref">s3_bucket module</span></a> – Manage S3 buckets in AWS, DigitalOcean, Ceph, Walrus, FakeS3 and StorageGRID</p></li>
 <li><p><a class="reference internal" href="s3_bucket_info_module.html#ansible-collections-amazon-aws-s3-bucket-info-module"><span class="std std-ref">s3_bucket_info module</span></a> – Lists S3 buckets in AWS</p></li>
diff --git a/home/runner/work/amazon.aws/amazon.aws/docsbuild/base/collections/amazon/aws/route53_info_module.html b/home/runner/work/amazon.aws/amazon.aws/docsbuild/head/collections/amazon/aws/route53_info_module.html
index 3866d22..2e6cc1b 100644
--- a/home/runner/work/amazon.aws/amazon.aws/docsbuild/base/collections/amazon/aws/route53_info_module.html
+++ b/home/runner/work/amazon.aws/amazon.aws/docsbuild/head/collections/amazon/aws/route53_info_module.html
@@ -22,7 +22,7 @@
       <script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
     <script src="../../../_static/js/theme.js"></script>
     <link rel="search" title="Search" href="../../../search.html" />
-    <link rel="next" title="amazon.aws.route53_zone module – add or delete Route 53 zones" href="route53_zone_module.html" />
+    <link rel="next" title="amazon.aws.route53_ksk module – Manages a key-signing key (KSK)" href="route53_ksk_module.html" />
     <link rel="prev" title="amazon.aws.route53_health_check module – Manage health checks in Amazons Route 53 DNS service" href="route53_health_check_module.html" /><!-- extra head elements for Ansible beyond RTD Sphinx Theme -->
 
 
@@ -1173,7 +1173,7 @@ see <a class="reference internal" href="#ansible-collections-amazon-aws-route53-
 
 <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
         <a href="route53_health_check_module.html" class="btn btn-neutral float-left" title="amazon.aws.route53_health_check module – Manage health checks in Amazons Route 53 DNS service" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
-        <a href="route53_zone_module.html" class="btn btn-neutral float-right" title="amazon.aws.route53_zone module – add or delete Route 53 zones" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
+        <a href="route53_ksk_module.html" class="btn btn-neutral float-right" title="amazon.aws.route53_ksk module – Manages a key-signing key (KSK)" 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/amazon.aws/amazon.aws/docsbuild/base/collections/amazon/aws/route53_zone_module.html b/home/runner/work/amazon.aws/amazon.aws/docsbuild/head/collections/amazon/aws/route53_zone_module.html
index 571a00c..eab1cf2 100644
--- a/home/runner/work/amazon.aws/amazon.aws/docsbuild/base/collections/amazon/aws/route53_zone_module.html
+++ b/home/runner/work/amazon.aws/amazon.aws/docsbuild/head/collections/amazon/aws/route53_zone_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="amazon.aws.s3_bucket module – Manage S3 buckets in AWS, DigitalOcean, Ceph, Walrus, FakeS3 and StorageGRID" href="s3_bucket_module.html" />
-    <link rel="prev" title="amazon.aws.route53_info module – Retrieves Route 53 details using AWS methods" href="route53_info_module.html" /><!-- extra head elements for Ansible beyond RTD Sphinx Theme -->
+    <link rel="prev" title="amazon.aws.route53_ksk module – Manages a key-signing key (KSK)" href="route53_ksk_module.html" /><!-- extra head elements for Ansible beyond RTD Sphinx Theme -->
 
 
 
@@ -621,7 +621,7 @@ see <a class="reference internal" href="#ansible-collections-amazon-aws-route53-
           
 
 <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
-        <a href="route53_info_module.html" class="btn btn-neutral float-left" title="amazon.aws.route53_info module – Retrieves Route 53 details using AWS methods" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
+        <a href="route53_ksk_module.html" class="btn btn-neutral float-left" title="amazon.aws.route53_ksk module – Manages a key-signing key (KSK)" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
         <a href="s3_bucket_module.html" class="btn btn-neutral float-right" title="amazon.aws.s3_bucket module – Manage S3 buckets in AWS, DigitalOcean, Ceph, Walrus, FakeS3 and StorageGRID" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
     </div>
 
diff --git a/home/runner/work/amazon.aws/amazon.aws/docsbuild/base/collections/index_module.html b/home/runner/work/amazon.aws/amazon.aws/docsbuild/head/collections/index_module.html
index be6d0c8..8b4c78a 100644
--- a/home/runner/work/amazon.aws/amazon.aws/docsbuild/base/collections/index_module.html
+++ b/home/runner/work/amazon.aws/amazon.aws/docsbuild/head/collections/index_module.html
@@ -254,6 +254,7 @@
 <li><p><a class="reference internal" href="amazon/aws/route53_module.html#ansible-collections-amazon-aws-route53-module"><span class="std std-ref">amazon.aws.route53</span></a> – add or delete entries in Amazons Route 53 DNS service</p></li>
 <li><p><a class="reference internal" href="amazon/aws/route53_health_check_module.html#ansible-collections-amazon-aws-route53-health-check-module"><span class="std std-ref">amazon.aws.route53_health_check</span></a> – Manage health checks in Amazons Route 53 DNS service</p></li>
 <li><p><a class="reference internal" href="amazon/aws/route53_info_module.html#ansible-collections-amazon-aws-route53-info-module"><span class="std std-ref">amazon.aws.route53_info</span></a> – Retrieves Route 53 details using AWS methods</p></li>
+<li><p><a class="reference internal" href="amazon/aws/route53_ksk_module.html#ansible-collections-amazon-aws-route53-ksk-module"><span class="std std-ref">amazon.aws.route53_ksk</span></a> – Manages a key-signing key (KSK)</p></li>
 <li><p><a class="reference internal" href="amazon/aws/route53_zone_module.html#ansible-collections-amazon-aws-route53-zone-module"><span class="std std-ref">amazon.aws.route53_zone</span></a> – add or delete Route 53 zones</p></li>
 <li><p><a class="reference internal" href="amazon/aws/s3_bucket_module.html#ansible-collections-amazon-aws-s3-bucket-module"><span class="std std-ref">amazon.aws.s3_bucket</span></a> – Manage S3 buckets in AWS, DigitalOcean, Ceph, Walrus, FakeS3 and StorageGRID</p></li>
 <li><p><a class="reference internal" href="amazon/aws/s3_bucket_info_module.html#ansible-collections-amazon-aws-s3-bucket-info-module"><span class="std std-ref">amazon.aws.s3_bucket_info</span></a> – Lists S3 buckets in AWS</p></li>

Copy link
Contributor

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

✔️ ansible-galaxy-importer SUCCESS in 11m 19s
✔️ build-ansible-collection SUCCESS in 10m 26s
✔️ ansible-test-splitter SUCCESS in 4m 13s
integration-amazon.aws-1 FAILURE in 6m 34s
integration-amazon.aws-2 FAILURE in 6m 52s
Skipped 42 jobs

Copy link
Contributor

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

✔️ ansible-galaxy-importer SUCCESS in 4m 23s
✔️ build-ansible-collection SUCCESS in 10m 33s
✔️ ansible-test-splitter SUCCESS in 4m 15s
integration-amazon.aws-1 FAILURE in 6m 40s
integration-amazon.aws-2 FAILURE in 6m 25s
Skipped 42 jobs

Signed-off-by: Alina Buzachis <[email protected]>
Copy link
Contributor

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

✔️ ansible-galaxy-importer SUCCESS in 4m 31s
✔️ build-ansible-collection SUCCESS in 10m 10s
✔️ ansible-test-splitter SUCCESS in 4m 19s
integration-amazon.aws-1 FAILURE in 5m 10s
integration-amazon.aws-2 FAILURE in 6m 08s
Skipped 42 jobs

Copy link
Contributor

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

⚠️ ansible-galaxy-importer SKIPPED Skipped due to failed job build-ansible-collection
build-ansible-collection FAILURE in 4m 45s
✔️ ansible-test-splitter SUCCESS in 4m 36s
⚠️ integration-amazon.aws-1 SKIPPED Skipped due to failed job build-ansible-collection
⚠️ integration-amazon.aws-2 SKIPPED Skipped due to failed job build-ansible-collection
Skipped 42 jobs

Signed-off-by: Alina Buzachis <[email protected]>
Copy link
Contributor

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

✔️ ansible-galaxy-importer SUCCESS in 3m 22s
✔️ build-ansible-collection SUCCESS in 10m 25s
✔️ ansible-test-splitter SUCCESS in 4m 24s
integration-amazon.aws-1 FAILURE in 5m 47s
integration-amazon.aws-2 FAILURE in 5m 15s
Skipped 42 jobs

@alinabuzachis
Copy link
Collaborator Author

recheck

Copy link
Contributor

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

✔️ ansible-galaxy-importer SUCCESS in 5m 10s
✔️ build-ansible-collection SUCCESS in 10m 34s
✔️ ansible-test-splitter SUCCESS in 5m 11s
integration-amazon.aws-1 FAILURE in 9m 00s
integration-amazon.aws-2 FAILURE in 7m 16s
Skipped 42 jobs

Copy link
Contributor

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

✔️ ansible-galaxy-importer SUCCESS in 4m 24s
✔️ build-ansible-collection SUCCESS in 10m 32s
✔️ ansible-test-splitter SUCCESS in 3m 56s
integration-amazon.aws-1 FAILURE in 8m 18s
integration-amazon.aws-2 FAILURE in 6m 19s
Skipped 42 jobs

Copy link
Contributor

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

✔️ ansible-galaxy-importer SUCCESS in 4m 19s
✔️ build-ansible-collection SUCCESS in 10m 16s
✔️ ansible-test-splitter SUCCESS in 3m 50s
✔️ integration-amazon.aws-1 SUCCESS in 8m 50s
integration-amazon.aws-2 FAILURE in 5m 42s
Skipped 42 jobs

Signed-off-by: Alina Buzachis <[email protected]>
Copy link
Contributor

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

✔️ ansible-galaxy-importer SUCCESS in 5m 19s
✔️ build-ansible-collection SUCCESS in 11m 18s
✔️ ansible-test-splitter SUCCESS in 4m 03s
✔️ integration-amazon.aws-1 SUCCESS in 10m 33s
✔️ integration-amazon.aws-2 SUCCESS in 7m 18s
Skipped 42 jobs

@GomathiselviS
Copy link
Collaborator

I would recommend creating a separate PR to add the new module for better clarity and easier review, rather than combining it with the addition of DNSSEC signing functionality.

Signed-off-by: Alina Buzachis <[email protected]>
@alinabuzachis alinabuzachis changed the title route53_zone - Add support for enabling DNSSEC signing in a specific hosted zone; Add a new route53_ksk module route53_ksk - new module Dec 11, 2024
Copy link
Contributor

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/2b62c63a9b7644008f384bebf50c32a1

✔️ ansible-galaxy-importer SUCCESS in 4m 37s
✔️ build-ansible-collection SUCCESS in 10m 40s
✔️ ansible-test-splitter SUCCESS in 3m 59s
✔️ integration-amazon.aws-1 SUCCESS in 6m 34s
Skipped 43 jobs

type: str
caller_reference:
description:
- A unique string that identifies the request.
Copy link
Collaborator

@GomathiselviS GomathiselviS Dec 11, 2024

Choose a reason for hiding this comment

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

Add "Required when state is present"

Copy link
Contributor

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/1e207cda5a334a8cbd4a0fd2e1db88d1

✔️ ansible-galaxy-importer SUCCESS in 5m 20s
✔️ build-ansible-collection SUCCESS in 10m 11s
✔️ ansible-test-splitter SUCCESS in 4m 00s
✔️ integration-amazon.aws-1 SUCCESS in 8m 22s
Skipped 43 jobs

aliases: ["zone_id"]
key_management_service_arn:
description:
- The Amazon resource name (ARN) for a customer managed key in Key Management Service (KMS).
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add "Required when state is present"

amazon.aws.route53_ksk:
name: "{{ resource_prefix }}-ksk"
hosted_zone_id: "{{ _hosted_zone.zone_id }}"
status: "INACTIVE"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is status needed when we delete?

if module.check_mode:
module.exit_json(
changed=changed,
msg=f"Would have updated the Key Signing Key status to {status} if not in check_mode.",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we return the changed dict (would have changed if not check_mode = true) as well?

else:
changed = True
if module.check_mode:
module.exit_json(changed=changed, msg="Would have created the Key Signing Key if not in check_mode.")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we return the changed dict (would have changed if not check_mode = true) as well?

if module.check_mode:
module.exit_json(changed=changed, msg="Would have deleted the Key Signing Key if not in check_mode.")

if module.params.get("status") == "INACTIVE":
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it possible for a condition to have state = "delete" and status = "ACTIVE"? I'm not sure if such a scenario can exist. Do we need this condition? We can ignore status for deletion. I think we should deactivate the key signing key before deleting in any case.


if ksk is not None:
changed = True
response["KeySigningRequest"] = ksk
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this needed? response is getting overwritten here

status = module.params.get("status")

if ksk is not None:
response = {"KeySigningKey": ksk}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this part of the return dict?

ansible.builtin.assert:
that:
- _ksk_request is successful
- '"change_info" in _ksk_request'
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we check if the status is ACTIVE?

- name: Assert success
ansible.builtin.assert:
that:
- _ksk_request is successful
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we check the status here?

amazon.aws.route53_ksk:
name: "{{ resource_prefix }}-ksk"
hosted_zone_id: "{{ _hosted_zone.zone_id }}"
status: "INACTIVE"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am not sure about "status: INACTIVE" for deletion.

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

Successfully merging this pull request may close these issues.

Allow Route53 DNSSEC Signing
2 participants