Skip to content

Commit 3825f59

Browse files
authored
2 parents dd5e12d + 749d5ab commit 3825f59

File tree

714 files changed

+25564
-2945
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

714 files changed

+25564
-2945
lines changed

.gitallowed

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,5 @@ account: '919830735681' #cn-northwest-1
3232
account: '297356227824'
3333
# partition aws-cn
3434
account: '193023089310'
35+
# partition aws-us-gov
36+
account: '023102451235'

.github/workflows/issue-label-assign.yml

Lines changed: 20 additions & 20 deletions
Large diffs are not rendered by default.

.github/workflows/yarn-upgrade.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
uses: actions/checkout@v2
1919

2020
- name: Set up Node
21-
uses: actions/setup-node@v2.4.1
21+
uses: actions/setup-node@v2.5.0
2222
with:
2323
node-version: 12
2424

@@ -27,7 +27,7 @@ jobs:
2727
run: echo "::set-output name=dir::$(yarn cache dir)"
2828

2929
- name: Restore Yarn cache
30-
uses: actions/[email protected].6
30+
uses: actions/[email protected].7
3131
with:
3232
path: ${{ steps.yarn-cache.outputs.dir }}
3333
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}

CHANGELOG.md

Lines changed: 118 additions & 0 deletions
Large diffs are not rendered by default.

CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,12 @@ contain three slashes to achieve the same effect:
556556
For a practical example of how making sample code compilable works, see the
557557
`aws-ec2` package.
558558

559+
> ⚠️ NOTE: README files often contain code snippets that refer to modules that are consumers
560+
> of the current module, and hence not present in the current module's dependency closure.
561+
> Compilation of these snippets will fail if the module referenced has not been built.
562+
> For the best experience when working on snippets, a full build of the CDK repo is required.
563+
> However, it may be prudent to "build up" these modules as required.
564+
559565
#### Recommendations
560566

561567
In order to offer a consistent documentation style throughout the AWS CDK

DEPRECATED_APIs.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -600,20 +600,10 @@
600600
| @aws-cdk/aws-dynamodb | Table.​grantListStreams() | Use {@link #grantTableListStreams} for more granular permission |
601601
| @aws-cdk/aws-dynamodb | Table.​metricSystemErrors() | use `metricSystemErrorsForOperations`. |
602602
| @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. |
603-
| @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! |
604603
| @aws-cdk/aws-rds | CredentialsFromUsernameOptions | supporting API `fromUsername()` has been deprecated. See deprecation notice of the API. |
605604
| @aws-cdk/aws-rds | CredentialsFromUsernameOptions.​password | supporting API `fromUsername()` has been deprecated. See deprecation notice of the API. |
606-
| @aws-cdk/aws-rds | DatabaseInstanceEngine.​MARIADB | using unversioned engines is an availability risk. We recommend using versioned engines created using the {@link mariaDb()} method |
607-
| @aws-cdk/aws-rds | DatabaseInstanceEngine.​MYSQL | using unversioned engines is an availability risk. We recommend using versioned engines created using the {@link mysql()} method |
608-
| @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 |
609605
| @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 |
610606
| @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 |
611-
| @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 |
612-
| @aws-cdk/aws-rds | DatabaseInstanceEngine.​POSTGRES | using unversioned engines is an availability risk. We recommend using versioned engines created using the {@link postgres()} method |
613-
| @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 |
614-
| @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 |
615-
| @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 |
616-
| @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 |
617607
| @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 |
618608
| @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 |
619609
| @aws-cdk/aws-rds | DatabaseInstanceNewProps.​vpcPlacement | use `vpcSubnets` |
@@ -751,7 +741,6 @@
751741
| @aws-cdk/aws-ecs | BaseService.​configureAwsVpcNetworking() | use configureAwsVpcNetworkingWithSecurityGroups instead. |
752742
| @aws-cdk/aws-ecs | BaseServiceOptions.​propagateTaskTagsFrom | Use `propagateTags` instead. |
753743
| @aws-cdk/aws-ecs | Cluster.​addAutoScalingGroup() | Use {@link Cluster.addAsgCapacityProvider} instead. |
754-
| @aws-cdk/aws-ecs | Cluster.​addCapacity() | Use {@link Cluster.addAsgCapacityProvider} instead. |
755744
| @aws-cdk/aws-ecs | Cluster.​addCapacityProvider() | Use {@link enableFargateCapacityProviders} instead. |
756745
| @aws-cdk/aws-ecs | ClusterProps.​capacityProviders | Use {@link ClusterProps.enableFargateCapacityProviders} instead. |
757746
| @aws-cdk/aws-ecs | Ec2ServiceProps.​securityGroup | use securityGroups instead. |

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ this capability, please see the
154154

155155
## More Resources
156156
* [CDK Workshop](https://cdkworkshop.com/)
157+
* [Construct Hub](https://constructs.dev) - Find and use open-source Cloud Development Kit (CDK) libraries
157158
* **[CDK Construction Zone](https://www.twitch.tv/collections/9kCOGphNZBYVdA)** - A Twitch live coding series hosted by the CDK team, season one episodes:
158159
* 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:
159160
* [S1E1](https://www.twitch.tv/videos/917691798): Triggers (part 1); **Participants:** @NetaNir, @eladb, @richardhboyd

deprecated_apis.txt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -599,17 +599,8 @@ constructs.Node#uniqueId
599599
@aws-cdk/aws-rds.Credentials#fromUsername
600600
@aws-cdk/aws-rds.CredentialsFromUsernameOptions
601601
@aws-cdk/aws-rds.CredentialsFromUsernameOptions#password
602-
@aws-cdk/aws-rds.DatabaseInstanceEngine#MARIADB
603-
@aws-cdk/aws-rds.DatabaseInstanceEngine#MYSQL
604-
@aws-cdk/aws-rds.DatabaseInstanceEngine#ORACLE_EE
605602
@aws-cdk/aws-rds.DatabaseInstanceEngine#ORACLE_SE
606603
@aws-cdk/aws-rds.DatabaseInstanceEngine#ORACLE_SE1
607-
@aws-cdk/aws-rds.DatabaseInstanceEngine#ORACLE_SE2
608-
@aws-cdk/aws-rds.DatabaseInstanceEngine#POSTGRES
609-
@aws-cdk/aws-rds.DatabaseInstanceEngine#SQL_SERVER_EE
610-
@aws-cdk/aws-rds.DatabaseInstanceEngine#SQL_SERVER_EX
611-
@aws-cdk/aws-rds.DatabaseInstanceEngine#SQL_SERVER_SE
612-
@aws-cdk/aws-rds.DatabaseInstanceEngine#SQL_SERVER_WEB
613604
@aws-cdk/aws-rds.DatabaseInstanceEngine#oracleSe
614605
@aws-cdk/aws-rds.DatabaseInstanceEngine#oracleSe1
615606
@aws-cdk/aws-rds.DatabaseInstanceNewProps#vpcPlacement
@@ -721,7 +712,6 @@ constructs.Node#uniqueId
721712
@aws-cdk/aws-rds.PostgresEngineVersion#VER_9_6_6
722713
@aws-cdk/aws-rds.PostgresEngineVersion#VER_9_6_8
723714
@aws-cdk/aws-rds.PostgresEngineVersion#VER_9_6_9
724-
@aws-cdk/aws-rds.SnapshotCredentials#fromGeneratedPassword
725715
@aws-cdk/aws-rds.SqlServerEngineVersion#VER_15_00_4043_23_V1
726716
@aws-cdk/aws-autoscaling.BlockDevice#mappingEnabled
727717
@aws-cdk/aws-autoscaling.CommonAutoScalingGroupProps#notificationsTopic
@@ -747,7 +737,6 @@ constructs.Node#uniqueId
747737
@aws-cdk/aws-ecs.BaseService#configureAwsVpcNetworking
748738
@aws-cdk/aws-ecs.BaseServiceOptions#propagateTaskTagsFrom
749739
@aws-cdk/aws-ecs.Cluster#addAutoScalingGroup
750-
@aws-cdk/aws-ecs.Cluster#addCapacity
751740
@aws-cdk/aws-ecs.Cluster#addCapacityProvider
752741
@aws-cdk/aws-ecs.ClusterProps#capacityProviders
753742
@aws-cdk/aws-ecs.Ec2ServiceProps#securityGroup

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
"fs-extra": "^9.1.0",
2121
"graceful-fs": "^4.2.8",
2222
"jest-junit": "^13.0.0",
23-
"jsii-diff": "^1.46.0",
24-
"jsii-pacmak": "^1.46.0",
25-
"jsii-reflect": "^1.46.0",
26-
"jsii-rosetta": "^1.46.0",
23+
"jsii-diff": "^1.47.0",
24+
"jsii-pacmak": "^1.47.0",
25+
"jsii-reflect": "^1.47.0",
26+
"jsii-rosetta": "^1.47.0",
2727
"lerna": "^4.0.0",
2828
"patch-package": "^6.4.7",
2929
"standard-version": "^9.3.2",

packages/@aws-cdk-containers/ecs-service-extensions/README.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,11 +392,42 @@ For setting up a topic-specific queue subscription, you can provide a custom que
392392
393393
```ts
394394
nameDescription.add(new QueueExtension({
395-
queue: myEventsQueue,
395+
eventsQueue: myEventsQueue,
396396
subscriptions: [new TopicSubscription({
397397
topic: new sns.Topic(stack, 'my-topic'),
398398
// `myTopicQueue` will subscribe to the `my-topic` instead of `eventsQueue`
399-
queue: myTopicQueue,
399+
topicSubscriptionQueue: {
400+
queue: myTopicQueue,
401+
},
402+
}],
403+
}));
404+
```
405+
406+
### Configuring auto scaling based on SQS Queues
407+
408+
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 .
409+
410+
You can configure auto scaling based on SQS Queue for your service as follows:
411+
412+
```ts
413+
nameDescription.add(new QueueExtension({
414+
eventsQueue: myEventsQueue,
415+
// Need to specify `scaleOnLatency` to configure auto scaling based on SQS Queue
416+
scaleOnLatency: {
417+
acceptableLatency: cdk.Duration.minutes(10),
418+
messageProcessingTime: cdk.Duration.millis(250),
419+
},
420+
subscriptions: [new TopicSubscription({
421+
topic: new sns.Topic(stack, 'my-topic'),
422+
// `myTopicQueue` will subscribe to the `my-topic` instead of `eventsQueue`
423+
topicSubscriptionQueue: {
424+
queue: myTopicQueue,
425+
// Optionally provide `scaleOnLatency` for configuring separate autoscaling for `myTopicQueue`
426+
scaleOnLatency: {
427+
acceptableLatency: cdk.Duration.minutes(10),
428+
messageProcessingTime: cdk.Duration.millis(250),
429+
}
430+
},
400431
}],
401432
}));
402433
```

packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ export * from './cloudwatch-agent';
66
export * from './scale-on-cpu-utilization';
77
export * from './xray';
88
export * from './assign-public-ip';
9-
export * from './queue';
9+
export * from './queue/queue';
1010
export * from './injecter';

packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/queue.ts

Lines changed: 0 additions & 212 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './queue';

0 commit comments

Comments
 (0)