Skip to content

Commit 6a1e796

Browse files
feature(core): 7.70 updated cdk version from 1.46 to 1.66 and deploy vpc dns query logging (#414)
1 parent 4c4868e commit 6a1e796

File tree

73 files changed

+396
-289
lines changed

Some content is hidden

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

73 files changed

+396
-289
lines changed

docs/developer/developer-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ The following example illustrates its purpose.
398398
```typescript
399399
const stack = new cdk.Stack();
400400
new ec2.CfnVpc(stack, 'SharedNetwork', {});
401-
stack.node.applyAspect(new AcceleratorNameTagger());
401+
Aspects.of(stack).add(new AcceleratorNameTagger());
402402
```
403403
404404
The example above synthesizes to the following CloudFormation template.

reference-artifacts/master-config-sample-snippets/sample_snippets.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44

55
---
66

7+
- Creates DNS query logging and associate to the VPC
8+
9+
```
10+
"vpc": {
11+
"dns-resolver-logging": true
12+
}
13+
```
14+
15+
---
16+
717
- Update Central Logging Kinesis stream shard count as accounts are added
818

919
```

src/core/cdk/package.json

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"devDependencies": {
1212
"@types/jest": "25.1.4",
1313
"@types/node": "12.12.6",
14-
"aws-cdk": "1.46.0",
14+
"aws-cdk": "1.66.0",
1515
"babel-jest": "25.2.0",
1616
"jest": "25.2.4",
1717
"prettier": "1.19.1",
@@ -25,25 +25,25 @@
2525
"dependencies": {
2626
"@aws-accelerator/accelerator-runtime": "workspace:^0.0.1",
2727
"@aws-accelerator/cdk-accelerator": "workspace:^0.0.1",
28-
"@aws-cdk/aws-cloudformation": "1.46.0",
29-
"@aws-cdk/aws-codebuild": "1.46.0",
30-
"@aws-cdk/aws-codepipeline": "1.46.0",
31-
"@aws-cdk/aws-codepipeline-actions": "1.46.0",
32-
"@aws-cdk/aws-dynamodb": "1.46.0",
33-
"@aws-cdk/aws-events": "1.46.0",
34-
"@aws-cdk/aws-events-targets": "1.46.0",
35-
"@aws-cdk/aws-iam": "1.46.0",
36-
"@aws-cdk/aws-kms": "1.46.0",
37-
"@aws-cdk/aws-lambda": "1.46.0",
38-
"@aws-cdk/aws-route53resolver": "1.46.0",
39-
"@aws-cdk/aws-s3": "1.46.0",
40-
"@aws-cdk/aws-s3-assets": "1.46.0",
41-
"@aws-cdk/aws-s3-deployment": "1.46.0",
42-
"@aws-cdk/aws-secretsmanager": "1.46.0",
43-
"@aws-cdk/aws-sns": "1.46.0",
44-
"@aws-cdk/aws-stepfunctions": "1.46.0",
45-
"@aws-cdk/aws-stepfunctions-tasks": "1.46.0",
46-
"@aws-cdk/core": "1.46.0",
28+
"@aws-cdk/aws-cloudformation": "1.66.0",
29+
"@aws-cdk/aws-codebuild": "1.66.0",
30+
"@aws-cdk/aws-codepipeline": "1.66.0",
31+
"@aws-cdk/aws-codepipeline-actions": "1.66.0",
32+
"@aws-cdk/aws-dynamodb": "1.66.0",
33+
"@aws-cdk/aws-events": "1.66.0",
34+
"@aws-cdk/aws-events-targets": "1.66.0",
35+
"@aws-cdk/aws-iam": "1.66.0",
36+
"@aws-cdk/aws-kms": "1.66.0",
37+
"@aws-cdk/aws-lambda": "1.66.0",
38+
"@aws-cdk/aws-route53resolver": "1.66.0",
39+
"@aws-cdk/aws-s3": "1.66.0",
40+
"@aws-cdk/aws-s3-assets": "1.66.0",
41+
"@aws-cdk/aws-s3-deployment": "1.66.0",
42+
"@aws-cdk/aws-secretsmanager": "1.66.0",
43+
"@aws-cdk/aws-sns": "1.66.0",
44+
"@aws-cdk/aws-stepfunctions": "1.66.0",
45+
"@aws-cdk/aws-stepfunctions-tasks": "1.66.0",
46+
"@aws-cdk/core": "1.66.0",
4747
"@types/cfn-response": "^1.0.3",
4848
"aws-sdk": "2.668.0",
4949
"cfn-response": "^1.0.1",

src/core/cdk/src/initial-setup.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ export namespace InitialSetup {
7676
suffixLength: 0,
7777
}),
7878
partitionKey: { name: 'id', type: dynamodb.AttributeType.STRING },
79-
encryption: dynamodb.TableEncryption.DEFAULT,
8079
});
8180

8281
const outputsTable = new dynamodb.Table(this, 'Outputs', {
@@ -88,7 +87,6 @@ export namespace InitialSetup {
8887
name: 'id',
8988
type: dynamodb.AttributeType.STRING,
9089
},
91-
encryption: dynamodb.TableEncryption.DEFAULT,
9290
});
9391

9492
const outputUtilsTable = new dynamodb.Table(this, 'OutputUtils', {
@@ -100,7 +98,6 @@ export namespace InitialSetup {
10098
name: 'id',
10199
type: dynamodb.AttributeType.STRING,
102100
},
103-
encryption: dynamodb.TableEncryption.DEFAULT,
104101
});
105102

106103
// This is the maximum time before a build times out
@@ -260,6 +257,7 @@ export namespace InitialSetup {
260257
},
261258
);
262259

260+
// tslint:disable-next-line: deprecation
263261
const createLandingZoneAccountTask = new sfn.Task(this, 'Create Landing Zone Account', {
264262
// tslint:disable-next-line: deprecation
265263
task: new tasks.StartExecution(createLandingZoneAccountStateMachine, {
@@ -306,6 +304,7 @@ export namespace InitialSetup {
306304
},
307305
});
308306

307+
// tslint:disable-next-line: deprecation
309308
const createOrganizationAccountTask = new sfn.Task(this, 'Create Organization Account', {
310309
// tslint:disable-next-line: deprecation
311310
task: new tasks.StartExecution(createOrganizationAccountStateMachine, {
@@ -376,6 +375,7 @@ export namespace InitialSetup {
376375
},
377376
);
378377

378+
// tslint:disable-next-line: deprecation
379379
const installCfnRoleMasterTask = new sfn.Task(this, 'Install CloudFormation Role in Master', {
380380
// tslint:disable-next-line: deprecation
381381
task: new tasks.StartExecution(installCfnRoleMasterStateMachine, {
@@ -407,6 +407,7 @@ export namespace InitialSetup {
407407
}),
408408
});
409409

410+
// tslint:disable-next-line: deprecation
410411
const installRolesTask = new sfn.Task(this, 'Install Execution Roles', {
411412
// tslint:disable-next-line: deprecation
412413
task: new tasks.StartExecution(installRolesStateMachine, {
@@ -442,6 +443,7 @@ export namespace InitialSetup {
442443
}),
443444
});
444445

446+
// tslint:disable-next-line: deprecation
445447
const deleteVpcTask = new sfn.Task(this, 'Delete Default Vpcs', {
446448
// tslint:disable-next-line: deprecation
447449
task: new tasks.StartExecution(deleteVpcSfn, {
@@ -524,6 +526,7 @@ export namespace InitialSetup {
524526
},
525527
);
526528

529+
// tslint:disable-next-line: deprecation
527530
const storeAllOutputsToSsmTask = new sfn.Task(this, 'Store Outputs to SSM', {
528531
// tslint:disable-next-line: deprecation
529532
task: new tasks.StartExecution(storeOutputsToSsmStateMachine, {
@@ -596,6 +599,7 @@ export namespace InitialSetup {
596599
CONFIG_BRANCH_NAME: props.configBranchName,
597600
STACK_OUTPUT_TABLE_NAME: outputsTable.tableName,
598601
};
602+
// tslint:disable-next-line: deprecation
599603
const deployTask = new sfn.Task(this, `Deploy Phase ${phase}`, {
600604
// tslint:disable-next-line: deprecation
601605
task: new tasks.StartExecution(codeBuildStateMachine, {
@@ -619,6 +623,7 @@ export namespace InitialSetup {
619623
});
620624

621625
const createStoreOutputTask = (phase: number) => {
626+
// tslint:disable-next-line: deprecation
622627
const storeOutputsTask = new sfn.Task(this, `Store Phase ${phase} Outputs`, {
623628
// tslint:disable-next-line: deprecation
624629
task: new tasks.StartExecution(storeOutputsStateMachine, {
@@ -657,6 +662,7 @@ export namespace InitialSetup {
657662
},
658663
});
659664

665+
// tslint:disable-next-line: deprecation
660666
const storeAllOutputsTask = new sfn.Task(this, `Store All Phase Outputs`, {
661667
// tslint:disable-next-line: deprecation
662668
task: new tasks.StartExecution(storeOutputsStateMachine, {
@@ -706,6 +712,7 @@ export namespace InitialSetup {
706712
}),
707713
});
708714

715+
// tslint:disable-next-line: deprecation
709716
const createConfigRecordersTask = new sfn.Task(this, 'Create Config Recorders', {
710717
// tslint:disable-next-line: deprecation
711718
task: new tasks.StartExecution(createConfigRecorderSfn, {
@@ -800,6 +807,7 @@ export namespace InitialSetup {
800807
}),
801808
});
802809

810+
// tslint:disable-next-line: deprecation
803811
const createAdConnectorTask = new sfn.Task(this, 'Create AD Connector', {
804812
// tslint:disable-next-line: deprecation
805813
task: new tasks.StartExecution(createAdConnectorStateMachine, {
@@ -836,6 +844,7 @@ export namespace InitialSetup {
836844
.otherwise(storeAllOutputsToSsmTask);
837845

838846
const commonStep1 = addScpTask.startState
847+
// tslint:disable-next-line: deprecation
839848
.next(deployPhase1Task)
840849
.next(storePhase1Output)
841850
.next(accountDefaultSettingsTask)
@@ -853,11 +862,13 @@ export namespace InitialSetup {
853862
.next(baseLineCleanupChoice);
854863

855864
const enableConfigChoice = new sfn.Choice(this, 'Create Config Recorders?')
865+
// tslint:disable-next-line: deprecation
856866
.when(sfn.Condition.stringEquals('$.baseline', 'ORGANIZATIONS'), createConfigRecordersTask.next(commonStep1))
857867
.otherwise(commonStep1)
858868
.afterwards();
859869

860870
const commonStep2 = deployPhaseRolesTask
871+
// tslint:disable-next-line: deprecation
861872
.next(storePreviousOutput)
862873
.next(deployPhase0Task)
863874
.next(storePhase0Output)
@@ -870,6 +881,7 @@ export namespace InitialSetup {
870881
.afterwards();
871882

872883
const commonDefinition = loadOrganizationsTask.startState
884+
// tslint:disable-next-line: deprecation
873885
.next(loadAccountsTask)
874886
.next(installRolesTask)
875887
.next(deleteVpcTask)
@@ -879,6 +891,7 @@ export namespace InitialSetup {
879891

880892
// Landing Zone Config Setup
881893
const alzConfigDefinition = loadLandingZoneConfigurationTask.startState
894+
// tslint:disable-next-line: deprecation
882895
.next(addRoleToServiceCatalog)
883896
.next(createLandingZoneAccountsTask)
884897
.next(commonDefinition);
@@ -891,10 +904,12 @@ export namespace InitialSetup {
891904
.otherwise(createOrganizationAccountsTask)
892905
.afterwards();
893906

907+
// tslint:disable-next-line: deprecation
894908
installCfnRoleMasterTask.next(createOrganizationAccountsTask).next(commonDefinition);
895909

896910
// // Organizations Config Setup
897911
const orgConfigDefinition = validateOuConfiguration.startState
912+
// tslint:disable-next-line: deprecation
898913
.next(loadOrgConfigurationTask)
899914
.next(cloudFormationMasterRoleChoice);
900915

src/deployments/cdk/package.json

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
"devDependencies": {
1212
"@aws-accelerator/cdk-plugin-assume-role": "workspace:^0.0.1",
1313
"@aws-accelerator/deployments-runtime": "workspace:^0.0.1",
14-
"@aws-cdk/assert": "1.46.0",
15-
"@aws-cdk/cfnspec": "1.46.0",
16-
"@aws-cdk/cloud-assembly-schema": "1.46.0",
17-
"@aws-cdk/cx-api": "1.46.0",
14+
"@aws-cdk/assert": "1.66.0",
15+
"@aws-cdk/cfnspec": "1.66.0",
16+
"@aws-cdk/cloud-assembly-schema": "1.66.0",
17+
"@aws-cdk/cx-api": "1.66.0",
1818
"@types/jest": "25.1.4",
1919
"@types/mri": "^1.1.0",
2020
"@types/node": "12.12.6",
21-
"aws-cdk": "1.46.0",
21+
"aws-cdk": "1.66.0",
2222
"babel-jest": "25.2.0",
2323
"jest": "25.2.4",
2424
"mri": "^1.1.5",
@@ -84,37 +84,37 @@
8484
"@aws-accelerator/custom-resource-associate-resolver-rules": "workspace:^0.0.1",
8585
"@aws-accelerator/custom-resource-create-resolver-rule": "workspace:^0.0.1",
8686
"@aws-accelerator/custom-resource-ssm-increase-throughput": "workspace:^0.0.1",
87-
"@aws-cdk/aws-accessanalyzer": "1.46.0",
88-
"@aws-cdk/aws-autoscaling": "1.46.0",
89-
"@aws-cdk/aws-budgets": "1.46.0",
90-
"@aws-cdk/aws-certificatemanager": "1.46.0",
91-
"@aws-cdk/aws-cloudformation": "1.46.0",
92-
"@aws-cdk/aws-cloudwatch": "1.46.0",
93-
"@aws-cdk/aws-config": "1.46.0",
94-
"@aws-cdk/aws-directoryservice": "1.46.0",
95-
"@aws-cdk/aws-ec2": "1.46.0",
96-
"@aws-cdk/aws-elasticloadbalancingv2": "1.46.0",
97-
"@aws-cdk/aws-events": "1.46.0",
98-
"@aws-cdk/aws-guardduty": "1.46.0",
99-
"@aws-cdk/aws-iam": "1.46.0",
100-
"@aws-cdk/aws-kinesis": "1.46.0",
101-
"@aws-cdk/aws-kinesisfirehose": "1.46.0",
102-
"@aws-cdk/aws-kms": "1.46.0",
103-
"@aws-cdk/aws-lambda": "1.46.0",
104-
"@aws-cdk/aws-logs": "1.46.0",
105-
"@aws-cdk/aws-ram": "1.46.0",
106-
"@aws-cdk/aws-route53": "1.46.0",
107-
"@aws-cdk/aws-route53-targets": "1.46.0",
108-
"@aws-cdk/aws-route53resolver": "1.46.0",
109-
"@aws-cdk/aws-s3": "1.46.0",
110-
"@aws-cdk/aws-s3-deployment": "1.46.0",
111-
"@aws-cdk/aws-secretsmanager": "1.46.0",
112-
"@aws-cdk/aws-securityhub": "1.46.0",
113-
"@aws-cdk/aws-sns": "1.46.0",
114-
"@aws-cdk/aws-ssm": "1.46.0",
115-
"@aws-cdk/aws-stepfunctions": "1.46.0",
116-
"@aws-cdk/core": "1.46.0",
117-
"@aws-cdk/custom-resources": "1.46.0",
87+
"@aws-cdk/aws-accessanalyzer": "1.66.0",
88+
"@aws-cdk/aws-autoscaling": "1.66.0",
89+
"@aws-cdk/aws-budgets": "1.66.0",
90+
"@aws-cdk/aws-certificatemanager": "1.66.0",
91+
"@aws-cdk/aws-cloudformation": "1.66.0",
92+
"@aws-cdk/aws-cloudwatch": "1.66.0",
93+
"@aws-cdk/aws-config": "1.66.0",
94+
"@aws-cdk/aws-directoryservice": "1.66.0",
95+
"@aws-cdk/aws-ec2": "1.66.0",
96+
"@aws-cdk/aws-elasticloadbalancingv2": "1.66.0",
97+
"@aws-cdk/aws-events": "1.66.0",
98+
"@aws-cdk/aws-guardduty": "1.66.0",
99+
"@aws-cdk/aws-iam": "1.66.0",
100+
"@aws-cdk/aws-kinesis": "1.66.0",
101+
"@aws-cdk/aws-kinesisfirehose": "1.66.0",
102+
"@aws-cdk/aws-kms": "1.66.0",
103+
"@aws-cdk/aws-lambda": "1.66.0",
104+
"@aws-cdk/aws-logs": "1.66.0",
105+
"@aws-cdk/aws-ram": "1.66.0",
106+
"@aws-cdk/aws-route53": "1.66.0",
107+
"@aws-cdk/aws-route53-targets": "1.66.0",
108+
"@aws-cdk/aws-route53resolver": "1.66.0",
109+
"@aws-cdk/aws-s3": "1.66.0",
110+
"@aws-cdk/aws-s3-deployment": "1.66.0",
111+
"@aws-cdk/aws-secretsmanager": "1.66.0",
112+
"@aws-cdk/aws-securityhub": "1.66.0",
113+
"@aws-cdk/aws-sns": "1.66.0",
114+
"@aws-cdk/aws-ssm": "1.66.0",
115+
"@aws-cdk/aws-stepfunctions": "1.66.0",
116+
"@aws-cdk/core": "1.66.0",
117+
"@aws-cdk/custom-resources": "1.66.0",
118118
"@types/cfn-response": "^1.0.3",
119119
"@types/semver": "^7.3.3",
120120
"colors": "1.4.0",

src/deployments/cdk/src/apps/phase-1.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,16 @@ export async function deploy({ acceleratorConfig, accountStacks, accounts, conte
285285
});
286286
subscriptionCheckDone.push(accountKey);
287287
}
288+
289+
// Creates resolver query logging and associate to the VPC
290+
await vpcDeployment.step4({
291+
accountKey,
292+
accountStacks,
293+
acceleratorPrefix: context.acceleratorPrefix,
294+
outputs,
295+
vpcConfig,
296+
vpcId: vpc!.id,
297+
});
288298
}
289299

290300
// Create the firewall

src/deployments/cdk/src/common/nacl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class Nacl extends cdk.Construct {
2626
const nacl = new ec2.CfnNetworkAcl(this, `Nacl-${vpcConfig.name}-${subnetConfig.name}`, {
2727
vpcId,
2828
});
29-
cdk.Tag.add(nacl, 'Name', `${subnetConfig.name}_${vpcConfig.name}_nacl`, { priority: 1000 });
29+
cdk.Tags.of(nacl).add('Name', `${subnetConfig.name}_${vpcConfig.name}_nacl`, { priority: 1000 });
3030

3131
const localSubnetDefinitions = subnetConfig.definitions;
3232
for (const sd of localSubnetDefinitions) {

src/deployments/cdk/src/common/transit-gateway-attachment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class TransitGatewayAttachment extends cdk.Construct {
1515
super(parent, name);
1616

1717
this.resource = new ec2.CfnTransitGatewayAttachment(this, 'Resource', props);
18-
cdk.Tag.add(this.resource, 'Name', props.name, { priority: 1000 });
18+
cdk.Tags.of(this.resource).add('Name', props.name, { priority: 1000 });
1919
}
2020

2121
get transitGatewayAttachmentId(): string {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export * from './outputs';
22
export * from './step-1';
33
export * from './step-2';
4+
export * from './step-4';

0 commit comments

Comments
 (0)