Skip to content

Commit

Permalink
Merge branch 'master' into corymhall/lookuprole
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Jan 10, 2022
2 parents 29c64cd + d94d9ce commit 3c97283
Show file tree
Hide file tree
Showing 93 changed files with 2,332 additions and 273 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/yarn-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: actions/checkout@v2

- name: Set up Node
uses: actions/setup-node@v2.5.0
uses: actions/setup-node@v2.5.1
with:
node-version: 12

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

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.138.2](https://github.com/aws/aws-cdk/compare/v1.138.1...v1.138.2) (2022-01-09)


### Bug Fixes

* **cli:** breaks due to faulty version of `colors` ([#18324](https://github.com/aws/aws-cdk/issues/18324)) ([43bf9ae](https://github.com/aws/aws-cdk/commit/43bf9aec0b3c5e06d5382b29f4e8e0c91cd796ca))

## [1.138.1](https://github.com/aws/aws-cdk/compare/v1.138.0...v1.138.1) (2022-01-07)


### Bug Fixes

* **lambda-python:** asset files are generated inside the 'asset-input' folder ([#18306](https://github.com/aws/aws-cdk/issues/18306)) ([b00b44e](https://github.com/aws/aws-cdk/commit/b00b44efd6e402744725e711906b456a28cebc5b))

## [1.138.0](https://github.com/aws/aws-cdk/compare/v1.137.0...v1.138.0) (2022-01-04)


Expand Down
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ See [Gitpod section](#gitpod) on how to set up the CDK repo on Gitpod.

The following tools need to be installed on your system prior to installing the CDK:

- [Node.js >= 10.13.0](https://nodejs.org/download/release/latest-v10.x/)
- [Node.js >= 14.15.0](https://nodejs.org/download/release/latest-v14.x/)
- We recommend using a version in [Active LTS](https://nodejs.org/en/about/releases/)
- ⚠️ versions `13.0.0` to `13.6.0` are not supported due to compatibility issues with our dependencies.
- [Yarn >= 1.19.1, < 2](https://yarnpkg.com/lang/en/docs/install)
- [.NET Core SDK 3.1.x](https://www.microsoft.com/net/download)
- [Python >= 3.6.5, < 4.0](https://www.python.org/downloads/release/python-365/)
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ infrastructure definition and share it without worrying about boilerplate logic.

The CDK is available in the following languages:

* JavaScript, TypeScript ([Node.js ≥ 10.13.0](https://nodejs.org/download/release/latest-v10.x/))
* JavaScript, TypeScript ([Node.js ≥ 14.15.0](https://nodejs.org/download/release/latest-v14.x/))
- We recommend using a version in [Active LTS](https://nodejs.org/en/about/releases/)
- ⚠️ versions `13.0.0` to `13.6.0` are not supported due to compatibility issues with our dependencies.
* Python ([Python ≥ 3.6](https://www.python.org/downloads/))
* Java ([Java ≥ 8](https://www.oracle.com/technetwork/java/javase/downloads/index.html) and [Maven ≥ 3.5.4](https://maven.apache.org/download.cgi))
* .NET ([.NET Core ≥ 3.1](https://dotnet.microsoft.com/download))
Expand Down Expand Up @@ -77,8 +76,7 @@ in the CDK Developer Guide.
For a detailed walkthrough, see the [tutorial](https://docs.aws.amazon.com/cdk/latest/guide/getting_started.html#hello_world_tutorial) in the AWS CDK [Developer Guide](https://docs.aws.amazon.com/cdk/latest/guide/home.html).

### At a glance
Install or update the [AWS CDK CLI] from npm (requires [Node.js ≥ 10.13.0](https://nodejs.org/download/release/latest-v10.x/)). We recommend using a version in [Active LTS](https://nodejs.org/en/about/releases/)
⚠️ versions `13.0.0` to `13.6.0` are not supported due to compatibility issues with our dependencies.
Install or update the [AWS CDK CLI] from npm (requires [Node.js ≥ 14.15.0](https://nodejs.org/download/release/latest-v14.x/)). We recommend using a version in [Active LTS](https://nodejs.org/en/about/releases/)

```console
$ npm i -g aws-cdk
Expand Down Expand Up @@ -155,6 +153,12 @@ this capability, please see the
## More Resources
* [CDK Workshop](https://cdkworkshop.com/)
* [Construct Hub](https://constructs.dev) - Find and use open-source Cloud Development Kit (CDK) libraries
* Best Practices
* [Best practices for developing cloud applications with AWS CDK](https://aws.amazon.com/blogs/devops/best-practices-for-developing-cloud-applications-with-aws-cdk/)
* [Align with best practices while creating infrastructure using cdk aspects](https://aws.amazon.com/blogs/devops/align-with-best-practices-while-creating-infrastructure-using-cdk-aspects/)
* [Recommended AWS CDK project structure for Python applications](https://aws.amazon.com/blogs/developer/recommended-aws-cdk-project-structure-for-python-applications/)
* [Best practices for discoverability of a construct library on Construct Hub](https://aws.amazon.com/blogs/opensource/best-practices-for-discoverability-of-a-construct-library-on-construct-hub/)
* [All developer blog posts about AWS CDK](https://aws.amazon.com/blogs/developer/category/developer-tools/aws-cloud-development-kit/)
* **[CDK Construction Zone](https://www.twitch.tv/collections/9kCOGphNZBYVdA)** - A Twitch live coding series hosted by the CDK team, season one episodes:
* Triggers: Join us as we implement [Triggers](https://github.com/aws/aws-cdk-rfcs/issues/71), a Construct for configuring deploy time actions. Episodes 1-3:
* [S1E1](https://www.twitch.tv/videos/917691798): Triggers (part 1); **Participants:** @NetaNir, @eladb, @richardhboyd
Expand Down
23 changes: 23 additions & 0 deletions allowed-breaking-changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,26 @@ incompatible-argument:@aws-cdk/aws-autoscaling-hooktargets.FunctionHook.bind
incompatible-argument:@aws-cdk/aws-autoscaling-hooktargets.QueueHook.bind
incompatible-argument:@aws-cdk/aws-autoscaling-hooktargets.TopicHook.bind
incompatible-argument:@aws-cdk/aws-autoscaling.ILifecycleHookTarget.bind

# removed properties from kafka eventsources as they are not supported
removed:@aws-cdk/aws-lambda-event-sources.KafkaEventSourceProps.bisectBatchOnError
removed:@aws-cdk/aws-lambda-event-sources.KafkaEventSourceProps.maxRecordAge
removed:@aws-cdk/aws-lambda-event-sources.KafkaEventSourceProps.parallelizationFactor
removed:@aws-cdk/aws-lambda-event-sources.KafkaEventSourceProps.reportBatchItemFailures
removed:@aws-cdk/aws-lambda-event-sources.KafkaEventSourceProps.retryAttempts
removed:@aws-cdk/aws-lambda-event-sources.KafkaEventSourceProps.tumblingWindow
removed:@aws-cdk/aws-lambda-event-sources.ManagedKafkaEventSourceProps.bisectBatchOnError
removed:@aws-cdk/aws-lambda-event-sources.ManagedKafkaEventSourceProps.maxRecordAge
removed:@aws-cdk/aws-lambda-event-sources.ManagedKafkaEventSourceProps.parallelizationFactor
removed:@aws-cdk/aws-lambda-event-sources.ManagedKafkaEventSourceProps.reportBatchItemFailures
removed:@aws-cdk/aws-lambda-event-sources.ManagedKafkaEventSourceProps.retryAttempts
removed:@aws-cdk/aws-lambda-event-sources.ManagedKafkaEventSourceProps.tumblingWindow
removed:@aws-cdk/aws-lambda-event-sources.SelfManagedKafkaEventSourceProps.bisectBatchOnError
removed:@aws-cdk/aws-lambda-event-sources.SelfManagedKafkaEventSourceProps.maxRecordAge
removed:@aws-cdk/aws-lambda-event-sources.SelfManagedKafkaEventSourceProps.parallelizationFactor
removed:@aws-cdk/aws-lambda-event-sources.SelfManagedKafkaEventSourceProps.reportBatchItemFailures
removed:@aws-cdk/aws-lambda-event-sources.SelfManagedKafkaEventSourceProps.retryAttempts
removed:@aws-cdk/aws-lambda-event-sources.SelfManagedKafkaEventSourceProps.tumblingWindow
base-types:@aws-cdk/aws-lambda-event-sources.KafkaEventSourceProps
base-types:@aws-cdk/aws-lambda-event-sources.ManagedKafkaEventSourceProps
base-types:@aws-cdk/aws-lambda-event-sources.SelfManagedKafkaEventSourceProps
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"typescript": "~3.9.10"
},
"resolutions": {
"colors": "1.4.0",
"string-width": "^4.2.3"
},
"repository": {
Expand Down Expand Up @@ -179,4 +180,4 @@
"dependencies": {
"string-width": "^4.2.3"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3185,22 +3185,12 @@
"Backends": [
{
"VirtualService": {
"VirtualServiceName": {
"Fn::GetAtt": [
"namevirtualservice3DDDDF1E",
"VirtualServiceName"
]
}
"VirtualServiceName": "name.production"
}
},
{
"VirtualService": {
"VirtualServiceName": {
"Fn::GetAtt": [
"greetingvirtualservice60AD3AD9",
"VirtualServiceName"
]
}
"VirtualServiceName": "greeting.production"
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ export interface WebSocketLambdaAuthorizerProps {
/**
* The identity source for which authorization is requested.
*
* @default ['$request.header.Authorization']
* Request parameter match `'route.request.querystring|header.[a-zA-z0-9._-]+'`.
* Staged variable match `'stageVariables.[a-zA-Z0-9._-]+'`.
* Context parameter match `'context.[a-zA-Z0-9._-]+'`.
*
* @default ['route.request.header.Authorization']
*/
readonly identitySource?: string[];
}
Expand Down Expand Up @@ -56,7 +60,7 @@ export class WebSocketLambdaAuthorizer implements IWebSocketRouteAuthorizer {
this.authorizer = new WebSocketAuthorizer(options.scope, this.id, {
webSocketApi: options.route.webSocketApi,
identitySource: this.props.identitySource ?? [
'$request.header.Authorization',
'route.request.header.Authorization',
],
type: WebSocketAuthorizerType.LAMBDA,
authorizerName: this.props.authorizerName ?? this.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('WebSocketLambdaAuthorizer', () => {
Name: 'default-authorizer',
AuthorizerType: 'REQUEST',
IdentitySource: [
'$request.header.Authorization',
'route.request.header.Authorization',
],
});

Expand Down
18 changes: 18 additions & 0 deletions packages/@aws-cdk/aws-appmesh/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,24 @@ The `backends` property can be added with `node.addBackend()`. In the example, w

The `backendDefaults` property is added to the node while creating the virtual node. These are the virtual node's default settings for all backends.

The `VirtualNode.addBackend()` method is especially useful if you want to create a circular traffic flow by having a Virtual Service as a backend whose provider is that same Virtual Node:

```ts
declare const mesh: appmesh.Mesh;

const node = new appmesh.VirtualNode(this, 'node', {
mesh,
serviceDiscovery: appmesh.ServiceDiscovery.dns('node'),
});

const virtualService = new appmesh.VirtualService(this, 'service-1', {
virtualServiceProvider: appmesh.VirtualServiceProvider.virtualNode(node),
virtualServiceName: 'service1.domain.local',
});

node.addBackend(appmesh.Backend.virtualService(virtualService));
```

### Adding TLS to a listener

The `tls` property specifies TLS configuration when creating a listener for a virtual node or a virtual gateway.
Expand Down
9 changes: 8 additions & 1 deletion packages/@aws-cdk/aws-appmesh/lib/shared-interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,14 @@ class VirtualServiceBackend extends Backend {
return {
virtualServiceBackend: {
virtualService: {
virtualServiceName: this.virtualService.virtualServiceName,
/**
* We want to use the name of the Virtual Service here directly instead of
* a `{ 'Fn::GetAtt' }` CFN expression. This avoids a circular dependency in
* the case where this Virtual Node is the Virtual Service's provider.
*/
virtualServiceName: cdk.Token.isUnresolved(this.virtualService.virtualServiceName)
? (this.virtualService as any).physicalName
: this.virtualService.virtualServiceName,
clientPolicy: this.tlsClientPolicy
? {
tls: renderTlsClientPolicy(scope, this.tlsClientPolicy),
Expand Down
28 changes: 4 additions & 24 deletions packages/@aws-cdk/aws-appmesh/test/integ.mesh.expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -1040,22 +1040,12 @@
"Backends": [
{
"VirtualService": {
"VirtualServiceName": {
"Fn::GetAtt": [
"service6D174F83",
"VirtualServiceName"
]
}
"VirtualServiceName": "service1.domain.local"
}
},
{
"VirtualService": {
"VirtualServiceName": {
"Fn::GetAtt": [
"service27C65CF7D",
"VirtualServiceName"
]
}
"VirtualServiceName": "service2.domain.local"
}
}
],
Expand Down Expand Up @@ -1111,12 +1101,7 @@
"Backends": [
{
"VirtualService": {
"VirtualServiceName": {
"Fn::GetAtt": [
"service3859EB104",
"VirtualServiceName"
]
}
"VirtualServiceName": "service3.domain.local"
}
}
],
Expand Down Expand Up @@ -1241,12 +1226,7 @@
"Backends": [
{
"VirtualService": {
"VirtualServiceName": {
"Fn::GetAtt": [
"service4983B61EE",
"VirtualServiceName"
]
}
"VirtualServiceName": "service4.domain.local"
}
}
],
Expand Down
4 changes: 1 addition & 3 deletions packages/@aws-cdk/aws-appmesh/test/mesh.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,7 @@ describe('mesh', () => {
Backends: [
{
VirtualService: {
VirtualServiceName: {
'Fn::GetAtt': ['service1A48078CF', 'VirtualServiceName'],
},
VirtualServiceName: 'service1.domain.local',
},
},
],
Expand Down
81 changes: 70 additions & 11 deletions packages/@aws-cdk/aws-appmesh/test/virtual-node.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,18 @@ describe('virtual node', () => {
Backends: [
{
VirtualService: {
VirtualServiceName: {
'Fn::GetAtt': ['service1A48078CF', 'VirtualServiceName'],
},
VirtualServiceName: 'service1.domain.local',
},
},
{
VirtualService: {
VirtualServiceName: {
'Fn::GetAtt': ['service27C65CF7D', 'VirtualServiceName'],
},
VirtualServiceName: 'service2.domain.local',
},
},
],
},
MeshOwner: ABSENT,
});


});
});

Expand Down Expand Up @@ -458,9 +452,7 @@ describe('virtual node', () => {
Backends: [
{
VirtualService: {
VirtualServiceName: {
'Fn::GetAtt': ['service1A48078CF', 'VirtualServiceName'],
},
VirtualServiceName: 'service1.domain.local',
ClientPolicy: {
TLS: {
Ports: [8080, 8081],
Expand All @@ -478,8 +470,75 @@ describe('virtual node', () => {
],
},
});
});

test('you can add a Virtual Service as a backend to a Virtual Node which is the provider for that Virtual Service', () => {
// GIVEN
const stack = new cdk.Stack();

// WHEN
const mesh = new appmesh.Mesh(stack, 'mesh', {
meshName: 'test-mesh',
});

const node = new appmesh.VirtualNode(stack, 'test-node', {
mesh,
serviceDiscovery: appmesh.ServiceDiscovery.dns('test'),
});

const myVirtualService = new appmesh.VirtualService(stack, 'service-1', {
virtualServiceProvider: appmesh.VirtualServiceProvider.virtualNode(node),
virtualServiceName: 'service1.domain.local',
});

node.addBackend(appmesh.Backend.virtualService(myVirtualService));

// THEN
expect(stack).toHaveResourceLike('AWS::AppMesh::VirtualNode', {
Spec: {
Backends: [
{
VirtualService: {
VirtualServiceName: 'service1.domain.local',
},
},
],
},
});
});

test('you can add a Virtual Service with an automated name as a backend to a Virtual Node which is the provider for that Virtual Service, ', () => {
// GIVEN
const stack = new cdk.Stack();

// WHEN
const mesh = new appmesh.Mesh(stack, 'mesh', {
meshName: 'test-mesh',
});

const node = new appmesh.VirtualNode(stack, 'test-node', {
mesh,
serviceDiscovery: appmesh.ServiceDiscovery.dns('test'),
});

const myVirtualService = new appmesh.VirtualService(stack, 'service-1', {
virtualServiceProvider: appmesh.VirtualServiceProvider.virtualNode(node),
});

node.addBackend(appmesh.Backend.virtualService(myVirtualService));

// THEN
expect(stack).toHaveResourceLike('AWS::AppMesh::VirtualNode', {
Spec: {
Backends: [
{
VirtualService: {
VirtualServiceName: 'service1',
},
},
],
},
});
});
});

Expand Down
Loading

0 comments on commit 3c97283

Please sign in to comment.