Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cloudfront): the Distribution construct is now Generally Available (stable) #11919

Merged
merged 2 commits into from
Dec 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
36 changes: 6 additions & 30 deletions packages/@aws-cdk/aws-cloudfront/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,9 @@

---

Features | Stability
------------------------------------------------------|---------------------------------------------
CFN Resources | ![Stable](https://img.shields.io/badge/stable-success.svg?style=for-the-badge)
Higher level constructs for Distribution | ![Developer Preview](https://img.shields.io/badge/developer--preview-informational.svg?style=for-the-badge)
Higher level constructs for CloudFrontWebDistribution | ![Stable](https://img.shields.io/badge/stable-success.svg?style=for-the-badge)
![cfn-resources: Stable](https://img.shields.io/badge/cfn--resources-stable-success.svg?style=for-the-badge)

> **CFN Resources:** All classes with the `Cfn` prefix in this module ([CFN Resources]) are always
> stable and safe to use.
>
> [CFN Resources]: https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_lib

<!-- -->

> **Developer Preview:** Higher level constructs in this module that are marked as developer
> preview have completed their phase of active development and are looking for adoption and
> feedback. While the same caveats around non-backward compatible as Experimental constructs apply,
> they will undergo fewer breaking changes. Just as with Experimental constructs, these are not
> subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be
> announced in the release notes.

<!-- -->

> **Stable:** Higher level constructs in this module that are marked stable will not undergo any
> breaking changes. They will strictly follow the [Semantic Versioning](https://semver.org/) model.
![cdk-constructs: Stable](https://img.shields.io/badge/cdk--constructs-stable-success.svg?style=for-the-badge)

---

Expand All @@ -37,9 +16,7 @@ your users. CloudFront delivers your content through a worldwide network of data
you're serving with CloudFront, the user is routed to the edge location that provides the lowest latency, so that content is delivered with the best
possible performance.

## Distribution API - Developer Preview

![Developer Preview](https://img.shields.io/badge/developer--preview-informational.svg?style=for-the-badge)
## Distribution API

The `Distribution` API is currently being built to replace the existing `CloudFrontWebDistribution` API. The `Distribution` API is optimized for the
most common use cases of CloudFront distributions (e.g., single origin and behavior, few customizations) while still providing the ability for more
Expand Down Expand Up @@ -384,11 +361,10 @@ const distribution = cloudfront.Distribution.fromDistributionAttributes(scope, '
});
```

## CloudFrontWebDistribution API - Stable

![cdk-constructs: Stable](https://img.shields.io/badge/cdk--constructs-stable-success.svg?style=for-the-badge)
## CloudFrontWebDistribution API

A CloudFront construct - for setting up the AWS CDN with ease!
> The `CloudFrontWebDistribution` construct is the original construct written for working with CloudFront distributions.
> Users are encouraged to use the newer `Distribution` instead, as it has a simpler interface and receives new features faster.

Example usage:

Expand Down
6 changes: 0 additions & 6 deletions packages/@aws-cdk/aws-cloudfront/lib/cache-policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { CfnCachePolicy } from './cloudfront.generated';

/**
* Represents a Cache Policy
* @experimental
*/
export interface ICachePolicy {
/**
Expand All @@ -16,7 +15,6 @@ export interface ICachePolicy {

/**
* Properties for creating a Cache Policy
* @experimental
*/
export interface CachePolicyProps {
/**
Expand Down Expand Up @@ -87,7 +85,6 @@ export interface CachePolicyProps {
* A Cache Policy configuration.
*
* @resource AWS::CloudFront::CachePolicy
* @experimental
*/
export class CachePolicy extends Resource implements ICachePolicy {

Expand Down Expand Up @@ -178,7 +175,6 @@ export class CachePolicy extends Resource implements ICachePolicy {
/**
* Determines whether any cookies in viewer requests are included in the cache key and
* automatically included in requests that CloudFront sends to the origin.
* @experimental
*/
export class CacheCookieBehavior {
/**
Expand Down Expand Up @@ -226,7 +222,6 @@ export class CacheCookieBehavior {

/**
* Determines whether any HTTP headers are included in the cache key and automatically included in requests that CloudFront sends to the origin.
* @experimental
*/
export class CacheHeaderBehavior {
/** HTTP headers are not included in the cache key and are not automatically included in requests that CloudFront sends to the origin. */
Expand All @@ -253,7 +248,6 @@ export class CacheHeaderBehavior {
/**
* Determines whether any URL query strings in viewer requests are included in the cache key
* and automatically included in requests that CloudFront sends to the origin.
* @experimental
*/
export class CacheQueryStringBehavior {
/**
Expand Down
12 changes: 0 additions & 12 deletions packages/@aws-cdk/aws-cloudfront/lib/distribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ export interface IDistribution extends IResource {

/**
* Attributes used to import a Distribution.
*
* @experimental
*/
export interface DistributionAttributes {
/**
Expand All @@ -69,8 +67,6 @@ interface BoundOrigin extends OriginBindOptions, OriginBindConfig {

/**
* Properties for a Distribution
*
* @experimental
*/
export interface DistributionProps {
/**
Expand Down Expand Up @@ -214,8 +210,6 @@ export interface DistributionProps {

/**
* A CloudFront distribution with associated origin(s) and caching behavior(s).
*
* @experimental
*/
export class Distribution extends Resource implements IDistribution {

Expand Down Expand Up @@ -555,8 +549,6 @@ export class CachedMethods {

/**
* Options for configuring custom error responses.
*
* @experimental
*/
export interface ErrorResponse {
/**
Expand Down Expand Up @@ -640,8 +632,6 @@ export interface EdgeLambda {

/**
* Options for adding a new behavior to a Distribution.
*
* @experimental
*/
export interface AddBehaviorOptions {
/**
Expand Down Expand Up @@ -709,8 +699,6 @@ export interface AddBehaviorOptions {

/**
* Options for creating a new behavior.
*
* @experimental
*/
export interface BehaviorOptions extends AddBehaviorOptions {
/**
Expand Down
6 changes: 0 additions & 6 deletions packages/@aws-cdk/aws-cloudfront/lib/origin-request-policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { CfnOriginRequestPolicy } from './cloudfront.generated';

/**
* Represents a Origin Request Policy
* @experimental
*/
export interface IOriginRequestPolicy {
/**
Expand All @@ -16,7 +15,6 @@ export interface IOriginRequestPolicy {

/**
* Properties for creating a Origin Request Policy
* @experimental
*/
export interface OriginRequestPolicyProps {
/**
Expand Down Expand Up @@ -55,7 +53,6 @@ export interface OriginRequestPolicyProps {
* A Origin Request Policy configuration.
*
* @resource AWS::CloudFront::OriginRequestPolicy
* @experimental
*/
export class OriginRequestPolicy extends Resource implements IOriginRequestPolicy {

Expand Down Expand Up @@ -126,7 +123,6 @@ export class OriginRequestPolicy extends Resource implements IOriginRequestPolic
/**
* Ddetermines whether any cookies in viewer requests (and if so, which cookies)
* are included in requests that CloudFront sends to the origin.
* @experimental
*/
export class OriginRequestCookieBehavior {
/**
Expand Down Expand Up @@ -159,7 +155,6 @@ export class OriginRequestCookieBehavior {

/**
* Determines whether any HTTP headers (and if so, which headers) are included in requests that CloudFront sends to the origin.
* @experimental
*/
export class OriginRequestHeaderBehavior {
/**
Expand Down Expand Up @@ -206,7 +201,6 @@ export class OriginRequestHeaderBehavior {
/**
* Determines whether any URL query strings in viewer requests (and if so, which query strings)
* are included in requests that CloudFront sends to the origin.
* @experimental
*/
export class OriginRequestQueryStringBehavior {
/**
Expand Down
6 changes: 0 additions & 6 deletions packages/@aws-cdk/aws-cloudfront/lib/origin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ export interface IOrigin {

/**
* Properties to define an Origin.
*
* @experimental
*/
export interface OriginProps {
/**
Expand Down Expand Up @@ -85,8 +83,6 @@ export interface OriginProps {

/**
* Options passed to Origin.bind().
*
* @experimental
*/
export interface OriginBindOptions {
/**
Expand All @@ -99,8 +95,6 @@ export interface OriginBindOptions {
/**
* Represents a distribution origin, that describes the Amazon S3 bucket, HTTP server (for example, a web server),
* Amazon MediaStore, or other server from which CloudFront gets your files.
*
* @experimental
*/
export abstract class OriginBase implements IOrigin {
private readonly domainName: string;
Expand Down
2 changes: 0 additions & 2 deletions packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -640,8 +640,6 @@ interface BehaviorWithOrigin extends Behavior {

/**
* Attributes used to import a Distribution.
*
* @experimental
*/
export interface CloudFrontWebDistributionAttributes {
/**
Expand Down
14 changes: 2 additions & 12 deletions packages/@aws-cdk/aws-cloudfront/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,8 @@
"engines": {
"node": ">= 10.13.0 <13 || >=13.7.0"
},
"stability": "experimental",
"maturity": "experimental",
"features": [
{
"name": "Higher level constructs for Distribution",
"stability": "Developer Preview"
},
{
"name": "Higher level constructs for CloudFrontWebDistribution",
"stability": "Stable"
}
],
"stability": "stable",
"maturity": "stable",
"awslint": {
"exclude": [
"props-physical-name:@aws-cdk/aws-cloudfront.Distribution",
Expand Down