Skip to content

Commit

Permalink
Merge pull request #2 from awslabs/master
Browse files Browse the repository at this point in the history
Update from upstream
  • Loading branch information
ScOut3R authored Jun 12, 2019
2 parents 9b63149 + 0f30e39 commit 58de24d
Show file tree
Hide file tree
Showing 861 changed files with 42,009 additions and 27,054 deletions.
82 changes: 82 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,88 @@

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.

## [0.34.0](https://github.com/awslabs/aws-cdk/compare/v0.33.0...v0.34.0) (2019-06-07)

### Bug Fixes

* **build:** Correct buildspec so it does not fail ([#2737](https://github.com/awslabs/aws-cdk/issues/2737)) ([e362ac8](https://github.com/awslabs/aws-cdk/commit/e362ac8))
* **certificatemanager:** correct certificateArn typo in the README ([#2712](https://github.com/awslabs/aws-cdk/issues/2712)) ([2bfc1c2](https://github.com/awslabs/aws-cdk/commit/2bfc1c2))
* **cli:** don't fail if region cannot be determined ([#2721](https://github.com/awslabs/aws-cdk/issues/2721)) ([0c72ef3](https://github.com/awslabs/aws-cdk/commit/0c72ef3)), closes [#2697](https://github.com/awslabs/aws-cdk/issues/2697)
* **cli:** remove support for applets ([#2691](https://github.com/awslabs/aws-cdk/issues/2691)) ([0997ee2](https://github.com/awslabs/aws-cdk/commit/0997ee2))
* **cloudwatch:** move SNS Alarm Action to `aws-cloudwatch-actions` ([#2688](https://github.com/awslabs/aws-cdk/issues/2688)) ([e3df21a](https://github.com/awslabs/aws-cdk/commit/e3df21a))
* **codebuild:** grant the Project's Role permissions to the KMS Key if it was passed. ([#2715](https://github.com/awslabs/aws-cdk/issues/2715)) ([4e12fe6](https://github.com/awslabs/aws-cdk/commit/4e12fe6))
* **core:** apply overrides after rendering properties ([#2685](https://github.com/awslabs/aws-cdk/issues/2685)) ([f2636e5](https://github.com/awslabs/aws-cdk/commit/f2636e5)), closes [#2677](https://github.com/awslabs/aws-cdk/issues/2677)
* **core:** Make filterUndefined null-safe ([#2789](https://github.com/awslabs/aws-cdk/issues/2789)) ([e4fb811](https://github.com/awslabs/aws-cdk/commit/e4fb811)), closes [awslabs/jsii#523](https://github.com/awslabs/jsii/issues/523)
* **ecs:** remove LoadBalancedFargateServiceApplet, no longer supported ([#2779](https://github.com/awslabs/aws-cdk/issues/2779)) ([a610017](https://github.com/awslabs/aws-cdk/commit/a610017))
* **ecs-patterns:** expose service on queue worker services ([#2780](https://github.com/awslabs/aws-cdk/issues/2780)) ([6d83cb9](https://github.com/awslabs/aws-cdk/commit/6d83cb9))
* **pkglint:** Adjust stability banner style ([#2768](https://github.com/awslabs/aws-cdk/issues/2768)) ([da94d8b](https://github.com/awslabs/aws-cdk/commit/da94d8b))
* **route53:** support zone roots as record names ([#2705](https://github.com/awslabs/aws-cdk/issues/2705)) ([08a2852](https://github.com/awslabs/aws-cdk/commit/08a2852))
* **stepfunctions:** improve Task payload encoding ([#2706](https://github.com/awslabs/aws-cdk/issues/2706)) ([1c13faa](https://github.com/awslabs/aws-cdk/commit/1c13faa))


### Code Refactoring

* Construct props must not use the 'any' type (awslint:props-no-any) ([#2701](https://github.com/awslabs/aws-cdk/issues/2701)) ([cb2b334](https://github.com/awslabs/aws-cdk/commit/cb2b334)), closes [#2673](https://github.com/awslabs/aws-cdk/issues/2673)
* remove deprecated modules ([#2693](https://github.com/awslabs/aws-cdk/issues/2693)) ([421bf6d](https://github.com/awslabs/aws-cdk/commit/421bf6d))
* **core:** improvements to Construct API ([#2767](https://github.com/awslabs/aws-cdk/issues/2767)) ([3f7a0ad](https://github.com/awslabs/aws-cdk/commit/3f7a0ad)), closes [#1934](https://github.com/awslabs/aws-cdk/issues/1934) [#2766](https://github.com/awslabs/aws-cdk/issues/2766)
* **core:** misc cleanups to App-related APIs ([#2731](https://github.com/awslabs/aws-cdk/issues/2731)) ([b2e1964](https://github.com/awslabs/aws-cdk/commit/b2e1964)), closes [#1891](https://github.com/awslabs/aws-cdk/issues/1891) [#2750](https://github.com/awslabs/aws-cdk/issues/2750)
* **kms:** Rename EncryptionKeyAlias to Alias ([#2769](https://github.com/awslabs/aws-cdk/issues/2769)) ([da8e1d5](https://github.com/awslabs/aws-cdk/commit/da8e1d5))


### Features

* **core:** node.defaultChild as a shortcut to escape hatch ([#2684](https://github.com/awslabs/aws-cdk/issues/2684)) ([8cd3c23](https://github.com/awslabs/aws-cdk/commit/8cd3c23)), closes [#2290](https://github.com/awslabs/aws-cdk/issues/2290)
* **core+cli:** support tagging of stacks ([#2185](https://github.com/awslabs/aws-cdk/issues/2185)) ([d0e19d5](https://github.com/awslabs/aws-cdk/commit/d0e19d5)), closes [#932](https://github.com/awslabs/aws-cdk/issues/932)
* **event-targets:** add support for fargate/awsvpc tasks ([#2707](https://github.com/awslabs/aws-cdk/issues/2707)) ([2754dde](https://github.com/awslabs/aws-cdk/commit/2754dde))
* **events:** support SQS queues as rule targets ([#2683](https://github.com/awslabs/aws-cdk/issues/2683)) ([078e34a](https://github.com/awslabs/aws-cdk/commit/078e34a)), closes [#1786](https://github.com/awslabs/aws-cdk/issues/1786)
* **rds:** add engineVersion to DatabaseCluster ([#2698](https://github.com/awslabs/aws-cdk/issues/2698)) ([0593d51](https://github.com/awslabs/aws-cdk/commit/0593d51)), closes [#2212](https://github.com/awslabs/aws-cdk/issues/2212)
* **rds:** add support for database instances ([#2187](https://github.com/awslabs/aws-cdk/issues/2187)) ([b864041](https://github.com/awslabs/aws-cdk/commit/b864041)), closes [#2075](https://github.com/awslabs/aws-cdk/issues/2075) [#1693](https://github.com/awslabs/aws-cdk/issues/1693)
* **route53:** improve constructs for basic records ([#2741](https://github.com/awslabs/aws-cdk/issues/2741)) ([696f53f](https://github.com/awslabs/aws-cdk/commit/696f53f))
* **s3:** default to KMS if encryptionKey is specified ([#2719](https://github.com/awslabs/aws-cdk/issues/2719)) ([ae4a04f](https://github.com/awslabs/aws-cdk/commit/ae4a04f)), closes [#2714](https://github.com/awslabs/aws-cdk/issues/2714)
* **tokens:** enable type coercion ([#2680](https://github.com/awslabs/aws-cdk/issues/2680)) ([0f54698](https://github.com/awslabs/aws-cdk/commit/0f54698)), closes [#2679](https://github.com/awslabs/aws-cdk/issues/2679)


### BREAKING CHANGES

* **route53:** `recordValue: string` prop in `route53.TxtRecord` changed to `values: string[]`
* `recordValue` prop in `route53.CnameRecord` renamed to `domainName`
* `route53.AliasRecord` has been removed, use `route53.ARecord` or `route53.AaaaRecord` with the `target` prop.
* **kms:** The `EncryptionKeyAlias` class was renamed to `Alias`.
Associated types (such as `EncryptionKeyAliasProps`) were renamed in the
same way.
* **cli:** This release requires CDK CLI >= 0.34.0
* **core:** `App.run()` was renamed to `App.synth()` (soft deprecation, it will be removed in the next release).
* **core:** `node.stack` is now `Stack.of(construct)` (fixes #2766)
* **core:** `node.resolve` has been moved to `stack.resolve`.
* **core:** `node.stringifyJson` has been moved to `stack.stringifyJson`.
* **core:** `node.validateTree` is now `ConstructNode.validate(node)`
* **core:** `node.prepareTree` is now `ConstructNode.prepare(node)`
* **core:** `node.getContext` is now `node.tryGetContext`
* **core:** `node.recordReference` is now `node.addReference`
* **core:** `node.apply` is now `node.applyAspect`
* **core:** `node.ancestors()` is now `node.scopes`
* **core:** `node.required` has been removed.
* **core:** `node.typename` has been removed.
* **core:** `node.addChild` is now private
* **core:** `node.findReferences()` is now `node.references`
* **core:** `node.findDependencies()` is now `node.dependencies`
* **core:** `stack.dependencies()` is now `stack.dependencies`
* **core:** `CfnElement.stackPath` has been removed.
* **core:** `CloudFormationLang` is now internal (use `stack.toJsonString()`)
* **cloudwatch:** using an SNS topic as CloudWatch Alarm Actxion now
requires an integration object from the `@aws-cdk/aws-cloudwatch-actions`
package.
* **event-targets:** `targets.EcsEc2Task` renamed to `targets.EcsTask`
* SNS - Subscription `endpoint` is now type `string` (previously `any`)
* Step Functions - `result` in the Pass state is now type `map` (previously `any`)
* the following modules are no longer released: `@aws-cdk/applet-js`, `@aws-cdk/aws-autoscaling-api`, `@aws-cdk/aws-codedeploy-api`
* **cli:** applets are no longer supported as an app type, use "decdk" instead.
* **core:** Properties passed to `addPropertyOverride` should match in capitalization to the CloudFormation schema (normally pascal case). For example, `addPropertyOverride('accessControl', 'xxx')` should now be `addPropertyOverride('AccessControl', 'xxx')`.
* **rds**: `rds.RotationSingleUser` renamed to `rds.SecretRotation`
* **rds**: `rds.ClusterParameterGroup` no longer has `setParameter()` and `removeParameter()` methods, use the parameters prop directly in the constructor instead.



## [0.33.0](https://github.com/awslabs/aws-cdk/compare/v0.32.0...v0.33.0) (2019-05-30)

**IMPORTANT**: apps created with the CDK version 0.33.0 and above cannot be used with an older CLI version.
Expand Down
68 changes: 34 additions & 34 deletions design/aws-ecs/aws-ecs-autoscaling-queue-worker.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
# AWS ECS - L3 Construct for Autoscaling ECS/Fargate Service that Processes Items in a SQS Queue

To address issue [#2396](https://github.com/awslabs/aws-cdk/issues/2396), the AWS ECS CDK construct library should provide a way for customers to create a queue worker service (an AWS ECS/Fargate service that processes items from an sqs queue). This would mean adding new ECS CDK constructs `Ec2QueueWorkerService` and `FargateQueryWorkerService`, that would take in the necessary properties required to create a task definition, an SQS queue as well as an ECS/Fargate service and enable autoscaling for the service based on cpu usage and the SQS queue's approximateNumberOfMessagesVisible metric.
To address issue [#2396](https://github.com/awslabs/aws-cdk/issues/2396), the AWS ECS CDK construct library should provide a way for customers to create a queue processing service (an AWS ECS/Fargate service that processes items from an sqs queue). This would mean adding new ECS CDK constructs `QueueProcessingEc2Service` and `QueueProcessingFargateService`, that would take in the necessary properties required to create a task definition, an SQS queue as well as an ECS/Fargate service and enable autoscaling for the service based on cpu usage and the SQS queue's approximateNumberOfMessagesVisible metric.

## General approach

The new `ecs.QueueWorkerServiceBase`, `ecs.Ec2QueueWorkerService` and `ecs.FargateQueueWorkerService` classes will create L3 constructs for:
The new `ecs.QueueProcessingServiceBase`, `ecs.QueueProcessingEc2Service` and `ecs.QueueProcessingFargateService` classes will create L3 constructs for:

* Ec2QueueWorkerService
* FargateQueueWorkerService
* QueueProcessingEc2Service
* QueueProcessingFargateService

A `QueueWorkerService` will create a task definition with the specified container (on both EC2 and Fargate). An AWS SQS `Queue` will be created and autoscaling of the ECS Service will be dependent on both CPU as well as the SQS queue's `ApproximateNumberOfMessagesVisible` metric.
A `QueueProcessingService` will create a task definition with the specified container (on both EC2 and Fargate). An AWS SQS `Queue` will be created and autoscaling of the ECS Service will be dependent on both CPU as well as the SQS queue's `ApproximateNumberOfMessagesVisible` metric.

The `QueueWorkerService` constructs (for EC2 and Fargate) will use the following existing constructs:
The `QueueProcessingService` constructs (for EC2 and Fargate) will use the following existing constructs:

* Ec2TaskDefinition/FargateTaskDefinition - To create a Task Definition for the container to start
* SQSQueue - The queue that the worker is processing from
* SQSQueue - The queue that the service is processing from
* Ec2Service/FargateService - The Service running the container

## Code changes

Given the above, we should make the following changes to support queue workers on ECS (for both EC2 and Fargate):
1. Create `QueueWorkerServiceBaseProps` interface and `QueueWorkerServiceBase` construct
2. Create `Ec2QueueWorkerServiceProps` interface and `Ec2QueueWorkerService` construct
3. Create `FargateQueueWorkerServiceProps` interface and `FargateQueueWorkerService` construct
Given the above, we should make the following changes to support queue processing on ECS (for both EC2 and Fargate):
1. Create `QueueProcessingServiceBaseProps` interface and `QueueProcessingServiceBase` construct
2. Create `QueueProcessingEc2ServiceProps` interface and `QueueProcessingEc2Service` construct
3. Create `QueueProcessingFargateServiceProps` interface and `QueueProcessingFargateService` construct

### Part 1: Create `QueueWorkerServiceBaseProps` interface and `QueueWorkerServiceBase` construct
### Part 1: Create `QueueProcessingServiceBaseProps` interface and `QueueProcessingServiceBase` construct

The `QueueWorkerServiceBaseProps` interface will contain common properties used to construct both the Ec2QueueWorkerService and the FargateQueueWorkerService:
The `QueueProcessingServiceBaseProps` interface will contain common properties used to construct both the QueueProcessingEc2Service and the QueueProcessingFargateService:

```ts
/**
* Properties to define a Query Worker service
* Properties to define a queue processing service
*/
export interface QueueWorkerServiceBaseProps {
export interface QueueProcessingServiceBaseProps {
/**
* Cluster where service will be deployed
*/
Expand Down Expand Up @@ -100,15 +100,15 @@ export interface QueueWorkerServiceBaseProps {
}
```

### Part 2: Create `Ec2QueueWorkerServiceProps` interface and `Ec2QueueWorkerService` construct
### Part 2: Create `QueueProcessingEc2ServiceProps` interface and `QueueProcessingEc2Service` construct

The `Ec2QueueWorkerServiceProps` interface will contain properties to construct the Ec2TaskDefinition, SQSQueue and Ec2Service:
The `QueueProcessingEc2ServiceProps` interface will contain properties to construct the Ec2TaskDefinition, SQSQueue and Ec2Service:

```ts
/**
* Properties to define an ECS service
*/
export interface Ec2QueueWorkerServiceProps {
export interface QueueProcessingEc2ServiceProps {
/**
* The minimum number of CPU units to reserve for the container.
*
Expand Down Expand Up @@ -146,18 +146,18 @@ export interface Ec2QueueWorkerServiceProps {

An example use case:
```ts
// Create the vpc and cluster used by the Queue Worker task
const vpc = new ec2.VpcNetwork(stack, 'Vpc', { maxAZs: 1 });
// Create the vpc and cluster used by the queue processing service
const vpc = new ec2.Vpc(stack, 'Vpc', { maxAZs: 1 });
const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc });
cluster.addCapacity('DefaultAutoScalingGroup', {
instanceType: new ec2.InstanceType('t2.micro')
});
const queue = new sqs.Queue(stack, 'WorkerQueue', {
QueueName: 'EcsWorkerQueue'
const queue = new sqs.Queue(stack, 'ProcessingQueue', {
QueueName: 'EcsEventQueue'
});

// Create the Queue Worker task
new Ec2QueueWorkerService(stack, 'EcsQueueWorkerService', {
// Create the queue processing service
new QueueProcessingEc2Service(stack, 'QueueProcessingEc2Service', {
cluster,
image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'),
desiredTaskCount: 2,
Expand All @@ -168,15 +168,15 @@ new Ec2QueueWorkerService(stack, 'EcsQueueWorkerService', {
});
```

### Part 3: Create `FargateQueueWorkerServiceProps` interface and `FargateQueueWorkerService` construct
### Part 3: Create `QueueProcessingFargateServiceProps` interface and `QueueProcessingFargateService` construct

The `FargateQueueWorkerServiceProps` interface will contain properties to construct the FargateTaskDefinition, SQSQueue and FargateService:
The `QueueProcessingFargateServiceProps` interface will contain properties to construct the FargateTaskDefinition, SQSQueue and FargateService:

```ts
/**
* Properties to define an Fargate service
* Properties to define a Fargate service
*/
export interface FargateQueueWorkerServiceProps {
export interface QueueProcessingFargateServiceProps {
/**
* The number of cpu units used by the task.
* Valid values, which determines your range of valid values for the memory parameter:
Expand Down Expand Up @@ -218,15 +218,15 @@ export interface FargateQueueWorkerServiceProps {

An example use case:
```ts
// Create the vpc and cluster used by the Queue Worker task
const vpc = new ec2.VpcNetwork(stack, 'Vpc', { maxAZs: 2 });
// Create the vpc and cluster used by the queue processing service
const vpc = new ec2.Vpc(stack, 'Vpc', { maxAZs: 2 });
const cluster = new ecs.Cluster(stack, 'FargateCluster', { vpc });
const queue = new sqs.Queue(stack, 'WorkerQueue', {
QueueName: 'FargateWorkerQueue'
const queue = new sqs.Queue(stack, 'ProcessingQueue', {
QueueName: 'FargateEventQueue'
});

// Create the Queue Worker task
new FargateQueueWorkerService(stack, 'FargateQueueWorkerService', {
// Create the queue processing service
new QueueProcessingFargateService(stack, 'QueueProcessingFargateService', {
cluster,
image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'),
desiredTaskCount: 2,
Expand Down
2 changes: 1 addition & 1 deletion design/aws-ecs/aws-ecs-scheduled-ecs-task-construct.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ The `ScheduledEc2Task` construct will use the following existing constructs:
An example use case to create a task that is scheduled to run every minute:
```ts
// Create the vpc and cluster used by the scheduled task
const vpc = new ec2.VpcNetwork(stack, 'Vpc', { maxAZs: 1 });
const vpc = new ec2.Vpc(stack, 'Vpc', { maxAZs: 1 });
const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc });
cluster.addCapacity('DefaultAutoScalingGroup', {
instanceType: new ec2.InstanceType('t2.micro')
Expand Down
4 changes: 2 additions & 2 deletions design/aws-ecs/aws-ecs-service-discovery-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export interface NamespaceOptions {
*
* @default VPC of the cluster for Private DNS Namespace, otherwise none
*/
vpc?: ec2.IVpcNetwork;
vpc?: ec2.IVpc;
}
```

Expand Down Expand Up @@ -122,7 +122,7 @@ export interface ServiceDiscoveryOptions {
A full example would look like the following:

```
const vpc = new ec2.VpcNetwork(stack, 'Vpc', { maxAZs: 2 });
const vpc = new ec2.Vpc(stack, 'Vpc', { maxAZs: 2 });
// Cloud Map Namespace
const namespace = new servicediscovery.PrivateDnsNamespace(stack, 'MyNamespace', {
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"tools/*"
],
"rejectCycles": "true",
"version": "0.33.0"
"version": "0.34.0"
}
Loading

0 comments on commit 58de24d

Please sign in to comment.