Skip to content

Commit

Permalink
chore(release): 1.79.0
Browse files Browse the repository at this point in the history
  • Loading branch information
iliapolo committed Dec 17, 2020
2 parents 2c74f4c + 9b19e29 commit 8b3bf9c
Show file tree
Hide file tree
Showing 111 changed files with 4,991 additions and 487 deletions.
74 changes: 37 additions & 37 deletions .github/workflows/issue-label-assign.yml

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,44 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [1.79.0](https://github.com/aws/aws-cdk/compare/v1.78.0...v1.79.0) (2020-12-17)


### ⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES

* **apigatewayv2:** `HttpApi.fromApiId()` has been replaced with
`HttpApi.fromHttpApiAttributes()`.
* **elasticsearch:** ES Domain LogGroup LogicalId will change, which will trigger new log group resources to be created

### Features

* **appmesh:** add timeout support to Routes ([#11973](https://github.com/aws/aws-cdk/issues/11973)) ([78c185d](https://github.com/aws/aws-cdk/commit/78c185d15e64e81ee86ee71cd6430cd80fdbb8fe))
* **core:** expose custom resource provider's role ([#11923](https://github.com/aws/aws-cdk/issues/11923)) ([06f26d3](https://github.com/aws/aws-cdk/commit/06f26d390707b0e2a4e05e36405a4751c907a234)), closes [/github.com/aws/aws-cdk/pull/9751#issuecomment-723554595](https://github.com/aws//github.com/aws/aws-cdk/pull/9751/issues/issuecomment-723554595)
* **ec2:** add r5b instance type to instance class ([#12027](https://github.com/aws/aws-cdk/issues/12027)) ([d276b02](https://github.com/aws/aws-cdk/commit/d276b020e61ee4455c7ed9f093436d1aab319e76)), closes [#12025](https://github.com/aws/aws-cdk/issues/12025)
* **ecs-patterns:** Add DeploymentController option to Fargate services ([#10452](https://github.com/aws/aws-cdk/issues/10452)) ([2cd233a](https://github.com/aws/aws-cdk/commit/2cd233a94fc2f3cb06211157738e59e8c7ee85e5)), closes [aws/containers-roadmap#130](https://github.com/aws/containers-roadmap/issues/130) [#10971](https://github.com/aws/aws-cdk/issues/10971)
* **eks:** attach cluster security group to self-managed nodes ([#12042](https://github.com/aws/aws-cdk/issues/12042)) ([1078bea](https://github.com/aws/aws-cdk/commit/1078bea4c90afaac76a5e81328a9d6ec44a79e9a))
* **elasticsearch:** support audit logs ([#12106](https://github.com/aws/aws-cdk/issues/12106)) ([d10ea63](https://github.com/aws/aws-cdk/commit/d10ea631f8699385cadf61d6e0a067b68da37df6)), closes [#12105](https://github.com/aws/aws-cdk/issues/12105)
* **ivs:** add IVS L2 Constructs ([#11454](https://github.com/aws/aws-cdk/issues/11454)) ([f813bff](https://github.com/aws/aws-cdk/commit/f813bff2da4792cfa7bfce6f572a7d2bb5c4759d))
* **lambda:** encryption key for environment variables ([#11893](https://github.com/aws/aws-cdk/issues/11893)) ([ccbaf83](https://github.com/aws/aws-cdk/commit/ccbaf8399c3a9f3ff6e60758e0b713d82f37420b)), closes [#10837](https://github.com/aws/aws-cdk/issues/10837)
* **lambda-nodejs:** expose more esbuild options ([#12063](https://github.com/aws/aws-cdk/issues/12063)) ([bab21b3](https://github.com/aws/aws-cdk/commit/bab21b377593b7475b047d05a54914344352c054)), closes [#12046](https://github.com/aws/aws-cdk/issues/12046)
* **route53:** Vpc endpoint service private dns ([#10780](https://github.com/aws/aws-cdk/issues/10780)) ([8f6f9a8](https://github.com/aws/aws-cdk/commit/8f6f9a8678496e131a43ca4c76e561d50a0a0de8))
* **s3-deployment:** support vpc in BucketDeploymentProps ([#12035](https://github.com/aws/aws-cdk/issues/12035)) ([6caf72f](https://github.com/aws/aws-cdk/commit/6caf72f67d6d3373186e57f32671369c2cc8b56e)), closes [#11734](https://github.com/aws/aws-cdk/issues/11734)
* **stepfunctions-tasks:** add support for ModelClientConfig to SageMakerCreateTransformJob ([#11892](https://github.com/aws/aws-cdk/issues/11892)) ([bf05092](https://github.com/aws/aws-cdk/commit/bf050928c033328b259746c0a7f33038aadc4c17))


### Bug Fixes

* **ec2:** 'encoded list token' error using Vpc imported from deploy-time lists ([#12040](https://github.com/aws/aws-cdk/issues/12040)) ([0690da9](https://github.com/aws/aws-cdk/commit/0690da925144c821a73bfab4ae8d678a8c074357))
* **ec2:** fromInterfaceVpcEndpointAttributes: Security Groups should not be required ([#11857](https://github.com/aws/aws-cdk/issues/11857)) ([86ae5d6](https://github.com/aws/aws-cdk/commit/86ae5d6ec5291f7a8da37bbf021c31f88e66d283)), closes [#11050](https://github.com/aws/aws-cdk/issues/11050)
* **eks:** failure to deploy cluster since aws-auth configmap exists ([#12068](https://github.com/aws/aws-cdk/issues/12068)) ([dc8a98a](https://github.com/aws/aws-cdk/commit/dc8a98a5436a7a2347fa9676d84f73a8cf00cd49)), closes [#12053](https://github.com/aws/aws-cdk/issues/12053)
* **eks:** k8s resources accidentally deleted due to logical ID change ([#12053](https://github.com/aws/aws-cdk/issues/12053)) ([019852e](https://github.com/aws/aws-cdk/commit/019852e4834327d848c9fe8dc271f1d4d5117fb8)), closes [#10397](https://github.com/aws/aws-cdk/issues/10397) [#10397](https://github.com/aws/aws-cdk/issues/10397)
* **elasticsearch:** Defining 2 domains with logging enabled in the same stack fails on construct id conflict ([#12055](https://github.com/aws/aws-cdk/issues/12055)) ([ec3ce19](https://github.com/aws/aws-cdk/commit/ec3ce19bc8203703cb1abcecdb2afc674c2013f6)), closes [#12017](https://github.com/aws/aws-cdk/issues/12017)
* **elasticsearch:** log policies are overwritten when creating 2 domains which also results in a failure while destroying the stack ([#12056](https://github.com/aws/aws-cdk/issues/12056)) ([889d089](https://github.com/aws/aws-cdk/commit/889d0892bae10243e03900f0ae6db078fc7eb320)), closes [#12016](https://github.com/aws/aws-cdk/issues/12016)
* **stepfunctions-tasks:** policies created for EMR tasks have ARNs that are not partition-aware ([#11553](https://github.com/aws/aws-cdk/issues/11553)) ([1cf6713](https://github.com/aws/aws-cdk/commit/1cf6713b778c789af7a420ad890910a9516473f0)), closes [#11503](https://github.com/aws/aws-cdk/issues/11503)


* **apigatewayv2:** apiEndpoint is elevated to the IHttpApi interface ([#11988](https://github.com/aws/aws-cdk/issues/11988)) ([bc5b9b6](https://github.com/aws/aws-cdk/commit/bc5b9b659444bfbef9cfc3c8666fce7e6f45465a))

## [1.78.0](https://github.com/aws/aws-cdk/compare/v1.77.0...v1.78.0) (2020-12-11)


Expand Down
81 changes: 74 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,31 @@ Here are a few useful commands:
evaluate only the rule specified [awslint README](./packages/awslint/README.md)
for details on include/exclude rule patterns.


#### jsii-rosetta

**jsii-rosetta** can be used to verify that all code examples included in documentation for a package (including those
in `README.md`) successfully compile against the library they document. It is recommended to run it to ensure all
examples are still accurate. Successfully building examples is also necessary to ensure the best possible translation to
other supported languages (`C#`, `Java`, `Python`, ...).

> Note that examples may use libraries that are not part of the `dependencies` or `devDependencies` of the documented
> package. For example `@aws-cdk/core` contains mainy examples that leverage libraries built *on top of it* (such as
> `@aws-cdk/aws-sns`). Such libraries must be built (using `yarn build`) before **jsii-rosetta** can verify that
> examples are correct.
To run **jsii-rosetta** in *strict* mode (so that it always fails when encountering examples that fail to compile), use
the following command:

```console
$ yarn rosetta:extract --strict
```

For more information on how you can address examples that fail compiling due to missing fixtures (declarations that are
necessary for the example to compile, but which would distract the reader away from what is being demonstrated), you
might need to introduce [rosetta fixtures](https://github.com/aws/jsii/tree/main/packages/jsii-rosetta#fixtures). Refer
to the [Examples](#examples) section.

### cfn2ts

This tool is used to generate our low-level CloudFormation resources
Expand Down Expand Up @@ -685,6 +710,8 @@ can be used in these cases.

### Examples

#### Fixture Files

Examples typed in fenced code blocks (looking like `'''ts`, but then with backticks
instead of regular quotes) will be automatically extrated, compiled and translated
to other languages when the bindings are generated.
Expand All @@ -694,7 +721,7 @@ a *fixture*, which looks like this:

```
'''ts fixture=with-bucket
bucket.addLifecycleTransition({ ... });
bucket.addLifecycleTransition({ ...props });
'''
```

Expand All @@ -717,8 +744,8 @@ contain three slashes to achieve the same effect:
```
/**
* @example
* /// fixture=with-bucket
* bucket.addLifecycleTransition({ ... });
* /// fixture=with-bucket
* bucket.addLifecycleTransition({ ...props });
*/
```

Expand All @@ -732,12 +759,52 @@ the current package.
For a practical example of how making sample code compilable works, see the
`aws-ec2` package.

#### Recommendations

In order to offer a consistent documentation style throughout the AWS CDK
codebase, example code should follow the following recommendations (there may be
cases where some of those do not apply - good judgement is to be applied):

- Types from the documented module should be **un-qualified**

```ts
// An example in the @aws-cdk/core library, which defines Duration
Duration.minutes(15);
```

- Types from other modules should be **qualified**

```ts
// An example in the @aws-cdk/core library, using something from @aws-cdk/aws-s3
const bucket = new s3.Bucket(this, 'Bucket');
// ...rest of the example...
```

- Within `.ts-fixture` files, make use of `declare` statements instead of
writing a compatible value (this will make your fixtures more durable):

```ts
// An hypothetical 'rosetta/default.ts-fixture' file in `@aws-cdk/core`
import * as kms from '@aws-cdk/aws-kms';
import * as s3 from '@aws-cdk/aws-s3';
import { StackProps } from '@aws-cdk/core';
declare const kmsKey: kms.IKey;
declare const bucket: s3.Bucket;
declare const props: StackProps;
```

> Those recommendations are not verified or enforced by automated tooling. Pull
> request reviewers may however request that new sample code is edited to meet
> those requirements as needed.

#### Checking a single package

Examples of all packages are extracted and compiled as part of the packaging
step. If you are working on getting rid of example compilation errors of a
single package, you can run `scripts/compile-samples` on the package by itself.

For now, non-compiling examples will not yet block the build, but at some point
in the future they will.
single package, you can run `yarn rosetta:extract --strict` in the package's
directory (see the [**jsii-rosetta**](#jsii-rosetta) section).

### Feature Flags

Expand Down
40 changes: 32 additions & 8 deletions packages/@aws-cdk/aws-apigatewayv2/lib/http/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ export interface IHttpApi extends IResource {
*/
readonly httpApiId: string;

/**
* The default endpoint for an API
* @attribute
*/
readonly apiEndpoint: string;

/**
* The default stage
*/
Expand Down Expand Up @@ -184,6 +190,7 @@ export interface AddRoutesOptions extends BatchHttpRouteOptions {
abstract class HttpApiBase extends Resource implements IHttpApi { // note that this is not exported

public abstract readonly httpApiId: string;
public abstract readonly apiEndpoint: string;
private vpcLinks: Record<string, VpcLink> = {};

public metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric {
Expand Down Expand Up @@ -233,6 +240,21 @@ abstract class HttpApiBase extends Resource implements IHttpApi { // note that t
}
}

/**
* Attributes for importing an HttpApi into the CDK
*/
export interface HttpApiAttributes {
/**
* The identifier of the HttpApi
*/
readonly httpApiId: string;
/**
* The endpoint URL of the HttpApi
* @default - throws an error if apiEndpoint is accessed.
*/
readonly apiEndpoint?: string;
}

/**
* Create a new API Gateway HTTP API endpoint.
* @resource AWS::ApiGatewayV2::Api
Expand All @@ -241,9 +263,17 @@ export class HttpApi extends HttpApiBase {
/**
* Import an existing HTTP API into this CDK app.
*/
public static fromApiId(scope: Construct, id: string, httpApiId: string): IHttpApi {
public static fromHttpApiAttributes(scope: Construct, id: string, attrs: HttpApiAttributes): IHttpApi {
class Import extends HttpApiBase {
public readonly httpApiId = httpApiId;
public readonly httpApiId = attrs.httpApiId;
private readonly _apiEndpoint = attrs.apiEndpoint;

public get apiEndpoint(): string {
if (!this._apiEndpoint) {
throw new Error('apiEndpoint is not configured on the imported HttpApi.');
}
return this._apiEndpoint;
}
}
return new Import(scope, id);
}
Expand All @@ -252,13 +282,7 @@ export class HttpApi extends HttpApiBase {
* A human friendly name for this HTTP API. Note that this is different from `httpApiId`.
*/
public readonly httpApiName?: string;

public readonly httpApiId: string;

/**
* The default endpoint for an API
* @attribute
*/
public readonly apiEndpoint: string;

/**
Expand Down
16 changes: 11 additions & 5 deletions packages/@aws-cdk/aws-apigatewayv2/test/http/api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@ describe('HttpApi', () => {

test('import', () => {
const stack = new Stack();
const api = new HttpApi(stack, 'api', { apiName: 'customName' });
const imported = HttpApi.fromApiId(stack, 'imported', api.httpApiId );

expect(imported.httpApiId).toEqual(api.httpApiId);
const imported = HttpApi.fromHttpApiAttributes(stack, 'imported', { httpApiId: 'http-1234', apiEndpoint: 'api-endpoint' });

expect(imported.httpApiId).toEqual('http-1234');
expect(imported.apiEndpoint).toEqual('api-endpoint');
});

test('unsetting createDefaultStage', () => {
Expand Down Expand Up @@ -188,7 +187,7 @@ describe('HttpApi', () => {
// GIVEN
const stack = new Stack();
const apiId = 'importedId';
const api = HttpApi.fromApiId(stack, 'test-api', apiId);
const api = HttpApi.fromHttpApiAttributes(stack, 'test-api', { httpApiId: apiId });
const metricName = '4xxError';
const statistic = 'Sum';

Expand Down Expand Up @@ -261,6 +260,13 @@ describe('HttpApi', () => {

expect(api.apiEndpoint).toBeDefined();
});

test('apiEndpoint for imported', () => {
const stack = new Stack();
const api = HttpApi.fromHttpApiAttributes(stack, 'imported', { httpApiId: 'api-1234' });

expect(() => api.apiEndpoint).toThrow(/apiEndpoint is not configured/);
});
});

class DummyRouteIntegration implements IHttpRouteIntegration {
Expand Down
5 changes: 5 additions & 0 deletions packages/@aws-cdk/aws-appmesh/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ The `tcp()`, `http()` and `http2()` methods provide the spec necessary to define

For HTTP based routes, the match field can be used to match on a route prefix.
By default, an HTTP based route will match on `/`. All matches must start with a leading `/`.
The timeout field can also be specified for `idle` and `perRequest` timeouts.

```ts
router.addRoute('route-http', {
Expand All @@ -301,6 +302,10 @@ router.addRoute('route-http', {
match: {
serviceName: 'my-service.default.svc.cluster.local',
},
timeout: {
idle : Duration.seconds(2),
perRequest: Duration.seconds(1),
},
}),
});
```
Expand Down
Loading

0 comments on commit 8b3bf9c

Please sign in to comment.