Created
July 30, 2020 10:10
-
-
Save GeertHauwaerts/8e0541abc04c91f16293aa5bf7189b02 to your computer and use it in GitHub Desktop.
Add support for AWS profiles in certbot-dns-route53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -Naur certbot_dns_route53.old/dns_route53.py certbot_dns_route53/dns_route53.py | |
--- certbot_dns_route53.old/dns_route53.py 2018-04-04 21:56:02.000000000 +0000 | |
+++ certbot_dns_route53/dns_route53.py 2020-07-30 09:48:12.413712711 +0000 | |
@@ -33,9 +33,15 @@ | |
def __init__(self, *args, **kwargs): | |
super(Authenticator, self).__init__(*args, **kwargs) | |
- self.r53 = boto3.client("route53") | |
+ session = boto3.Session(profile_name=self.conf('profile-name')) | |
+ self.r53 = session.client("route53") | |
self._resource_records = collections.defaultdict(list) | |
+ @classmethod | |
+ def add_parser_arguments(cls, add, profile_name=None): | |
+ super(Authenticator, cls).add_parser_arguments(add) | |
+ add('profile-name', default=profile_name, type=str, help='The AWS profile to use') | |
+ | |
def more_info(self): # pylint: disable=missing-docstring,no-self-use | |
return "Solve a DNS01 challenge using AWS Route53" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
[renewalparams] | |
... | |
dns_route53_profile_name = name_of_profile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment