Skip to content

DnsValidatedCertificate: Cap domainName to 64 Characters at Compile Time #21777

@cowsandmilk

Description

@cowsandmilk

Describe the feature

If you provide a domainName that is longer than 64 characters, DnsValidatedCertificate will fail to create the certificate.

This is documented in https://docs.aws.amazon.com/acm/latest/APIReference/API_RequestCertificate.html (technically, the limit is 64 octets. The limit actually comes from RFC 5280, so it is not expected to change.

Pain can be removed by having this check as part of cdk build rather than occurring when the lambda function calls the RequestCertificate API.

Use Case

I've been caught by this in adding more verbose subdomains and not seeing the issue until the cloudformation deploy.

Proposed Solution

throw an error if the length is too long. There is probably also a minimum length that can be checked.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.31.2

Environment details (OS name and version, etc.)

N/A

Metadata

Metadata

Labels

@aws-cdk/aws-certificatemanagerRelated to Amazon Certificate Managereffort/smallSmall work item – less than a day of effortfeature-requestA feature should be added or improved.good first issueRelated to contributions. See CONTRIBUTING.mdp2

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions