Skip to content

Commit ec4ac25

Browse files
authored
Merge branch 'master' into gianlucb/logquerywidget-views
2 parents 4c26e83 + 2a7cce5 commit ec4ac25

File tree

56 files changed

+7119
-319
lines changed

Some content is hidden

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

56 files changed

+7119
-319
lines changed

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
{"keywords":["[@aws-cdk/aws-certificatemanager]","[aws-certificatemanager]","[certificatemanager]","[certificate manager]","[certificate-manager]","[acm]"],"labels":["@aws-cdk/aws-certificatemanager"],"assignees":["njlynch"]},
4444
{"keywords":["[@aws-cdk/aws-chatbot]","[aws-chatbot]","[chatbot]"],"labels":["@aws-cdk/aws-chatbot"],"assignees":["MrArnoldPalmer"]},
4545
{"keywords":["[@aws-cdk/aws-cloud9]","[aws-cloud9]","[cloud9]","[cloud 9]"],"labels":["@aws-cdk/aws-cloud9"],"assignees":["skinny85"]},
46-
{"keywords":["[@aws-cdk/aws-cloudformation]","[aws-cloudformation]","[cloudformation]","[cloud formation]"],"labels":["@aws-cdk/aws-cloudformation"],"assignees":["eladb"]},
46+
{"keywords":["[@aws-cdk/aws-cloudformation]","[aws-cloudformation]","[cloudformation]","[cloud formation]"],"labels":["@aws-cdk/aws-cloudformation"],"assignees":["rix0rrr"]},
4747
{"keywords":["[@aws-cdk/aws-cloudfront]","[aws-cloudfront]","[cloudfront]","[cloud front]"],"labels":["@aws-cdk/aws-cloudfront"],"assignees":["iliapolo"]},
4848
{"keywords":["[@aws-cdk/aws-cloudfront-origins]","[aws-cloudfront-origins]","[cloudfront-origins]","[cloudfront origins]"],"labels":["@aws-cdk/aws-cloudfront-origins"],"assignees":["iliapolo"]},
4949
{"keywords":["[@aws-cdk/aws-cloudtrail]","[aws-cloudtrail]","[cloudtrail]","[cloud trail]"],"labels":["@aws-cdk/aws-cloudtrail"],"assignees":["rix0rrr"]},
@@ -157,13 +157,13 @@ jobs:
157157
{"keywords":["[@aws-cdk/aws-wafregional]","[aws-wafregional]","[wafregional]","[waf regional]","[waf-regional]"],"labels":["@aws-cdk/aws-wafregional"],"assignees":["rix0rrr"]},
158158
{"keywords":["[@aws-cdk/aws-wafv2]","[aws-wafv2]","[wafv2]","[waf v2]","[waf-v2]"],"labels":["@aws-cdk/aws-wafv2"],"assignees":["rix0rrr"]},
159159
{"keywords":["[@aws-cdk/aws-workspaces]","[aws-workspaces]","[workspaces]"],"labels":["@aws-cdk/aws-workspaces"],"assignees":["NetaNir"]},
160-
{"keywords":["[@aws-cdk/cfnspec]","[cfnspec]","[cfn spec]","[cfn-spec]"],"labels":["@aws-cdk/cfnspec"],"assignees":["eladb"]},
161-
{"keywords":["[@aws-cdk/cloud-assembly-schema]","[cloud-assembly-schema]","[cloud assembly schema]"],"labels":["@aws-cdk/cloud-assembly-schema"],"assignees":["eladb"]},
160+
{"keywords":["[@aws-cdk/cfnspec]","[cfnspec]","[cfn spec]","[cfn-spec]"],"labels":["@aws-cdk/cfnspec"],"assignees":["rix0rrr"]},
161+
{"keywords":["[@aws-cdk/cloud-assembly-schema]","[cloud-assembly-schema]","[cloud assembly schema]"],"labels":["@aws-cdk/cloud-assembly-schema"],"assignees":["rix0rrr"]},
162162
{"keywords":["[@aws-cdk/cloudformation-diff]","[cloudformation-diff]","[cloudformation diff]","[cfn diff]"],"labels":["@aws-cdk/cloudformation-diff"],"assignees":["shivlaks"]},
163163
{"keywords":["[@aws-cdk/cloudformation-include]","[cloudformation-include]","[cloudformation include]","[cfn include]","[cfn-include]"],"labels":["@aws-cdk/cloudformation-include"],"assignees":["skinny85"]},
164-
{"keywords":["[@aws-cdk/core]","[core]"],"labels":["@aws-cdk/core"],"assignees":["eladb"]},
165-
{"keywords":["[@aws-cdk/custom-resources]","[custom-resources]","[custom resources]"],"labels":["@aws-cdk/custom-resources"],"assignees":["eladb"]},
166-
{"keywords":["[@aws-cdk/cx-api]","[cx-api]","[cx api]"],"labels":["@aws-cdk/cx-api"],"assignees":["eladb"]},
164+
{"keywords":["[@aws-cdk/core]","[core]"],"labels":["@aws-cdk/core"],"assignees":["rix0rrr"]},
165+
{"keywords":["[@aws-cdk/custom-resources]","[custom-resources]","[custom resources]"],"labels":["@aws-cdk/custom-resources"],"assignees":["rix0rrr"]},
166+
{"keywords":["[@aws-cdk/cx-api]","[cx-api]","[cx api]"],"labels":["@aws-cdk/cx-api"],"assignees":["rix0rrr"]},
167167
{"keywords":["[@aws-cdk/region-info]","[region-info]","[region info]"],"labels":["@aws-cdk/region-info"],"assignees":["RomainMuller"]},
168168
{"keywords":["[@aws-cdk/aws-macie]","[aws-macie]","[macie]"],"labels":["@aws-cdk/aws-macie"],"assignees":["rix0rrr"]},
169169
{"keywords":["[@aws-cdk/pipelines]","[pipelines]","[cdk pipelines]","[cdk-pipelines]"],"labels":["@aws-cdk/pipelines"],"assignees":["rix0rrr"]}

packages/@aws-cdk/aws-apigateway/lib/stage.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Construct, Duration, IResource, Resource, Stack } from '@aws-cdk/core';
1+
import { Construct, Duration, IResource, Resource, Stack, Token } from '@aws-cdk/core';
22
import { AccessLogFormat, IAccessLogDestination } from './access-log';
33
import { CfnStage } from './apigateway.generated';
44
import { Deployment } from './deployment';
@@ -210,7 +210,10 @@ export class Stage extends Resource implements IStage {
210210
if (!accessLogDestination && !accessLogFormat) {
211211
accessLogSetting = undefined;
212212
} else {
213-
if (accessLogFormat !== undefined && !/.*\$context.requestId.*/.test(accessLogFormat.toString())) {
213+
if (accessLogFormat !== undefined &&
214+
!Token.isUnresolved(accessLogFormat.toString()) &&
215+
!/.*\$context.requestId.*/.test(accessLogFormat.toString())) {
216+
214217
throw new Error('Access log must include at least `AccessLogFormat.contextRequestId()`');
215218
}
216219
if (accessLogFormat !== undefined && accessLogDestination === undefined) {

packages/@aws-cdk/aws-apigateway/test/test.stage.ts

+21
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,27 @@ export = {
333333
test.done();
334334
},
335335

336+
'does not fail when access log format is a token'(test: Test) {
337+
// GIVEN
338+
const stack = new cdk.Stack();
339+
const api = new apigateway.RestApi(stack, 'test-api', { cloudWatchRole: false, deploy: false });
340+
const deployment = new apigateway.Deployment(stack, 'my-deployment', { api });
341+
api.root.addMethod('GET');
342+
343+
// WHEN
344+
const testLogGroup = new logs.LogGroup(stack, 'LogGroup');
345+
const testFormat = apigateway.AccessLogFormat.custom(cdk.Lazy.stringValue({ produce: () => 'test' }));
346+
347+
// THEN
348+
test.doesNotThrow(() => new apigateway.Stage(stack, 'my-stage', {
349+
deployment,
350+
accessLogDestination: new apigateway.LogGroupLogDestination(testLogGroup),
351+
accessLogFormat: testFormat,
352+
}));
353+
354+
test.done();
355+
},
356+
336357
'fails when access log destination is empty'(test: Test) {
337358
// GIVEN
338359
const stack = new cdk.Stack();

packages/@aws-cdk/aws-applicationautoscaling/lib/target-tracking-scaling-policy.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ export enum PredefinedMetric {
224224
*/
225225
ECS_SERVICE_AVERAGE_CPU_UTILIZATION = 'ECSServiceAverageCPUUtilization',
226226
/**
227-
* ECS_SERVICE_AVERAGE_CPU_UTILIZATION
227+
* ECS_SERVICE_AVERAGE_MEMORY_UTILIZATION
228228
* @see https://docs.aws.amazon.com/autoscaling/application/APIReference/API_PredefinedMetricSpecification.html
229229
*/
230230
ECS_SERVICE_AVERAGE_MEMORY_UTILIZATION = 'ECSServiceAverageMemoryUtilization',

packages/@aws-cdk/aws-appmesh/lib/shared-interfaces.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export interface PortMapping {
7373
readonly port: number;
7474

7575
/**
76-
* Protocol for the VirtualNode / Route, only TCP or HTTP supported
76+
* Protocol for the VirtualNode / Route, only GRPC, HTTP, HTTP2, or TCP is supported
7777
*
7878
* @default HTTP
7979
*/

packages/@aws-cdk/aws-codebuild/lib/source.ts

-3
Original file line numberDiff line numberDiff line change
@@ -407,9 +407,6 @@ export class FilterGroup {
407407
}
408408

409409
private addFilePathFilter(pattern: string, include: boolean): FilterGroup {
410-
if (this.actions.size !== 1 || !this.actions.has(EventAction.PUSH)) {
411-
throw new Error('A file path condition cannot be added if a Group contains any event action other than PUSH');
412-
}
413410
return this.addFilter(FILE_PATH_WEBHOOK_COND, pattern, include);
414411
}
415412

packages/@aws-cdk/aws-codebuild/test/test.codebuild.ts

+5-7
Original file line numberDiff line numberDiff line change
@@ -1631,13 +1631,11 @@ export = {
16311631
test.done();
16321632
},
16331633

1634-
'cannot have file path conditions if the Group contains any action other than PUSH'(test: Test) {
1635-
const filterGroup = codebuild.FilterGroup.inEventOf(codebuild.EventAction.PULL_REQUEST_CREATED,
1636-
codebuild.EventAction.PUSH);
1637-
1638-
test.throws(() => {
1639-
filterGroup.andFilePathIsNot('.*\\.java');
1640-
}, /A file path condition cannot be added if a Group contains any event action other than PUSH/);
1634+
'can have FILE_PATH filters if the Group contains PUSH and PR_CREATED events'(test: Test) {
1635+
codebuild.FilterGroup.inEventOf(
1636+
codebuild.EventAction.PULL_REQUEST_CREATED,
1637+
codebuild.EventAction.PUSH)
1638+
.andFilePathIsNot('.*\\.java');
16411639

16421640
test.done();
16431641
},

packages/@aws-cdk/aws-codepipeline-actions/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"@types/nodeunit": "^0.0.31",
6969
"cdk-build-tools": "0.0.0",
7070
"cdk-integ-tools": "0.0.0",
71-
"lodash": "^4.17.19",
71+
"lodash": "^4.17.20",
7272
"nodeunit": "^0.11.3",
7373
"pkglint": "0.0.0"
7474
},

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ can either be email and/or SMS. Read more at [Recovering User Accounts](https://
283283
```ts
284284
new UserPool(this, 'UserPool', {
285285
...,
286-
accountRecoverySettings: AccountRecovery.EMAIL_ONLY,
286+
accountRecovery: AccountRecovery.EMAIL_ONLY,
287287
})
288288
```
289289

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

+32-5
Original file line numberDiff line numberDiff line change
@@ -638,9 +638,35 @@ Here is an example of applying some configuration to an instance:
638638

639639
```ts
640640
new ec2.Instance(this, 'Instance', {
641-
init: ec2.CloudFormationInit.fromElements(
642-
ec2.InitCommand.shellCommand('/bin/true'),
643-
),
641+
// Showing the most complex setup, if you have simpler requirements
642+
// you can use `CloudFormationInit.fromElements()`.
643+
init: ec2.CloudFormationInit.fromConfigSets({
644+
configSets: {
645+
// Applies the configs below in this order
646+
default: ['yumPreinstall', 'config'],
647+
},
648+
configs: {
649+
yumPreinstall: new ec2.InitConfig([
650+
// Install an Amazon Linux package using yum
651+
ec2.InitPackage.yum('git'),
652+
]),
653+
config: new ec2.InitConfig([
654+
// Create a JSON file from tokens (can also create other files)
655+
ec2.InitFile.fromObject('/etc/stack.json', {
656+
stackId: stack.stackId,
657+
stackName: stack.stackName,
658+
region: stack.region,
659+
}),
660+
661+
// Create a group and user
662+
ec2.InitGroup.fromName('my-group'),
663+
ec2.InitUser.fromName('my-user'),
664+
665+
// Install an RPM from the internet
666+
ec2.InitPackage.rpm('http://mirrors.ukfast.co.uk/sites/dl.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/r/rubygem-git-1.5.0-2.el8.noarch.rpm'),
667+
]),
668+
},
669+
}),
644670
initOptions: {
645671
// Optional, which configsets to activate (['default'] by default)
646672
configSets: ['default'],
@@ -654,14 +680,15 @@ new ec2.Instance(this, 'Instance', {
654680
You can have services restarted after the init process has made changes to the system.
655681
To do that, instantiate an `InitServiceRestartHandle` and pass it to the config elements
656682
that need to trigger the restart and the service itself. For example, the following
657-
config installs nginx through a custom script, and then
683+
config writes a config file for nginx, extracts an archive to the root directory, and then
658684
restarts nginx so that it picks up the new config and files:
659685

660686
```ts
661687
const handle = new ec2.InitServiceRestartHandle();
662688

663689
ec2.CloudFormationInit.fromElements(
664-
ec2.InitCommand.shellCommand('/usr/bin/custom-nginx-install.sh', { serviceRestartHandles: [handle] }),
690+
ec2.InitFile.fromString('/etc/nginx/nginx.conf', '...', { serviceRestartHandles: [handle] }),
691+
ec2.InitSource.fromBucket('/var/www/html', myBucket, 'html.zip', { serviceRestartHandles: [handle] }),
665692
ec2.InitService.enable('nginx', {
666693
serviceRestartHandle: handle,
667694
})

0 commit comments

Comments
 (0)