Skip to content

Commit

Permalink
Merge branch 'master' into neptune-t4g-r6g
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Nov 30, 2021
2 parents e724982 + d911c58 commit 566d777
Show file tree
Hide file tree
Showing 547 changed files with 15,965 additions and 1,753 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/yarn-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Restore Yarn cache
uses: actions/[email protected].6
uses: actions/[email protected].7
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
Expand Down
10 changes: 0 additions & 10 deletions DEPRECATED_APIs.md
Original file line number Diff line number Diff line change
Expand Up @@ -600,20 +600,10 @@
| @aws-cdk/aws-dynamodb | Table.​grantListStreams() | Use {@link #grantTableListStreams} for more granular permission |
| @aws-cdk/aws-dynamodb | Table.​metricSystemErrors() | use `metricSystemErrorsForOperations`. |
| @aws-cdk/aws-dynamodb | TableOptions.​serverSideEncryption | This property is deprecated. In order to obtain the same behavior as enabling this, set the `encryption` property to `TableEncryption.AWS_MANAGED` instead. |
| @aws-cdk/aws-rds | Credentials.​fromUsername() | use `fromGeneratedSecret()` or `fromPassword()` for new Clusters and Instances. Note that switching from `fromUsername()` to `fromGeneratedSecret()` or `fromPassword()` for already deployed Clusters or Instances will result in their replacement! |
| @aws-cdk/aws-rds | CredentialsFromUsernameOptions | supporting API `fromUsername()` has been deprecated. See deprecation notice of the API. |
| @aws-cdk/aws-rds | CredentialsFromUsernameOptions.​password | supporting API `fromUsername()` has been deprecated. See deprecation notice of the API. |
| @aws-cdk/aws-rds | DatabaseInstanceEngine.​MARIADB | using unversioned engines is an availability risk. We recommend using versioned engines created using the {@link mariaDb()} method |
| @aws-cdk/aws-rds | DatabaseInstanceEngine.​MYSQL | using unversioned engines is an availability risk. We recommend using versioned engines created using the {@link mysql()} method |
| @aws-cdk/aws-rds | DatabaseInstanceEngine.​ORACLE_​EE | using unversioned engines is an availability risk. We recommend using versioned engines created using the {@link oracleEe()} method |
| @aws-cdk/aws-rds | DatabaseInstanceEngine.​ORACLE_​SE | instances can no longer be created with this engine. See https://forums.aws.amazon.com/ann.jspa?annID=7341 |
| @aws-cdk/aws-rds | DatabaseInstanceEngine.​ORACLE_​SE1 | instances can no longer be created with this engine. See https://forums.aws.amazon.com/ann.jspa?annID=7341 |
| @aws-cdk/aws-rds | DatabaseInstanceEngine.​ORACLE_​SE2 | using unversioned engines is an availability risk. We recommend using versioned engines created using the {@link oracleSe2()} method |
| @aws-cdk/aws-rds | DatabaseInstanceEngine.​POSTGRES | using unversioned engines is an availability risk. We recommend using versioned engines created using the {@link postgres()} method |
| @aws-cdk/aws-rds | DatabaseInstanceEngine.​SQL_​SERVER_​EE | using unversioned engines is an availability risk. We recommend using versioned engines created using the {@link sqlServerEe()} method |
| @aws-cdk/aws-rds | DatabaseInstanceEngine.​SQL_​SERVER_​EX | using unversioned engines is an availability risk. We recommend using versioned engines created using the {@link sqlServerEx()} method |
| @aws-cdk/aws-rds | DatabaseInstanceEngine.​SQL_​SERVER_​SE | using unversioned engines is an availability risk. We recommend using versioned engines created using the {@link sqlServerSe()} method |
| @aws-cdk/aws-rds | DatabaseInstanceEngine.​SQL_​SERVER_​WEB | using unversioned engines is an availability risk. We recommend using versioned engines created using the {@link sqlServerWeb()} method |
| @aws-cdk/aws-rds | DatabaseInstanceEngine.​oracleSe() | instances can no longer be created with this engine. See https://forums.aws.amazon.com/ann.jspa?annID=7341 |
| @aws-cdk/aws-rds | DatabaseInstanceEngine.​oracleSe1() | instances can no longer be created with this engine. See https://forums.aws.amazon.com/ann.jspa?annID=7341 |
| @aws-cdk/aws-rds | DatabaseInstanceNewProps.​vpcPlacement | use `vpcSubnets` |
Expand Down
10 changes: 0 additions & 10 deletions deprecated_apis.txt
Original file line number Diff line number Diff line change
Expand Up @@ -599,17 +599,8 @@ constructs.Node#uniqueId
@aws-cdk/aws-rds.Credentials#fromUsername
@aws-cdk/aws-rds.CredentialsFromUsernameOptions
@aws-cdk/aws-rds.CredentialsFromUsernameOptions#password
@aws-cdk/aws-rds.DatabaseInstanceEngine#MARIADB
@aws-cdk/aws-rds.DatabaseInstanceEngine#MYSQL
@aws-cdk/aws-rds.DatabaseInstanceEngine#ORACLE_EE
@aws-cdk/aws-rds.DatabaseInstanceEngine#ORACLE_SE
@aws-cdk/aws-rds.DatabaseInstanceEngine#ORACLE_SE1
@aws-cdk/aws-rds.DatabaseInstanceEngine#ORACLE_SE2
@aws-cdk/aws-rds.DatabaseInstanceEngine#POSTGRES
@aws-cdk/aws-rds.DatabaseInstanceEngine#SQL_SERVER_EE
@aws-cdk/aws-rds.DatabaseInstanceEngine#SQL_SERVER_EX
@aws-cdk/aws-rds.DatabaseInstanceEngine#SQL_SERVER_SE
@aws-cdk/aws-rds.DatabaseInstanceEngine#SQL_SERVER_WEB
@aws-cdk/aws-rds.DatabaseInstanceEngine#oracleSe
@aws-cdk/aws-rds.DatabaseInstanceEngine#oracleSe1
@aws-cdk/aws-rds.DatabaseInstanceNewProps#vpcPlacement
Expand Down Expand Up @@ -721,7 +712,6 @@ constructs.Node#uniqueId
@aws-cdk/aws-rds.PostgresEngineVersion#VER_9_6_6
@aws-cdk/aws-rds.PostgresEngineVersion#VER_9_6_8
@aws-cdk/aws-rds.PostgresEngineVersion#VER_9_6_9
@aws-cdk/aws-rds.SnapshotCredentials#fromGeneratedPassword
@aws-cdk/aws-rds.SqlServerEngineVersion#VER_15_00_4043_23_V1
@aws-cdk/aws-autoscaling.BlockDevice#mappingEnabled
@aws-cdk/aws-autoscaling.CommonAutoScalingGroupProps#notificationsTopic
Expand Down
35 changes: 33 additions & 2 deletions packages/@aws-cdk-containers/ecs-service-extensions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -392,11 +392,42 @@ For setting up a topic-specific queue subscription, you can provide a custom que
```ts
nameDescription.add(new QueueExtension({
queue: myEventsQueue,
eventsQueue: myEventsQueue,
subscriptions: [new TopicSubscription({
topic: new sns.Topic(stack, 'my-topic'),
// `myTopicQueue` will subscribe to the `my-topic` instead of `eventsQueue`
queue: myTopicQueue,
topicSubscriptionQueue: {
queue: myTopicQueue,
},
}],
}));
```
### Configuring auto scaling based on SQS Queues
You can scale your service up or down to maintain an acceptable queue latency by tracking the backlog per task. It configures a target tracking scaling policy with target value (acceptable backlog per task) calculated by dividing the `acceptableLatency` by `messageProcessingTime`. For example, if the maximum acceptable latency for a message to be processed after its arrival in the SQS Queue is 10 mins and the average processing time for a task is 250 milliseconds per message, then `acceptableBacklogPerTask = 10 * 60 / 0.25 = 2400`. Therefore, each queue can hold up to 2400 messages before the service starts to scale up. For this, a target tracking policy will be attached to the scaling target for your service with target value `2400`. For more information, please refer: https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-using-sqs-queue.html .
You can configure auto scaling based on SQS Queue for your service as follows:
```ts
nameDescription.add(new QueueExtension({
eventsQueue: myEventsQueue,
// Need to specify `scaleOnLatency` to configure auto scaling based on SQS Queue
scaleOnLatency: {
acceptableLatency: cdk.Duration.minutes(10),
messageProcessingTime: cdk.Duration.millis(250),
},
subscriptions: [new TopicSubscription({
topic: new sns.Topic(stack, 'my-topic'),
// `myTopicQueue` will subscribe to the `my-topic` instead of `eventsQueue`
topicSubscriptionQueue: {
queue: myTopicQueue,
// Optionally provide `scaleOnLatency` for configuring separate autoscaling for `myTopicQueue`
scaleOnLatency: {
acceptableLatency: cdk.Duration.minutes(10),
messageProcessingTime: cdk.Duration.millis(250),
}
},
}],
}));
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ export * from './cloudwatch-agent';
export * from './scale-on-cpu-utilization';
export * from './xray';
export * from './assign-public-ip';
export * from './queue';
export * from './queue/queue';
export * from './injecter';

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './queue';
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import os
import boto3
from queue_backlog_calculator import QueueHandler

def queue_handler(event, context):
"""
Handler for the lambda trigger
"""

ecs = boto3.client('ecs')
sqs = boto3.client('sqs')

queue_handler = QueueHandler(ecs_client=ecs, sqs_client=sqs, environ=os.environ)

return queue_handler.emit()
Loading

0 comments on commit 566d777

Please sign in to comment.