-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinteg.alternat.ts
More file actions
44 lines (39 loc) · 994 Bytes
/
integ.alternat.ts
File metadata and controls
44 lines (39 loc) · 994 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import { App, Stack, aws_ec2 as ec2, aws_ecr as ecr } from 'aws-cdk-lib';
import { AlterNat } from './alternat';
const app = new App();
const stack = new Stack(app, 'AlterNatStack', {
env: {
region: process.env.CDK_DEFAULT_REGION,
account: process.env.CDK_DEFAULT_ACCOUNT,
},
});
const vpc = new ec2.Vpc(stack, 'Vpc', {
natGateways: 0,
subnetConfiguration: [
{
name: 'Public',
subnetType: ec2.SubnetType.PUBLIC,
cidrMask: 24,
},
{
name: 'PrivateWithNat1',
subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS,
cidrMask: 24,
},
],
vpcName: 'alterNATVPC',
});
const alterNatProps = {
vpc: vpc,
instanceType: new ec2.InstanceType('c6gn.medium'),
enableSsm: true,
alterNatLambdaImageRepo: ecr.Repository.fromRepositoryName(
stack,
'alterNatEcrRepo',
'alternat'
),
alterNatLambdaImageTag: 'v0.2.1',
ingressCidrRanges: [vpc.vpcCidrBlock],
};
new AlterNat(stack, 'alterNat', alterNatProps);
app.synth();