cdk-cloudfront-associate-alias
A simple construct to handle automated Cloudfront DNS alias migration with zero downtime.
Usage
Usage of this construct is fairly straightforward. Simply pass in the Cloudfront distribution, the Route53 hosted zone, and the alias you want to associate with the distribution.
const customDomain = "example.com";
const hostedZone = route53.HostedZone.fromLookup(this, "HostedZone", {
domainName: DOMAIN_NAME,
});
const targetDistribution =
cloudfront.Distribution.fromDistributionAttributes(
this,
"Distribution",
{
distributionId,
domainName: distributionDomainName,
},
);
new CloudfrontAliasAssociator(
this,
"AliasAssociator",
{
alias: customDomain,
hostedZone,
targetDistribution,
},
);
What this does
This construct will create:
- A TXT record, this is specific to the API call used, and ensures you have ownership of the domain.
- A Custom Resource that makes an
AssociateAliasAPI call to Cloudfront. This API specifically is for zero downtime alias migration in Cloudfront. This will work even if the domain isn't pre-associated. - An A and AAAA alias record that points to the (new) Cloudfront distribution.
Use Cases
Notably, this construct can be used to provide Blue/Green style deployments for Cloudfront distributions. This means you can create a new distribution, associate the alias with it and this will result in zero downtime for your users.
You can also use this construct in reverse to rollback your alias to the previous deployment (or any other deployment).
For this use case, I recommend pairing this construct with the cdk-versioned-stack-manager to manage your versioned stacks.
Metadata
Release files for cdk-cloudfront-associate-alias 1.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cdk-cloudfront-associate-alias-1.0.5.tar.gz | 32.6 kB | Without provenance | Details for cdk-cloudfront-associate-alias-1.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cdk_cloudfront_associate_alias-1.0.5-py3-none-any.whl | Python 3 | none | any | Details for cdk_cloudfront_associate_alias-1.0.5-py3-none-any.whl |
Total release size: 64.0 kB
Release files / cdk-cloudfront-associate-alias-1.0.5.tar.gz
| Download URL | cdk-cloudfront-associate-alias-1.0.5.tar.gz |
|---|---|
| Size | 32.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
48a62a93e7b5ca32ad822fbfe52804f3bb37db3420ccc2ba404931d3f9aed320
|
|
BLAKE2b-256 checksum How to use checksums |
22ed27bd8ebf00dbd7b22c698aaac321e69fc997f21452e23600c48d7cb37910
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.1
|
Release files / cdk_cloudfront_associate_alias-1.0.5-py3-none-any.whl
| Download URL | cdk_cloudfront_associate_alias-1.0.5-py3-none-any.whl |
|---|---|
| Size | 31.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e8952c72e562dbbe5be1686e94346d94036d137e1bb6e6cc1d98d9494e5ee999
|
|
BLAKE2b-256 checksum How to use checksums |
05ea227035beddfed6c13305a4d0154ce4f19271f2dd4f3f229db8b93ac2e447
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.1
|
Security for cdk-cloudfront-associate-alias 1.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.