Skip to content
Merged
Show file tree
Hide file tree
Changes from 84 commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
b05d15a
feat(acm): Add support for ACM exportable public certificates
Jul 27, 2025
de11cc7
build(yarn): roll back changes to yarn.lock
Jul 27, 2025
27b74fc
build(yarn): Add back yarn.lock
Jul 27, 2025
e94b14e
style(acm): remove trailing space
Jul 27, 2025
2915a82
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Jul 29, 2025
3bcb589
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Jul 29, 2025
e51bc19
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Jul 29, 2025
fd66d70
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Jul 29, 2025
83c3458
feat(acm): Add certificateExport support for acm.PrivateCertificate
Jul 30, 2025
07bb304
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Jul 30, 2025
9742520
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Jul 31, 2025
d196f63
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Jul 31, 2025
6d9c78c
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Jul 31, 2025
946a7bd
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Jul 31, 2025
4abeb43
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Jul 31, 2025
15dbdd9
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 1, 2025
466cc7b
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 1, 2025
97d94b7
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 1, 2025
9155d24
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 1, 2025
b9ba70d
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 2, 2025
1bc1e43
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 4, 2025
85ff76c
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 4, 2025
b7d70ea
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 5, 2025
0afade0
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 5, 2025
a8eb5bb
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 6, 2025
82c12f7
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 6, 2025
5736f5d
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 6, 2025
34eac71
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 6, 2025
786ced2
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 6, 2025
2770e16
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 6, 2025
5c62d62
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 7, 2025
ebc526b
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 8, 2025
b83582a
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 8, 2025
3030480
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 8, 2025
b29fbef
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 9, 2025
b7f1457
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 11, 2025
caf2db4
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 11, 2025
636462c
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 11, 2025
277eec4
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 11, 2025
f6facfe
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 12, 2025
bc37569
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 12, 2025
51b4bc6
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 12, 2025
ac46e60
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 12, 2025
42e0e47
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 12, 2025
5a12f2d
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 12, 2025
3552ebf
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 12, 2025
f2a91d3
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 13, 2025
af8b2e3
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 13, 2025
a5e27b8
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 13, 2025
5a18bfd
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 13, 2025
97bd877
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 13, 2025
9b74501
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 14, 2025
6292d66
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 14, 2025
f6f5063
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 15, 2025
53f3321
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 19, 2025
f863087
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 19, 2025
1068522
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 19, 2025
317bd13
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 20, 2025
a5ed398
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 20, 2025
b508f24
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 20, 2025
038e8f9
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 20, 2025
fa65fa6
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 21, 2025
46f157b
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 21, 2025
9f8eee1
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 21, 2025
1da799a
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 21, 2025
679ca30
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 21, 2025
e47a2c3
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 22, 2025
26d3cda
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 22, 2025
ab1d3aa
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 25, 2025
ed3e77c
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 25, 2025
48bb3e4
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 26, 2025
82e6908
Update packages/aws-cdk-lib/aws-certificatemanager/lib/certificate.ts
frankhefeng Aug 26, 2025
227470e
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 26, 2025
903b093
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 26, 2025
5c4354f
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 26, 2025
719d187
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 27, 2025
175371b
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 27, 2025
c0bcd75
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 27, 2025
e310388
refactor(acm): Rename certificateExportEnabled to allowExport for exp…
Aug 28, 2025
b7bd306
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 28, 2025
c1a4198
Update packages/aws-cdk-lib/aws-certificatemanager/lib/private-certif…
frankhefeng Aug 28, 2025
5a9aa3a
style(acm): Fix format
Aug 28, 2025
7c926b4
test(acm): Fix tests
Aug 28, 2025
7b45669
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Aug 28, 2025
5b0ffb0
test(acm): Remove check of Runtime to fix error: Expected type string…
Aug 28, 2025
44bc127
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Sep 1, 2025
53af8a9
style(acm): Remove commented Lambda runtime check in test code
Sep 1, 2025
a0151ca
Merge branch 'main' into feat/acm-exportable-certificate
frankhefeng Sep 1, 2025
341b0b0
Merge branch 'main' into feat/acm-exportable-certificate
mergify[bot] Sep 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions packages/aws-cdk-lib/aws-certificatemanager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,17 @@ new acm.PrivateCertificate(this, 'PrivateCertificate', {
});
```

## Requesting public SSL/TLS certificates exportable to use anywhere

AWS Certificate Manager can issue an exportable public certificate. There is a charge at certificate issuance and again when the certificate renews. See [opting out of certificate transparency logging](https://docs.aws.amazon.com/acm/latest/userguide/acm-exportable-certificates.html) for details.

```ts
new acm.Certificate(this, 'Certificate', {
domainName: 'test.example.com',
allowExport: true,
});
```

## Requesting certificates without transparency logging

Transparency logging can be opted out of for AWS Certificate Manager certificates. See [opting out of certificate transparency logging](https://docs.aws.amazon.com/acm/latest/userguide/acm-bestpractices.html#best-practices-transparency) for limits.
Expand Down
13 changes: 13 additions & 0 deletions packages/aws-cdk-lib/aws-certificatemanager/lib/certificate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,16 @@ export interface CertificateProps {
*/
readonly validation?: CertificateValidation;

/**
* Enable or disable export of this certificate.
*
* If you issue an exportable public certificate, there is a charge at certificate issuance and again when the certificate renews.
* Ref: https://aws.amazon.com/certificate-manager/pricing
*
* @default false
*/
readonly allowExport?: boolean;

/**
* Enable or disable transparency logging for this certificate
*
Expand Down Expand Up @@ -319,6 +329,8 @@ export class Certificate extends CertificateBase implements ICertificate {

const allDomainNames = [props.domainName].concat(props.subjectAlternativeNames || []);

const certificateExport = (props.allowExport === true) ? 'ENABLED' : undefined;

let certificateTransparencyLoggingPreference: string | undefined;
if (props.transparencyLoggingEnabled !== undefined) {
certificateTransparencyLoggingPreference = props.transparencyLoggingEnabled ? 'ENABLED' : 'DISABLED';
Expand All @@ -329,6 +341,7 @@ export class Certificate extends CertificateBase implements ICertificate {
subjectAlternativeNames: props.subjectAlternativeNames,
domainValidationOptions: renderDomainValidation(this, validation, allDomainNames),
validationMethod: validation.method,
certificateExport,
certificateTransparencyLoggingPreference,
keyAlgorithm: props.keyAlgorithm?.name,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ export interface PrivateCertificateProps {
* @default KeyAlgorithm.RSA_2048
*/
readonly keyAlgorithm?: KeyAlgorithm;

/**
* Enable or disable export of this certificate.
*
* If you issue an exportable public certificate, there is a charge at certificate issuance and again when the certificate renews.
* Ref: https://aws.amazon.com/certificate-manager/pricing
*
* @default false
*/
readonly allowExport?: boolean;
}

/**
Expand Down Expand Up @@ -75,11 +85,14 @@ export class PrivateCertificate extends CertificateBase implements ICertificate
// Enhanced CDK Analytics Telemetry
addConstructMetadata(this, props);

const certificateExport = (props.allowExport === true) ? 'ENABLED' : undefined;

const cert = new CfnCertificate(this, 'Resource', {
domainName: props.domainName,
subjectAlternativeNames: props.subjectAlternativeNames,
certificateAuthorityArn: props.certificateAuthority.certificateAuthorityArn,
keyAlgorithm: props.keyAlgorithm?.name,
certificateExport,
});

this.certificateArn = cert.ref;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,48 @@ test('CertificateValidation.fromDnsMultiZone', () => {
});
});

describe('Certificate export setting', () => {
test('leaves certificate export setting untouched by default', () => {
const stack = new Stack();

new Certificate(stack, 'Certificate', {
domainName: 'test.example.com',
});

const certificateNodes = Template.fromStack(stack).findResources('AWS::CertificateManager::Certificate');
expect(certificateNodes.Certificate4E7ABB08).toBeDefined();
expect(certificateNodes.Certificate4E7ABB08.CertificateTransparencyLoggingPreference).toBeUndefined();
});

test('can enable certificate export', () => {
const stack = new Stack();

new Certificate(stack, 'Certificate', {
domainName: 'test.example.com',
allowExport: true,
});

Template.fromStack(stack).hasResourceProperties('AWS::CertificateManager::Certificate', {
DomainName: 'test.example.com',
CertificateExport: 'ENABLED',
});
});

test('can disable certificate export', () => {
const stack = new Stack();

new Certificate(stack, 'Certificate', {
domainName: 'test.example.com',
allowExport: false,
});

Template.fromStack(stack).hasResourceProperties('AWS::CertificateManager::Certificate', {
DomainName: 'test.example.com',
CertificateExport: Match.absent(),
});
});
});

describe('Transparency logging settings', () => {
test('leaves transparency logging untouched by default', () => {
const stack = new Stack();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,51 @@ describe('Key Algorithm', () => {
});
});
});

describe('Certificate export setting', () => {
test('leaves certificate export setting untouched by default', () => {
const stack = new Stack();

new PrivateCertificate(stack, 'Certificate', {
domainName: 'test.example.com',
certificateAuthority: acmpca.CertificateAuthority.fromCertificateAuthorityArn(stack, 'CA',
'arn:aws:acm-pca:us-east-1:123456789012:certificate-authority/023077d8-2bfa-4eb0-8f22-05c96deade77'),
});

const certificateNodes = Template.fromStack(stack).findResources('AWS::CertificateManager::Certificate');
expect(certificateNodes.Certificate4E7ABB08).toBeDefined();
expect(certificateNodes.Certificate4E7ABB08.CertificateTransparencyLoggingPreference).toBeUndefined();
});

test('can enable certificate export', () => {
const stack = new Stack();

new PrivateCertificate(stack, 'Certificate', {
domainName: 'test.example.com',
allowExport: true,
certificateAuthority: acmpca.CertificateAuthority.fromCertificateAuthorityArn(stack, 'CA',
'arn:aws:acm-pca:us-east-1:123456789012:certificate-authority/023077d8-2bfa-4eb0-8f22-05c96deade77'),
});

Template.fromStack(stack).hasResourceProperties('AWS::CertificateManager::Certificate', {
DomainName: 'test.example.com',
CertificateExport: 'ENABLED',
});
});

test('can disable certificate export', () => {
const stack = new Stack();

new PrivateCertificate(stack, 'Certificate', {
domainName: 'test.example.com',
allowExport: false,
certificateAuthority: acmpca.CertificateAuthority.fromCertificateAuthorityArn(stack, 'CA',
'arn:aws:acm-pca:us-east-1:123456789012:certificate-authority/023077d8-2bfa-4eb0-8f22-05c96deade77'),
});

Template.fromStack(stack).hasResourceProperties('AWS::CertificateManager::Certificate', {
DomainName: 'test.example.com',
CertificateExport: Match.absent(),
});
});
});
2 changes: 1 addition & 1 deletion tools/@aws-cdk/spec2cdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@
"dependencies/cdk-point-dependencies"
]
}
}
}
7 changes: 7 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,13 @@
dependencies:
"@cdklabs/tskb" "^0.0.3"

"@aws-cdk/service-spec-types@^0.0.155":
version "0.0.155"
resolved "https://registry.npmjs.org/@aws-cdk/service-spec-types/-/service-spec-types-0.0.155.tgz#a38ad6291700b38ef4f2e763555065811cae6c67"
integrity sha512-Z4kwxvQesTkbD33uZorUicIUlHlP8/fVunOa/1LGqwQw55b1gbKiZE+2o3tgm2YIOHMEsP/p1ZjqW71cFtOCyg==
dependencies:
"@cdklabs/tskb" "^0.0.3"

"@aws-crypto/[email protected]":
version "5.2.0"
resolved "https://registry.npmjs.org/@aws-crypto/crc32/-/crc32-5.2.0.tgz#cfcc22570949c98c6689cfcbd2d693d36cdae2e1"
Expand Down
Loading