From 687aa3d45b1507a0ec8c8fa60f36e839bd38ee71 Mon Sep 17 00:00:00 2001 From: Paco Hope Date: Wed, 28 Dec 2022 22:22:02 -0500 Subject: [PATCH] about ready to try it --- cdk/sfec2/sci_stack.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/cdk/sfec2/sci_stack.py b/cdk/sfec2/sci_stack.py index 883f7a6..1208534 100644 --- a/cdk/sfec2/sci_stack.py +++ b/cdk/sfec2/sci_stack.py @@ -11,13 +11,14 @@ class SciInstancesStack(cdk.Stack): super().__init__(vpcStack, construct_id, env=env, **kwargs) thisVpc = vpcStack.vpc + imageId = ec2.LookupMachineImage(name='debian-11-amd64-20221219-1234', windows=False) ec2instance = ec2.Instance(self, f"i-{thing}", vpc=vpcStack.vpc, instance_type=ec2.InstanceType("t2.nano"), - machine_image=ec2.AmazonLinuxImage(), + machine_image=imageId, block_devices=[ec2.BlockDevice( device_name="/dev/sda1", - volume=ec2.BlockDeviceVolume.ebs(50), + volume=ec2.BlockDeviceVolume.ebs(6), ) ], security_group = vpcStack.SciSG, @@ -29,18 +30,13 @@ class VpcBasisStack(cdk.Stack): super().__init__(scope, construct_id, **kwargs) self.vpc = ec2.Vpc(self, 'out-vpc', - cidr = "172.17.0.0/18", - max_azs = 3, + ip_addresses=ec2.IpAddresses.cidr('172.19.19.0/24'), + max_azs = 1, subnet_configuration=[ ec2.SubnetConfiguration( name = 'pub', subnet_type = ec2.SubnetType.PUBLIC, cidr_mask = 26 - ), - ec2.SubnetConfiguration( - name = 'pri', - subnet_type = ec2.SubnetType.PRIVATE_WITH_NAT, - cidr_mask = 20 ) ], nat_gateways = 3