Skip to content

Commit

Permalink
feat(cdk-ops): enable enhancedVpcRouting
Browse files Browse the repository at this point in the history
- Enables `enhancedVpcRouting` of the Redshift Serverless workgroup for
  production. Merges the changes on `DataWarehouseV2` back to
  `DataWarehouse`. `DataWarehouseV2` is no longer used.

issue codemonger-io#30
  • Loading branch information
kikuomax committed Oct 18, 2022
1 parent 00ab4f6 commit 39d1779
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 282 deletions.
3 changes: 1 addition & 2 deletions cdk-ops/lib/cdk-ops-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
} from './codemonger-resources';
import { ContentsPipeline } from './contents-pipeline';
import { DataWarehouse } from './data-warehouse';
import { DataWarehouseV2 } from './data-warehouse-v2';
import { LatestBoto3Layer } from './latest-boto3-layer';
import { LibdatawarehouseLayer } from './libdatawarehouse-layer';

Expand All @@ -32,7 +31,7 @@ export class CdkOpsStack extends Stack {
const pipeline = new ContentsPipeline(this, 'ContentsPipeline', {
codemongerResources,
});
const developmentDataWarehouse = new DataWarehouseV2(
const developmentDataWarehouse = new DataWarehouse(
this,
'DevelopmentDataWarehouse',
{
Expand Down
278 changes: 0 additions & 278 deletions cdk-ops/lib/data-warehouse-v2.ts

This file was deleted.

10 changes: 8 additions & 2 deletions cdk-ops/lib/data-warehouse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ export class DataWarehouse extends Construct {

this.vpc = new ec2.Vpc(this, `DwVpc`, {
cidr: '192.168.0.0/16',
enableDnsSupport: false,
enableDnsHostnames: false,
enableDnsSupport: true,
enableDnsHostnames: true,
subnetConfiguration: [
{
name: CLUSTER_SUBNET_GROUP_NAME,
Expand All @@ -71,6 +71,11 @@ export class DataWarehouse extends Construct {
cidrMask: 22,
},
],
gatewayEndpoints: {
S3: {
service: ec2.GatewayVpcEndpointAwsService.S3,
},
},
});

// provisions Redshift Serverless resources
Expand Down Expand Up @@ -128,6 +133,7 @@ export class DataWarehouse extends Construct {
namespaceName: dwNamespace.namespaceName,
baseCapacity: 32,
subnetIds: this.getSubnetIdsForCluster(),
enhancedVpcRouting: true,
tags: [
{
key: 'project',
Expand Down

0 comments on commit 39d1779

Please sign in to comment.