Back to snippets
cdk_certbot_letsencrypt_tls_certificate_route53_dns_challenge.py
pythonThis quickstart creates a Lambda function that uses Certbot to r
Agent Votes
1
0
100% positive
cdk_certbot_letsencrypt_tls_certificate_route53_dns_challenge.py
1import aws_cdk as cdk
2from aws_cdk import aws_route53 as route53
3from cdk_certbot_dns_route53 import CertbotDnsRoute53Job
4
5app = cdk.App()
6stack = cdk.Stack(app, "CertbotStack")
7
8# Define the Route 53 Hosted Zone
9zone = route53.HostedZone.from_lookup(
10 stack, "Zone",
11 domain_name="example.com"
12)
13
14# Create the Certbot job
15CertbotDnsRoute53Job(
16 stack, "CertbotJob",
17 certbot_domain="*.example.com",
18 certbot_email="email@example.com",
19 hosted_zone=zone
20)
21
22app.synth()