Smarter AWS ACM Helper

class smarter.common.helpers.aws.acm.AWSCertificateManager(aws_access_key_id=None, aws_secret_access_key=None, aws_region=None, aws_profile=None, shared_resource_identifier=None, environment=None, environment_domain=None, root_domain=None, debug_mode=False, init_info=None)[source]

Bases: AWSBase

AWS Certificate Manager helper class. Provides a high-level interface for managing AWS Certificate Manager (ACM) resources.

This helper class encapsulates common operations related to ACM, such as requesting new certificates, retrieving certificate details, handling DNS validation, and verifying certificate status. It abstracts the complexities of interacting directly with the AWS SDK, offering a streamlined way to automate certificate management tasks within AWS environments.

The class also integrates with AWS Route53 to facilitate DNS-based validation by automatically creating or retrieving the necessary DNS records for certificate verification. It is designed to be used as part of a broader AWS automation or orchestration workflow, ensuring that certificates are requested, validated, and managed efficiently.

Logging is provided throughout to assist with debugging and operational visibility. Exceptions are raised for error conditions, such as failed verification or missing resources, to allow for robust error handling in consuming code.

certificate_is_verified(certificate_arn)[source]

Return whether the certificate is verified.

Parameters:

certificate_arn (str) – The ARN of the certificate.

Returns:

True if the certificate is verified, else False.

Return type:

bool

delete_certificate(certificate_arn)[source]

Delete the certificate.

Parameters:

certificate_arn (str) – The ARN of the certificate.

Return type:

None

get_certificate_arn(domain_name)[source]

Return the certificate ARN.

Parameters:

domain_name (str) – The domain name to search for.

Returns:

The certificate ARN if found, else None.

Return type:

Optional[str]

get_certificate_status(certificate_arn)[source]

Return the certificate status see example return in ./data/aws/certificate_detail.json

Parameters:

certificate_arn (str) – The ARN of the certificate.

Returns:

The certificate details.

Return type:

dict[str, Any]

get_or_create_certificate(domain_name)[source]

Return the certificate ARN.

Parameters:

domain_name (str) – The domain name for the certificate.

Returns:

The certificate ARN.

Return type:

str

get_or_create_certificate_dns_record(certificate_arn)[source]

Get or create the DNS verification record for the certificate.

Parameters:

certificate_arn (str) – The ARN of the certificate.

Returns:

The DNS record.

Return type:

dict[Any, Any]

property route53

Return the AWS Route53 helper.

Returns:

AWSRoute53 helper instance

Return type:

AWSRoute53

verify_certificate(certificate_arn)[source]

Verify the ACM certificate.

Parameters:

certificate_arn (str) – The ARN of the certificate.

Returns:

True if the certificate is verified, else False.

Return type:

bool