@@ -792,20 +792,32 @@ const internalCertificate = {
792
792
const credentials_cmd = 'echo \'' + certificate . meta . dns_provider_credentials . replace ( '\'' , '\\\'' ) + '\' > \'' + credentials_loc + '\' && chmod 600 \'' + credentials_loc + '\'' ;
793
793
const prepare_cmd = 'pip3 install ' + dns_plugin . package_name + '==' + dns_plugin . package_version ;
794
794
795
- const main_cmd =
795
+ // Whether the plugin has a --<name>-credentials argument
796
+ const has_config_arg = certificate . meta . dns_provider !== 'route53' ;
797
+
798
+ let main_cmd =
796
799
certbot_command + ' certonly --non-interactive ' +
797
800
'--cert-name "npm-' + certificate . id + '" ' +
798
801
'--agree-tos ' +
799
802
'--email "' + certificate . meta . letsencrypt_email + '" ' +
800
803
'--domains "' + certificate . domain_names . join ( ',' ) + '" ' +
801
804
'--authenticator ' + dns_plugin . full_plugin_name + ' ' +
802
- '--' + dns_plugin . full_plugin_name + '-credentials "' + credentials_loc + '"' +
805
+ (
806
+ has_config_arg
807
+ ? '--' + dns_plugin . full_plugin_name + '-credentials "' + credentials_loc + '"'
808
+ : ''
809
+ ) +
803
810
(
804
811
certificate . meta . propagation_seconds !== undefined
805
812
? ' --' + dns_plugin . full_plugin_name + '-propagation-seconds ' + certificate . meta . propagation_seconds
806
813
: ''
807
814
) +
808
815
( le_staging ? ' --staging' : '' ) ;
816
+
817
+ // Prepend the path to the credentials file as an environment variable
818
+ if ( certificate . meta . dns_provider === 'route53' ) {
819
+ main_cmd = 'AWS_CONFIG_FILE=\'' + credentials_loc + '\' ' + main_cmd
820
+ }
809
821
810
822
const teardown_cmd = `rm '${ credentials_loc } '` ;
811
823
@@ -914,12 +926,17 @@ const internalCertificate = {
914
926
const credentials_cmd = 'echo \'' + certificate . meta . dns_provider_credentials . replace ( '\'' , '\\\'' ) + '\' > \'' + credentials_loc + '\' && chmod 600 \'' + credentials_loc + '\'' ;
915
927
const prepare_cmd = 'pip3 install ' + dns_plugin . package_name + '==' + dns_plugin . package_version ;
916
928
917
- const main_cmd =
929
+ let main_cmd =
918
930
certbot_command + ' renew --non-interactive ' +
919
931
'--cert-name "npm-' + certificate . id + '" ' +
920
932
'--disable-hook-validation' +
921
933
( le_staging ? ' --staging' : '' ) ;
922
934
935
+ // Prepend the path to the credentials file as an environment variable
936
+ if ( certificate . meta . dns_provider === 'route53' ) {
937
+ main_cmd = 'AWS_CONFIG_FILE=\'' + credentials_loc + '\' ' + main_cmd
938
+ }
939
+
923
940
const teardown_cmd = `rm '${ credentials_loc } '` ;
924
941
925
942
if ( debug_mode ) {
0 commit comments