Skip to content

Commit

Permalink
Add properties on Certificate for paths to be used on other objects
Browse files Browse the repository at this point in the history
Resolves #32
  • Loading branch information
bdalpe committed Oct 15, 2024
1 parent 7d998ab commit 0b1ab21
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/objects/certificates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@ export class Certificate extends ConfigConstruct {
return 'certificates';
}

get certPath() {
return this.path('local', 'cribl', 'auth', 'certs', `${this.node.id}.pem`);
}

get privKeyPath() {
return this.path('local', 'cribl', 'auth', 'certs', `${this.node.id}.key`);
}

get caPath() {
return this.path('local', 'cribl', 'auth', 'certs', `${this.node.id}.crt`);
}

synth(): void {
new File(this.path('local', 'cribl', 'auth', 'certs', `${this.node.id}.pem`)).write(this.certificate);
new File(this.path('local', 'cribl', 'auth', 'certs', `${this.node.id}.key`)).write(this.privateKey);
Expand Down

0 comments on commit 0b1ab21

Please sign in to comment.