Destroy Domain A Record

Celery tasks for destroying llm_client domain A records.

This module defines tasks for destroying A records in AWS Route53 for llm_client domains, including signal handling and logging.

Main Tasks

  • destroy_domain_A_record(hostname, api_host_domain):

    Destroys the A record for a given domain name in AWS Route53.

Signals

  • pre_destroy_domain_A_record: Sent before the A record is destroyed.

  • post_destroy_domain_A_record: Sent after the A record is destroyed.

Configuration

Task behavior and logging are controlled by smarter_settings and waffle switches.

Logging

Task execution and resource destruction are logged using the smarter logging library.

Usage

Import this module and call the function as needed to destroy an llm_client domain A record:

destroy_domain_A_record(hostname, api_host_domain)

raises Exception:

Any exception during task execution will be logged and may be handled by the caller.

smarter.apps.llm_client.tasks.destroy_domain_a_record.destroy_domain_A_record(hostname, api_host_domain, task_id=None)[source]

Destroy the A record for a given domain name in AWS Route53.

This function locates the hosted zone for the specified parent domain, retrieves the A record for the given hostname, and deletes it from Route53. It sends pre- and post-destroy signals and logs all actions.

Parameters:
  • hostname (str) – The domain name whose A record should be destroyed.

  • api_host_domain (str) – The parent domain used to locate the AWS Route53 hosted zone.

  • Signals

  • -------

  • pre_destroy_domain_A_record (django.dispatch.Signal) – Sent before the A record is destroyed.

  • post_destroy_domain_A_record (django.dispatch.Signal) – Sent after the A record is destroyed.

Return type:

None

Raises:

Exception – Any exception raised during the destruction process will be logged and may be handled by the caller.

smarter.apps.llm_client.tasks.destroy_domain_a_record.destroy_domain_A_record(hostname, api_host_domain, task_id=None)[source]

Destroy the A record for a given domain name in AWS Route53.

This function locates the hosted zone for the specified parent domain, retrieves the A record for the given hostname, and deletes it from Route53. It sends pre- and post-destroy signals and logs all actions.

Parameters:
  • hostname (str) – The domain name whose A record should be destroyed.

  • api_host_domain (str) – The parent domain used to locate the AWS Route53 hosted zone.

  • Signals

  • -------

  • pre_destroy_domain_A_record (django.dispatch.Signal) – Sent before the A record is destroyed.

  • post_destroy_domain_A_record (django.dispatch.Signal) – Sent after the A record is destroyed.

Return type:

None

Raises:

Exception – Any exception raised during the destruction process will be logged and may be handled by the caller.