File tree Expand file tree Collapse file tree 3 files changed +7
-2
lines changed
examples/certificate-creator-example Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,8 @@ open serverless.yml and add the following:
8181 tags:
8282 Name: 'somedomain.com'
8383 Environment: 'prod'
84+ //optional default false. this is useful if you managed to delete your certificate but the dns validation records still exist
85+ rewriteRecords: false
8486
8587
8688now you can run:
@@ -122,6 +124,7 @@ Open serverless.yml and add the following:
122124 hostedZoneIds: 'XXXXXXXXX' //required if hostedZoneNames is not set
123125 region: eu-west-1 // optional - default is us-east-1 which is required for custom api gateway domains of Type Edge (default)
124126 enabled: true // optional - default is true. For some stages you may not want to use certificates (and custom domains associated with it).
127+ rewriteRecords: false
125128
126129Now you can run:
127130
Original file line number Diff line number Diff line change @@ -48,4 +48,5 @@ custom:
4848 - ' certcreatorsample2.greenelephant.io'
4949 tags :
5050 Name : ' somedomain.com'
51- Environment : ' prod'
51+ Environment : ' prod'
52+ rewriteRecords : false
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ class CreateCertificatePlugin {
5555 this . acm = new this . serverless . providers . aws . sdk . ACM ( acmCredentials ) ;
5656 this . idempotencyToken = this . serverless . service . custom . customCertificate . idempotencyToken ;
5757 this . writeCertInfoToFile = this . serverless . service . custom . customCertificate . writeCertInfoToFile || false ;
58+ this . rewriteRecords = this . serverless . service . custom . customCertificate . rewriteRecords || false ;
5859 this . certInfoFileName = this . serverless . service . custom . customCertificate . certInfoFileName || 'cert-info.yml' ;
5960 this . subjectAlternativeNames = this . serverless . service . custom . customCertificate . subjectAlternativeNames || [ ] ;
6061 this . tags = this . serverless . service . custom . customCertificate . tags || { } ;
@@ -268,7 +269,7 @@ class CreateCertificatePlugin {
268269 return Promise . all ( hostedZoneIds . map ( ( { hostedZoneId, Name } ) => {
269270 let changes = certificate . Certificate . DomainValidationOptions . filter ( ( { DomainName} ) => DomainName . endsWith ( Name ) ) . map ( ( x ) => {
270271 return {
271- Action : "CREATE" ,
272+ Action : this . rewriteRecords ? "UPSERT" : "CREATE" ,
272273 ResourceRecordSet : {
273274 Name : x . ResourceRecord . Name ,
274275 ResourceRecords : [
You can’t perform that action at this time.
0 commit comments