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

Update from upstream #2

Merged
merged 27 commits into from
Jun 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
0db32de
chore: Remove the last references to sphinx (#2755)
RomainMuller Jun 5, 2019
b2e1964
refactor(core): misc cleanups to App-related APIs (#2731)
Jun 5, 2019
bbe0ea8
chore(pkglint): Require stability setting in package.json (#2736)
RomainMuller Jun 6, 2019
da94d8b
fix(pkglint): Adjust stability banner style (#2768)
RomainMuller Jun 6, 2019
da8e1d5
refactor(kms): Rename EncryptionKeyAlias to Alias (#2769)
RomainMuller Jun 6, 2019
9a34d47
chore: Mass dependency upgrade (#2738)
rix0rrr Jun 6, 2019
3f7a0ad
refactor(core): improvements to Construct API (#2767)
Jun 6, 2019
a610017
fix(ecs): remove LoadBalancedFargateServiceApplet, no longer supporte…
piradeepk Jun 7, 2019
6d83cb9
fix(ecs-patterns): expose service on queue worker services (#2780)
piradeepk Jun 7, 2019
696f53f
feat(route53): improve constructs for basic records (#2741)
jogold Jun 7, 2019
2e0848c
chore: update jsii to 0.11.1 (#2784)
rix0rrr Jun 7, 2019
5c90256
chore: fix build by fixing route53 definitions (#2788)
rix0rrr Jun 7, 2019
e4fb811
fix(core): Make filterUndefined null-safe (#2789)
RomainMuller Jun 7, 2019
7bfa4ac
chore: bump jsii to 0.11.2 (#2803)
rix0rrr Jun 10, 2019
523807c
v0.34.0 (#2791)
rix0rrr Jun 10, 2019
6daaca8
feat: formalize the concept of physical names, and use them for cross…
skinny85 Jun 11, 2019
9ce37e1
docs(changelog): add missing entries from the 0.34.0 release to the C…
skinny85 Jun 11, 2019
654cb37
fix(sqs): remove 'Batch' permissions (#2806)
rix0rrr Jun 11, 2019
1378e2d
fix(ecs-patterns): update constructs for ECS/Fargate consistency (#2795)
piradeepk Jun 11, 2019
a12fcfa
refactor(core): refactor API of Tokens (#2757)
rix0rrr Jun 11, 2019
9ef899c
refactor(sns): move subscribers to `aws-sns-subscribers` (#2804)
rix0rrr Jun 11, 2019
bbc9ef7
docs: update READMEs and sample snippets so they don't reference cons…
shivlaks Jun 11, 2019
1ae11c0
fix(aws-cdk): Move version check TTL file to home directory (#2774)
nija-at Jun 11, 2019
acf015d
feat(ecs): add metrics for Fargate services (#2798)
jogold Jun 11, 2019
da32176
feat(stepfunctions): add grantStartExecution() (#2793)
jogold Jun 11, 2019
7c022cf
chore(docs): document grant* methods in IAM documentation (#2782)
Jun 11, 2019
0f30e39
feat(cli): Remove stack rename support (#2819)
RomainMuller Jun 11, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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