@gradientedge/cdk-utils 8.148.0 → 8.150.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/lib/aws/construct/graphql-api-lambda-with-cache/main.js +6 -0
- package/dist/src/lib/aws/construct/graphql-api-lambda-with-cache/types.d.ts +1 -2
- package/dist/src/lib/aws/construct/rest-api-lambda-with-cache/main.js +6 -1
- package/dist/src/lib/aws/construct/rest-api-lambda-with-cache/types.d.ts +1 -2
- package/dist/src/lib/aws/services/virtual-private-cloud/index.d.ts +1 -0
- package/dist/src/lib/aws/services/virtual-private-cloud/index.js +1 -0
- package/dist/src/lib/aws/services/virtual-private-cloud/ipv6.d.ts +7 -0
- package/dist/src/lib/aws/services/virtual-private-cloud/ipv6.js +42 -0
- package/dist/src/lib/aws/services/virtual-private-cloud/main.d.ts +2 -1
- package/dist/src/lib/aws/services/virtual-private-cloud/main.js +15 -4
- package/dist/src/lib/aws/services/virtual-private-cloud/types.d.ts +4 -0
- package/dist/src/lib/aws/services/virtual-private-cloud/types.js +2 -0
- package/package.json +24 -24
- package/src/lib/aws/construct/graphql-api-lambda-with-cache/main.ts +5 -0
- package/src/lib/aws/construct/graphql-api-lambda-with-cache/types.ts +1 -2
- package/src/lib/aws/construct/rest-api-lambda-with-cache/main.ts +5 -1
- package/src/lib/aws/construct/rest-api-lambda-with-cache/types.ts +1 -2
- package/src/lib/aws/services/virtual-private-cloud/index.ts +1 -0
- package/src/lib/aws/services/virtual-private-cloud/ipv6.ts +58 -0
- package/src/lib/aws/services/virtual-private-cloud/main.ts +17 -5
- package/src/lib/aws/services/virtual-private-cloud/types.ts +5 -0
|
@@ -95,6 +95,12 @@ class GraphQLApiLambdaWithCache extends __1.GraphQLApiLambda {
|
|
|
95
95
|
vpc: this.graphQLVpc,
|
|
96
96
|
});
|
|
97
97
|
this.graphQLSecurityGroup.addIngressRule(aws_ec2_1.Peer.anyIpv4(), aws_ec2_1.Port.allTraffic(), 'All Traffic');
|
|
98
|
+
if (this.props.graphQLVpc.isIPV6) {
|
|
99
|
+
this.graphQLSecurityGroup.addIngressRule(aws_ec2_1.Peer.anyIpv6(), aws_ec2_1.Port.allTraffic(), 'All Traffic');
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
this.graphQLSecurityGroup.addIngressRule(aws_ec2_1.Peer.anyIpv4(), aws_ec2_1.Port.allTraffic(), 'All Traffic');
|
|
103
|
+
}
|
|
98
104
|
utils.createCfnOutput(`${this.id}-security-group-id`, this, this.graphQLSecurityGroup.securityGroupId);
|
|
99
105
|
}
|
|
100
106
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
+
import { ReplicatedElastiCacheProps, VpcProps } from '../../services';
|
|
1
2
|
import { GraphQlApiLambdaProps } from '../graphql-api-lambda';
|
|
2
|
-
import { VpcProps } from 'aws-cdk-lib/aws-ec2';
|
|
3
|
-
import { ReplicatedElastiCacheProps } from '../../services';
|
|
4
3
|
/**
|
|
5
4
|
* @deprecated Use RestApiLambdaWithCacheProps instead. This will be removed in a future release.
|
|
6
5
|
*/
|
|
@@ -70,7 +70,12 @@ class RestApiLambdaWithCache extends __1.RestApiLambda {
|
|
|
70
70
|
securityGroupName: `${this.id}-security-group-${this.props.stage}`,
|
|
71
71
|
vpc: this.restApivpc,
|
|
72
72
|
});
|
|
73
|
-
this.
|
|
73
|
+
if (this.props.restApiVpc.isIPV6) {
|
|
74
|
+
this.restApiSecurityGroup.addIngressRule(aws_ec2_1.Peer.anyIpv6(), aws_ec2_1.Port.allTraffic(), 'All Traffic');
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
this.restApiSecurityGroup.addIngressRule(aws_ec2_1.Peer.anyIpv4(), aws_ec2_1.Port.allTraffic(), 'All Traffic');
|
|
78
|
+
}
|
|
74
79
|
(0, utils_1.createCfnOutput)(`${this.id}-security-group-id`, this, this.restApiSecurityGroup.securityGroupId);
|
|
75
80
|
}
|
|
76
81
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { RestApiLambdaProps } from '../rest-api-lambda';
|
|
2
|
-
import { VpcProps } from '
|
|
3
|
-
import { ReplicatedElastiCacheProps } from '../../services';
|
|
2
|
+
import { ReplicatedElastiCacheProps, VpcProps } from '../../services';
|
|
4
3
|
/**
|
|
5
4
|
*/
|
|
6
5
|
export interface RestApiLambdaWithCacheProps extends RestApiLambdaProps {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Vpc } from 'aws-cdk-lib/aws-ec2';
|
|
2
|
+
import { CommonConstruct } from '../../common';
|
|
3
|
+
import { VpcProps } from './types';
|
|
4
|
+
export declare class Ipv6Vpc extends Vpc {
|
|
5
|
+
egressOnlyInternetGatewayId: string;
|
|
6
|
+
constructor(scope: CommonConstruct, id: string, props: VpcProps);
|
|
7
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Ipv6Vpc = void 0;
|
|
7
|
+
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
8
|
+
const aws_ec2_1 = require("aws-cdk-lib/aws-ec2");
|
|
9
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
10
|
+
class Ipv6Vpc extends aws_ec2_1.Vpc {
|
|
11
|
+
egressOnlyInternetGatewayId;
|
|
12
|
+
constructor(scope, id, props) {
|
|
13
|
+
super(scope, id, props);
|
|
14
|
+
const cfnVpcCidrBlock = new aws_ec2_1.CfnVPCCidrBlock(this, `${id}-ipv6-cidr`, {
|
|
15
|
+
amazonProvidedIpv6CidrBlock: true,
|
|
16
|
+
vpcId: this.vpcId,
|
|
17
|
+
});
|
|
18
|
+
const subnetIpv6CidrBlocks = aws_cdk_lib_1.Fn.cidr(aws_cdk_lib_1.Fn.select(0, this.vpcIpv6CidrBlocks), 256, '64');
|
|
19
|
+
lodash_1.default.forEach([...this.publicSubnets, ...this.privateSubnets, ...this.isolatedSubnets], (subnet, index) => {
|
|
20
|
+
subnet.node.addDependency(cfnVpcCidrBlock);
|
|
21
|
+
const cfnSubnet = subnet.node.defaultChild;
|
|
22
|
+
cfnSubnet.ipv6CidrBlock = aws_cdk_lib_1.Fn.select(index, subnetIpv6CidrBlocks);
|
|
23
|
+
cfnSubnet.assignIpv6AddressOnCreation = true;
|
|
24
|
+
});
|
|
25
|
+
const addDefaultIpv6Routes = (subnets, gatewayId, routerType) => subnets.forEach(subnet => subnet.addRoute(`${id}-default-route`, {
|
|
26
|
+
destinationIpv6CidrBlock: '::/0',
|
|
27
|
+
enablesInternetConnectivity: true,
|
|
28
|
+
routerId: gatewayId,
|
|
29
|
+
routerType: routerType,
|
|
30
|
+
}));
|
|
31
|
+
if (this.internetGatewayId) {
|
|
32
|
+
addDefaultIpv6Routes(this.publicSubnets, this.internetGatewayId, aws_ec2_1.RouterType.GATEWAY);
|
|
33
|
+
}
|
|
34
|
+
if (lodash_1.default.isEmpty(this.privateSubnets)) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const egressIgw = new aws_ec2_1.CfnEgressOnlyInternetGateway(this, `${id}-eigw`, { vpcId: this.vpcId });
|
|
38
|
+
this.egressOnlyInternetGatewayId = egressIgw.ref;
|
|
39
|
+
addDefaultIpv6Routes(this.privateSubnets, egressIgw.ref, aws_ec2_1.RouterType.EGRESS_ONLY_INTERNET_GATEWAY);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.Ipv6Vpc = Ipv6Vpc;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Vpc
|
|
1
|
+
import { Vpc } from 'aws-cdk-lib/aws-ec2';
|
|
2
2
|
import { CommonConstruct } from '../../common';
|
|
3
|
+
import { VpcProps } from './types';
|
|
3
4
|
/**
|
|
4
5
|
* @classdesc Provides operations on AWS VPC.
|
|
5
6
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
@@ -6,8 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.VpcManager = void 0;
|
|
7
7
|
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
8
8
|
const aws_ec2_1 = require("aws-cdk-lib/aws-ec2");
|
|
9
|
-
const utils_1 = require("../../utils");
|
|
10
9
|
const lodash_1 = __importDefault(require("lodash"));
|
|
10
|
+
const utils_1 = require("../../utils");
|
|
11
|
+
const ipv6_1 = require("./ipv6");
|
|
11
12
|
/**
|
|
12
13
|
*/
|
|
13
14
|
const CommonVpcIdentifier = 'CommonVpc';
|
|
@@ -37,9 +38,19 @@ class VpcManager {
|
|
|
37
38
|
createVpc(id, scope, props) {
|
|
38
39
|
if (!props)
|
|
39
40
|
throw `Vpc props undefined for ${id}`;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
let vpc;
|
|
42
|
+
if (props.isIPV6) {
|
|
43
|
+
vpc = new ipv6_1.Ipv6Vpc(scope, `${id}`, {
|
|
44
|
+
...props,
|
|
45
|
+
subnetConfiguration: [
|
|
46
|
+
{ name: `${id}-public`, subnetType: aws_ec2_1.SubnetType.PUBLIC },
|
|
47
|
+
{ name: `${id}-private`, subnetType: aws_ec2_1.SubnetType.PRIVATE_WITH_EGRESS },
|
|
48
|
+
],
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
vpc = new aws_ec2_1.Vpc(scope, `${id}`, props);
|
|
53
|
+
}
|
|
43
54
|
(0, utils_1.createCfnOutput)(`${id}Id`, scope, vpc.vpcId);
|
|
44
55
|
(0, utils_1.createCfnOutput)(`${id}PublicSubnetIds`, scope, lodash_1.default.map(vpc.publicSubnets, subnet => subnet.subnetId).toString());
|
|
45
56
|
(0, utils_1.createCfnOutput)(`${id}PrivateSubnetIds`, scope, lodash_1.default.map(vpc.privateSubnets, subnet => subnet.subnetId).toString());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradientedge/cdk-utils",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.150.0",
|
|
4
4
|
"description": "Utilities for AWS CDK provisioning",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"engines": {
|
|
@@ -47,42 +47,42 @@
|
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@aws-sdk/client-secrets-manager": "^3.
|
|
51
|
-
"@aws-sdk/credential-providers": "^3.
|
|
52
|
-
"@aws-sdk/types": "^3.
|
|
53
|
-
"@cdktf/provider-aws": "^18.0
|
|
54
|
-
"@cdktf/provider-azurerm": "^11.0
|
|
55
|
-
"@cdktf/provider-cloudflare": "^10.0.
|
|
50
|
+
"@aws-sdk/client-secrets-manager": "^3.470.0",
|
|
51
|
+
"@aws-sdk/credential-providers": "^3.470.0",
|
|
52
|
+
"@aws-sdk/types": "^3.468.0",
|
|
53
|
+
"@cdktf/provider-aws": "^18.1.0",
|
|
54
|
+
"@cdktf/provider-azurerm": "^11.1.0",
|
|
55
|
+
"@cdktf/provider-cloudflare": "^10.0.4",
|
|
56
56
|
"@types/lodash": "^4.14.202",
|
|
57
|
-
"@types/node": "^20.10.
|
|
57
|
+
"@types/node": "^20.10.4",
|
|
58
58
|
"@types/uuid": "^9.0.7",
|
|
59
59
|
"app-root-path": "^3.1.0",
|
|
60
|
-
"aws-cdk-lib": "^2.
|
|
61
|
-
"cdktf": "^0.19.
|
|
62
|
-
"cdktf-local-exec": "^0.4.
|
|
60
|
+
"aws-cdk-lib": "^2.114.1",
|
|
61
|
+
"cdktf": "^0.19.2",
|
|
62
|
+
"cdktf-local-exec": "^0.4.10",
|
|
63
63
|
"constructs": "^10.3.0",
|
|
64
64
|
"lodash": "^4.17.21",
|
|
65
65
|
"moment": "^2.29.4",
|
|
66
66
|
"nconf": "^0.12.1",
|
|
67
67
|
"pluralize": "^8.0.0",
|
|
68
|
-
"ts-node": "^10.9.
|
|
68
|
+
"ts-node": "^10.9.2",
|
|
69
69
|
"uuid": "^9.0.1"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"@babel/core": "^7.23.
|
|
72
|
+
"@babel/core": "^7.23.5",
|
|
73
73
|
"@babel/eslint-parser": "^7.23.3",
|
|
74
74
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
75
|
-
"@types/jest": "^29.5.
|
|
76
|
-
"@typescript-eslint/eslint-plugin": "^6.13.
|
|
77
|
-
"@typescript-eslint/parser": "^6.13.
|
|
78
|
-
"aws-cdk": "^2.
|
|
79
|
-
"better-docs": "^2.7.
|
|
75
|
+
"@types/jest": "^29.5.11",
|
|
76
|
+
"@typescript-eslint/eslint-plugin": "^6.13.2",
|
|
77
|
+
"@typescript-eslint/parser": "^6.13.2",
|
|
78
|
+
"aws-cdk": "^2.114.1",
|
|
79
|
+
"better-docs": "^2.7.3",
|
|
80
80
|
"codecov": "^3.8.3",
|
|
81
81
|
"commitizen": "^4.3.0",
|
|
82
82
|
"docdash": "^2.0.2",
|
|
83
83
|
"dotenv": "^16.3.1",
|
|
84
|
-
"eslint": "^8.
|
|
85
|
-
"eslint-config-prettier": "^9.
|
|
84
|
+
"eslint": "^8.55.0",
|
|
85
|
+
"eslint-config-prettier": "^9.1.0",
|
|
86
86
|
"eslint-plugin-import": "^2.29.0",
|
|
87
87
|
"eslint-plugin-jsdoc": "^46.9.0",
|
|
88
88
|
"husky": "^8.0.3",
|
|
@@ -94,14 +94,14 @@
|
|
|
94
94
|
"jsdoc-mermaid": "^1.0.0",
|
|
95
95
|
"jsdoc-plugin-typescript": "^2.2.1",
|
|
96
96
|
"jsdoc-to-markdown": "^8.0.0",
|
|
97
|
-
"prettier": "^3.1.
|
|
97
|
+
"prettier": "^3.1.1",
|
|
98
98
|
"prettier-plugin-organize-imports": "^3.2.4",
|
|
99
99
|
"rimraf": "^5.0.5",
|
|
100
|
-
"semantic-release": "^22.0.
|
|
100
|
+
"semantic-release": "^22.0.10",
|
|
101
101
|
"taffydb": "^2.7.3",
|
|
102
102
|
"ts-jest": "^29.1.1",
|
|
103
|
-
"ts-node": "^10.9.
|
|
104
|
-
"typescript": "5.3.
|
|
103
|
+
"ts-node": "^10.9.2",
|
|
104
|
+
"typescript": "5.3.3"
|
|
105
105
|
},
|
|
106
106
|
"optionalDependencies": {
|
|
107
107
|
"prop-types": "^15.8.1",
|
|
@@ -79,6 +79,11 @@ export class GraphQLApiLambdaWithCache extends GraphQLApiLambda {
|
|
|
79
79
|
})
|
|
80
80
|
|
|
81
81
|
this.graphQLSecurityGroup.addIngressRule(Peer.anyIpv4(), Port.allTraffic(), 'All Traffic')
|
|
82
|
+
if (this.props.graphQLVpc.isIPV6) {
|
|
83
|
+
this.graphQLSecurityGroup.addIngressRule(Peer.anyIpv6(), Port.allTraffic(), 'All Traffic')
|
|
84
|
+
} else {
|
|
85
|
+
this.graphQLSecurityGroup.addIngressRule(Peer.anyIpv4(), Port.allTraffic(), 'All Traffic')
|
|
86
|
+
}
|
|
82
87
|
|
|
83
88
|
utils.createCfnOutput(`${this.id}-security-group-id`, this, this.graphQLSecurityGroup.securityGroupId)
|
|
84
89
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
+
import { ReplicatedElastiCacheProps, VpcProps } from '../../services'
|
|
1
2
|
import { GraphQlApiLambdaProps } from '../graphql-api-lambda'
|
|
2
|
-
import { VpcProps } from 'aws-cdk-lib/aws-ec2'
|
|
3
|
-
import { ReplicatedElastiCacheProps } from '../../services'
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* @deprecated Use RestApiLambdaWithCacheProps instead. This will be removed in a future release.
|
|
@@ -77,7 +77,11 @@ export abstract class RestApiLambdaWithCache extends RestApiLambda {
|
|
|
77
77
|
vpc: this.restApivpc,
|
|
78
78
|
})
|
|
79
79
|
|
|
80
|
-
this.
|
|
80
|
+
if (this.props.restApiVpc.isIPV6) {
|
|
81
|
+
this.restApiSecurityGroup.addIngressRule(Peer.anyIpv6(), Port.allTraffic(), 'All Traffic')
|
|
82
|
+
} else {
|
|
83
|
+
this.restApiSecurityGroup.addIngressRule(Peer.anyIpv4(), Port.allTraffic(), 'All Traffic')
|
|
84
|
+
}
|
|
81
85
|
|
|
82
86
|
createCfnOutput(`${this.id}-security-group-id`, this, this.restApiSecurityGroup.securityGroupId)
|
|
83
87
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Fn } from 'aws-cdk-lib'
|
|
2
|
+
import {
|
|
3
|
+
CfnEgressOnlyInternetGateway,
|
|
4
|
+
CfnSubnet,
|
|
5
|
+
CfnVPCCidrBlock,
|
|
6
|
+
ISubnet,
|
|
7
|
+
RouterType,
|
|
8
|
+
Subnet,
|
|
9
|
+
Vpc,
|
|
10
|
+
} from 'aws-cdk-lib/aws-ec2'
|
|
11
|
+
import _ from 'lodash'
|
|
12
|
+
import { CommonConstruct } from '../../common'
|
|
13
|
+
import { VpcProps } from './types'
|
|
14
|
+
|
|
15
|
+
export class Ipv6Vpc extends Vpc {
|
|
16
|
+
public egressOnlyInternetGatewayId: string
|
|
17
|
+
|
|
18
|
+
constructor(scope: CommonConstruct, id: string, props: VpcProps) {
|
|
19
|
+
super(scope, id, props)
|
|
20
|
+
|
|
21
|
+
const cfnVpcCidrBlock = new CfnVPCCidrBlock(this, `${id}-ipv6-cidr`, {
|
|
22
|
+
amazonProvidedIpv6CidrBlock: true,
|
|
23
|
+
vpcId: this.vpcId,
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
const subnetIpv6CidrBlocks = Fn.cidr(Fn.select(0, this.vpcIpv6CidrBlocks), 256, '64')
|
|
27
|
+
|
|
28
|
+
_.forEach([...this.publicSubnets, ...this.privateSubnets, ...this.isolatedSubnets], (subnet, index) => {
|
|
29
|
+
subnet.node.addDependency(cfnVpcCidrBlock)
|
|
30
|
+
const cfnSubnet = subnet.node.defaultChild as CfnSubnet
|
|
31
|
+
cfnSubnet.ipv6CidrBlock = Fn.select(index, subnetIpv6CidrBlocks)
|
|
32
|
+
cfnSubnet.assignIpv6AddressOnCreation = true
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
const addDefaultIpv6Routes = (subnets: ISubnet[], gatewayId: string, routerType: RouterType) =>
|
|
36
|
+
subnets.forEach(subnet =>
|
|
37
|
+
(subnet as Subnet).addRoute(`${id}-default-route`, {
|
|
38
|
+
destinationIpv6CidrBlock: '::/0',
|
|
39
|
+
enablesInternetConnectivity: true,
|
|
40
|
+
routerId: gatewayId,
|
|
41
|
+
routerType: routerType,
|
|
42
|
+
})
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
if (this.internetGatewayId) {
|
|
46
|
+
addDefaultIpv6Routes(this.publicSubnets, this.internetGatewayId, RouterType.GATEWAY)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (_.isEmpty(this.privateSubnets)) {
|
|
50
|
+
return
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const egressIgw = new CfnEgressOnlyInternetGateway(this, `${id}-eigw`, { vpcId: this.vpcId })
|
|
54
|
+
this.egressOnlyInternetGatewayId = egressIgw.ref
|
|
55
|
+
|
|
56
|
+
addDefaultIpv6Routes(this.privateSubnets, egressIgw.ref, RouterType.EGRESS_ONLY_INTERNET_GATEWAY)
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Tags } from 'aws-cdk-lib'
|
|
2
|
-
import {
|
|
2
|
+
import { SubnetType, Vpc } from 'aws-cdk-lib/aws-ec2'
|
|
3
|
+
import _ from 'lodash'
|
|
3
4
|
import { CommonConstruct } from '../../common'
|
|
4
5
|
import { createCfnOutput } from '../../utils'
|
|
5
|
-
import
|
|
6
|
+
import { Ipv6Vpc } from './ipv6'
|
|
7
|
+
import { VpcProps } from './types'
|
|
6
8
|
|
|
7
9
|
/**
|
|
8
10
|
*/
|
|
@@ -33,9 +35,19 @@ export class VpcManager {
|
|
|
33
35
|
*/
|
|
34
36
|
public createVpc(id: string, scope: CommonConstruct, props: VpcProps) {
|
|
35
37
|
if (!props) throw `Vpc props undefined for ${id}`
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
|
|
39
|
+
let vpc
|
|
40
|
+
if (props.isIPV6) {
|
|
41
|
+
vpc = new Ipv6Vpc(scope, `${id}`, {
|
|
42
|
+
...props,
|
|
43
|
+
subnetConfiguration: [
|
|
44
|
+
{ name: `${id}-public`, subnetType: SubnetType.PUBLIC },
|
|
45
|
+
{ name: `${id}-private`, subnetType: SubnetType.PRIVATE_WITH_EGRESS },
|
|
46
|
+
],
|
|
47
|
+
})
|
|
48
|
+
} else {
|
|
49
|
+
vpc = new Vpc(scope, `${id}`, props)
|
|
50
|
+
}
|
|
39
51
|
|
|
40
52
|
createCfnOutput(`${id}Id`, scope, vpc.vpcId)
|
|
41
53
|
createCfnOutput(`${id}PublicSubnetIds`, scope, _.map(vpc.publicSubnets, subnet => subnet.subnetId).toString())
|