Skip to content

Commit 13b9884

Browse files
authored
Merge branch 'master' into feature/enable-auto-subdomain-config
2 parents d9a9540 + 66f7053 commit 13b9884

File tree

138 files changed

+8081
-894
lines changed

Some content is hidden

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

138 files changed

+8081
-894
lines changed

.gitallowed

+1
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ account: '772975370895'
2222
account: '856666278305'
2323
account: '840364872350'
2424
account: '422531588944'
25+
account: '924023996002'

link-all.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ for module in ${modules}; do
2626
# according to spec (we look in the bin/ directory instead of the { "scripts"
2727
# } entry in package.json but it's quite a bit easier.
2828
if [[ -d $module/bin ]]; then
29-
for script in $(find $module/bin -perm /111); do
29+
for script in $(find $module/bin -perm +111); do
3030
echo "${script} => node_modules/.bin/$(basename $script)"
3131
ln -fs ${script} node_modules/.bin
3232
done

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

+1
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ export class AppMeshExtension extends ServiceExtension {
165165

166166
'me-south-1': this.accountIdForRegion('me-south-1'),
167167
'ap-east-1': this.accountIdForRegion('ap-east-1'),
168+
'af-south-1': this.accountIdForRegion('af-south-1'),
168169
},
169170
});
170171

packages/@aws-cdk-containers/ecs-service-extensions/test/integ.all-service-addons.expected.json

+9
Original file line numberDiff line numberDiff line change
@@ -3354,6 +3354,9 @@
33543354
},
33553355
"ap-east-1": {
33563356
"ecrRepo": "856666278305"
3357+
},
3358+
"af-south-1": {
3359+
"ecrRepo": "924023996002"
33573360
}
33583361
},
33593362
"greetingenvoyimageaccountmapping": {
@@ -3413,6 +3416,9 @@
34133416
},
34143417
"ap-east-1": {
34153418
"ecrRepo": "856666278305"
3419+
},
3420+
"af-south-1": {
3421+
"ecrRepo": "924023996002"
34163422
}
34173423
},
34183424
"greeterenvoyimageaccountmapping": {
@@ -3472,6 +3478,9 @@
34723478
},
34733479
"ap-east-1": {
34743480
"ecrRepo": "856666278305"
3481+
},
3482+
"af-south-1": {
3483+
"ecrRepo": "924023996002"
34753484
}
34763485
}
34773486
},

packages/@aws-cdk-containers/ecs-service-extensions/test/integ.multiple-environments.expected.json

+6
Original file line numberDiff line numberDiff line change
@@ -2173,6 +2173,9 @@
21732173
},
21742174
"ap-east-1": {
21752175
"ecrRepo": "856666278305"
2176+
},
2177+
"af-south-1": {
2178+
"ecrRepo": "924023996002"
21762179
}
21772180
},
21782181
"namedevelopmentenvoyimageaccountmapping": {
@@ -2232,6 +2235,9 @@
22322235
},
22332236
"ap-east-1": {
22342237
"ecrRepo": "856666278305"
2238+
},
2239+
"af-south-1": {
2240+
"ecrRepo": "924023996002"
22352241
}
22362242
}
22372243
}

packages/@aws-cdk/aws-applicationautoscaling/lib/schedule.ts

+7
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ export abstract class Schedule {
1717
* Construct a schedule from an interval and a time unit
1818
*/
1919
public static rate(duration: Duration): Schedule {
20+
const validDurationUnit = ['minute', 'minutes', 'hour', 'hours', 'day', 'days'];
21+
if (!validDurationUnit.includes(duration.unitLabel())) {
22+
throw new Error("Allowed unit for scheduling is: 'minute', 'minutes', 'hour', 'hours', 'day' or 'days'");
23+
}
24+
if (duration.isUnresolved()) {
25+
return new LiteralSchedule(`rate(${duration.formatTokenToNumber()})`);
26+
}
2027
if (duration.toSeconds() === 0) {
2128
throw new Error('Duration cannot be 0');
2229
}

packages/@aws-cdk/aws-applicationautoscaling/test/test.cron.ts

+24-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Duration } from '@aws-cdk/core';
1+
import { Duration, Stack, Lazy } from '@aws-cdk/core';
22
import { Test } from 'nodeunit';
33
import * as appscaling from '../lib';
44

@@ -15,8 +15,15 @@ export = {
1515

1616
'rate must be whole number of minutes'(test: Test) {
1717
test.throws(() => {
18-
appscaling.Schedule.rate(Duration.seconds(12345));
19-
}, /'12345 seconds' cannot be converted into a whole number of minutes/);
18+
appscaling.Schedule.rate(Duration.minutes(0.13456));
19+
}, /'0.13456 minutes' cannot be converted into a whole number of seconds/);
20+
test.done();
21+
},
22+
23+
'rate must not be in seconds'(test: Test) {
24+
test.throws(() => {
25+
appscaling.Schedule.rate(Duration.seconds(1));
26+
}, /Allowed unit for scheduling is: 'minute', 'minutes', 'hour', 'hours', 'day' or 'days'/);
2027
test.done();
2128
},
2229

@@ -26,4 +33,18 @@ export = {
2633
}, /Duration cannot be 0/);
2734
test.done();
2835
},
36+
37+
'rate can be token'(test: Test) {
38+
const stack = new Stack();
39+
const lazyDuration = Duration.minutes(Lazy.number({ produce: () => 5 }));
40+
const rate = appscaling.Schedule.rate(lazyDuration);
41+
test.equal('rate(5 minutes)', stack.resolve(rate).expressionString);
42+
test.done();
43+
},
44+
45+
'rate can be in allowed type hours'(test: Test) {
46+
test.equal('rate(1 hour)', appscaling.Schedule.rate(Duration.hours(1))
47+
.expressionString);
48+
test.done();
49+
},
2950
};

packages/@aws-cdk/aws-appmesh/README.md

+44
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,50 @@ router.addRoute('route-http', {
320320
});
321321
```
322322

323+
Add an http2 route with retries:
324+
325+
```ts
326+
router.addRoute('route-http2-retry', {
327+
routeSpec: appmesh.RouteSpec.http2({
328+
weightedTargets: [{ virtualNode: node }],
329+
retryPolicy: {
330+
// Retry if the connection failed
331+
tcpRetryEvents: [appmesh.TcpRetryEvent.CONNECTION_ERROR],
332+
// Retry if HTTP responds with a gateway error (502, 503, 504)
333+
httpRetryEvents: [appmesh.HttpRetryEvent.GATEWAY_ERROR],
334+
// Retry five times
335+
retryAttempts: 5,
336+
// Use a 1 second timeout per retry
337+
retryTimeout: cdk.Duration.seconds(1),
338+
},
339+
}),
340+
});
341+
```
342+
343+
Add a gRPC route with retries:
344+
345+
```ts
346+
router.addRoute('route-grpc-retry', {
347+
routeSpec: appmesh.RouteSpec.grpc({
348+
weightedTargets: [{ virtualNode: node }],
349+
match: { serviceName: 'servicename' },
350+
retryPolicy: {
351+
tcpRetryEvents: [appmesh.TcpRetryEvent.CONNECTION_ERROR],
352+
httpRetryEvents: [appmesh.HttpRetryEvent.GATEWAY_ERROR],
353+
// Retry if gRPC responds that the request was cancelled, a resource
354+
// was exhausted, or if the service is unavailable
355+
grpcRetryEvents: [
356+
appmesh.GrpcRetryEvent.CANCELLED,
357+
appmesh.GrpcRetryEvent.RESOURCE_EXHAUSTED,
358+
appmesh.GrpcRetryEvent.UNAVAILABLE,
359+
],
360+
retryAttempts: 5,
361+
retryTimeout: cdk.Duration.seconds(1),
362+
},
363+
}),
364+
});
365+
```
366+
323367
The _RouteSpec_ class provides an easy interface for defining new protocol specific route specs.
324368
The `tcp()`, `http()` and `http2()` methods provide the spec necessary to define a protocol specific spec.
325369

0 commit comments

Comments
 (0)